diff options
author | Duncan Sands <baldrick@free.fr> | 2011-10-28 18:30:05 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2011-10-28 18:30:05 +0000 |
commit | 4604fc7791314af7ba7b66999e4c7fb75a4d9f6e (patch) | |
tree | 3e33c7f131400070536fc37376e488bdb946ee02 /test/Transforms | |
parent | c65c747bc4ee7d3ca8463d33708bbb2aed38a809 (diff) | |
download | llvm-4604fc7791314af7ba7b66999e4c7fb75a4d9f6e.tar.gz llvm-4604fc7791314af7ba7b66999e4c7fb75a4d9f6e.tar.bz2 llvm-4604fc7791314af7ba7b66999e4c7fb75a4d9f6e.tar.xz |
A shift of a power of two is a power of two or zero.
For completeness - not spotted in the wild.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143211 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstSimplify/AndOrXor.ll | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/AndOrXor.ll b/test/Transforms/InstSimplify/AndOrXor.ll index 3d04d584f4..33a4d6b02d 100644 --- a/test/Transforms/InstSimplify/AndOrXor.ll +++ b/test/Transforms/InstSimplify/AndOrXor.ll @@ -10,3 +10,13 @@ define i64 @pow2(i32 %x) { ret i64 %e2 ; CHECK: ret i64 %e } + +define i64 @pow2b(i32 %x) { +; CHECK: @pow2b + %sh = shl i32 2, %x + %e = zext i32 %sh to i64 + %nege = sub i64 0, %e + %e2 = and i64 %e, %nege + ret i64 %e2 +; CHECK: ret i64 %e +} |