diff options
author | Devang Patel <dpatel@apple.com> | 2011-10-11 18:09:58 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-10-11 18:09:58 +0000 |
commit | 2e350479478ccf809e2142a4f0ad8062342577cc (patch) | |
tree | 2214c443347104fc3bff47b8804b9e7b925ac7cf /test/CodeGen/X86/sink-hoist.ll | |
parent | 5f119a62376edcfe42414343f9d360151e3c1a59 (diff) | |
download | llvm-2e350479478ccf809e2142a4f0ad8062342577cc.tar.gz llvm-2e350479478ccf809e2142a4f0ad8062342577cc.tar.bz2 llvm-2e350479478ccf809e2142a4f0ad8062342577cc.tar.xz |
Add dominance check for the instruction being hoisted.
For example, MachineLICM should not hoist a load that is not guaranteed to be executed.
Radar 10254254.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141689 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/sink-hoist.ll')
-rw-r--r-- | test/CodeGen/X86/sink-hoist.ll | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/CodeGen/X86/sink-hoist.ll b/test/CodeGen/X86/sink-hoist.ll index 31f41eebc5..e13a81719e 100644 --- a/test/CodeGen/X86/sink-hoist.ll +++ b/test/CodeGen/X86/sink-hoist.ll @@ -102,6 +102,7 @@ entry: br label %bb60 bb: ; preds = %bb60 + %i.0 = phi i32 [ 0, %bb60 ] ; <i32> [#uses=2] %0 = bitcast float* %x_addr.0 to <4 x float>* ; <<4 x float>*> [#uses=1] %1 = load <4 x float>* %0, align 16 ; <<4 x float>> [#uses=4] %tmp20 = bitcast <4 x float> %1 to <4 x i32> ; <<4 x i32>> [#uses=1] @@ -129,15 +130,14 @@ bb: ; preds = %bb60 %5 = getelementptr float* %x_addr.0, i64 4 ; <float*> [#uses=1] %6 = getelementptr float* %y_addr.0, i64 4 ; <float*> [#uses=1] %7 = add i32 %i.0, 4 ; <i32> [#uses=1] - br label %bb60 + %8 = load i32* %n, align 4 ; <i32> [#uses=1] + %9 = icmp sgt i32 %8, %7 ; <i1> [#uses=1] + br i1 %9, label %bb60, label %return bb60: ; preds = %bb, %entry - %i.0 = phi i32 [ 0, %entry ], [ %7, %bb ] ; <i32> [#uses=2] %x_addr.0 = phi float* [ %x, %entry ], [ %5, %bb ] ; <float*> [#uses=2] %y_addr.0 = phi float* [ %y, %entry ], [ %6, %bb ] ; <float*> [#uses=2] - %8 = load i32* %n, align 4 ; <i32> [#uses=1] - %9 = icmp sgt i32 %8, %i.0 ; <i1> [#uses=1] - br i1 %9, label %bb, label %return + br label %bb return: ; preds = %bb60 ret void |