diff options
author | Duncan Sands <baldrick@free.fr> | 2011-10-26 20:55:21 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2011-10-26 20:55:21 +0000 |
commit | dd3149d57977d0632cfaf24290dd93416fb2a0ef (patch) | |
tree | 474b791ded4b0b4e186663009e133000d2c45814 /test/Transforms/InstSimplify/AndOrXor.ll | |
parent | 1832f4d94eb292d63824eaa043118ed6cc61389b (diff) | |
download | llvm-dd3149d57977d0632cfaf24290dd93416fb2a0ef.tar.gz llvm-dd3149d57977d0632cfaf24290dd93416fb2a0ef.tar.bz2 llvm-dd3149d57977d0632cfaf24290dd93416fb2a0ef.tar.xz |
The maximum power of 2 dividing a power of 2 is itself. This occurs
in 403.gcc and was spotted by my super-optimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143054 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstSimplify/AndOrXor.ll')
-rw-r--r-- | test/Transforms/InstSimplify/AndOrXor.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/AndOrXor.ll b/test/Transforms/InstSimplify/AndOrXor.ll new file mode 100644 index 0000000000..3d04d584f4 --- /dev/null +++ b/test/Transforms/InstSimplify/AndOrXor.ll @@ -0,0 +1,12 @@ +; RUN: opt < %s -instsimplify -S | FileCheck %s + +define i64 @pow2(i32 %x) { +; CHECK: @pow2 + %negx = sub i32 0, %x + %x2 = and i32 %x, %negx + %e = zext i32 %x2 to i64 + %nege = sub i64 0, %e + %e2 = and i64 %e, %nege + ret i64 %e2 +; CHECK: ret i64 %e +} |