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 | 7139d3516526317497e70348e33a57b52ddc053c (patch) | |
tree | 2ce77ff4dc4b356455da2967ff3c3ddad33b7f16 /test/CodeGen/X86 | |
parent | b11f80e94b590c90d07254dfa2406cf504e09cd3 (diff) | |
download | llvm-7139d3516526317497e70348e33a57b52ddc053c.tar.gz llvm-7139d3516526317497e70348e33a57b52ddc053c.tar.bz2 llvm-7139d3516526317497e70348e33a57b52ddc053c.tar.xz |
Re-enable branchfolding common code hoisting optimization. Fixed a liveness test bug and also taught it to update liveins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131241 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86')
-rw-r--r-- | test/CodeGen/X86/hoist-common.ll | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CodeGen/X86/hoist-common.ll b/test/CodeGen/X86/hoist-common.ll new file mode 100644 index 0000000000..2b1550a4ff --- /dev/null +++ b/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(...) |