Revert "[AArch64] Add DAG combine for extract extend pattern"
[oota-llvm.git] / test / CodeGen / AArch64 / arm64-dead-register-def-bug.ll
1 ; RUN: llc -mtriple="arm64-apple-ios" < %s | FileCheck %s
2 ;
3 ; Check that the dead register definition pass is considering implicit defs.
4 ; When rematerializing through truncates, the coalescer may produce instructions
5 ; with dead defs, but live implicit-defs of subregs:
6 ; E.g. %X1<def, dead> = MOVi64imm 2, %W1<imp-def>; %X1:GPR64, %W1:GPR32
7 ; These instructions are live, and their definitions should not be rewritten.
8 ;
9 ; <rdar://problem/16492408>
10
11 define void @testcase() {
12 ; CHECK: testcase:
13 ; CHECK-NOT: orr xzr, xzr, #0x2
14
15 bb1:
16   %tmp1 = tail call float @ceilf(float 2.000000e+00)
17   %tmp2 = fptoui float %tmp1 to i64
18   br i1 undef, label %bb2, label %bb3
19
20 bb2:
21   tail call void @foo()
22   br label %bb3
23
24 bb3:
25   %tmp3 = trunc i64 %tmp2 to i32
26   tail call void @bar(i32 %tmp3)
27   ret void
28 }
29
30 declare void @foo()
31 declare void @bar(i32)
32 declare float @ceilf(float) nounwind readnone