diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2011-05-12 20:30:01 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2011-05-12 20:30:01 +0000 |
| commit | 43054e6159cd9e4de024abbe92030986fa59deaa (patch) | |
| tree | d9f50c711f4b8ac7a6a7a26c0d6a5bf102da3da8 /llvm/test/CodeGen/X86/hoist-common.ll | |
| parent | 2d3eadac9be965295980cff47d426d233cb6647c (diff) | |
| download | bcm5719-llvm-43054e6159cd9e4de024abbe92030986fa59deaa.tar.gz bcm5719-llvm-43054e6159cd9e4de024abbe92030986fa59deaa.zip | |
Re-enable branchfolding common code hoisting optimization. Fixed a liveness test bug and also taught it to update liveins.
llvm-svn: 131241
Diffstat (limited to 'llvm/test/CodeGen/X86/hoist-common.ll')
| -rw-r--r-- | llvm/test/CodeGen/X86/hoist-common.ll | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/hoist-common.ll b/llvm/test/CodeGen/X86/hoist-common.ll new file mode 100644 index 00000000000..2b1550a4ffa --- /dev/null +++ b/llvm/test/CodeGen/X86/hoist-common.ll @@ -0,0 +1,28 @@ +; RUN: llc < %s -march=x86-64 | FileCheck %s + +; Common "xorb al, al" instruction in the two successor blocks should be +; moved to the entry block above the test + je. + +; rdar://9145558 + +define zeroext i1 @t(i32 %c) nounwind ssp { +entry: +; CHECK: t: +; CHECK: xorb %al, %al +; CHECK: test +; CHECK: je + %tobool = icmp eq i32 %c, 0 + br i1 %tobool, label %return, label %if.then + +if.then: +; CHECK: callq + %call = tail call zeroext i1 (...)* @foo() nounwind + br label %return + +return: +; CHECK: ret + %retval.0 = phi i1 [ %call, %if.then ], [ false, %entry ] + ret i1 %retval.0 +} + +declare zeroext i1 @foo(...) |

