1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-unknown-unknown -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs -o - %s | FileCheck %s
4 # Test unary_op(undef) -> 0 combines
9 tracksRegLiveness: true
13 ; CHECK-LABEL: name: abs_scalar
16 ; CHECK-NEXT: %abs:_(s32) = G_CONSTANT i32 0
17 ; CHECK-NEXT: $w0 = COPY %abs(s32)
18 ; CHECK-NEXT: RET_ReallyLR implicit $w0
19 %undef:_(s32) = G_IMPLICIT_DEF
20 %abs:_(s32) = G_ABS %undef
22 RET_ReallyLR implicit $w0
26 tracksRegLiveness: true
30 ; CHECK-LABEL: name: abs_vector
33 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
34 ; CHECK-NEXT: %abs:_(<2 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32)
35 ; CHECK-NEXT: $d0 = COPY %abs(<2 x s32>)
36 ; CHECK-NEXT: RET_ReallyLR implicit $d0
37 %undef:_(<2 x s32>) = G_IMPLICIT_DEF
38 %abs:_(<2 x s32>) = G_ABS %undef
39 $d0 = COPY %abs(<2 x s32>)
40 RET_ReallyLR implicit $d0