diff options
| author | Andrew Trick <atrick@apple.com> | 2011-04-29 14:18:15 +0000 |
|---|---|---|
| committer | Andrew Trick <atrick@apple.com> | 2011-04-29 14:18:15 +0000 |
| commit | d49ffe8284457953db68db063b527ee9c346b67a (patch) | |
| tree | 917702f45d3857a6665e9c282bf5ac8f06e3cb80 /test/CodeGen/Thumb2 | |
| parent | a432997745f668e85e45826106430f69238b1d1e (diff) | |
| download | external_llvm-d49ffe8284457953db68db063b527ee9c346b67a.zip external_llvm-d49ffe8284457953db68db063b527ee9c346b67a.tar.gz external_llvm-d49ffe8284457953db68db063b527ee9c346b67a.tar.bz2 | |
Teach Thumb2 isel to fold and->rotr ==> ROR.
Generalization of Nate Begeman's patch!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130502 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb2')
| -rw-r--r-- | test/CodeGen/Thumb2/thumb2-ror.ll | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-ror.ll b/test/CodeGen/Thumb2/thumb2-ror.ll index c44fdb3..590c333 100644 --- a/test/CodeGen/Thumb2/thumb2-ror.ll +++ b/test/CodeGen/Thumb2/thumb2-ror.ll @@ -11,11 +11,13 @@ define i32 @f1(i32 %a) { } ; CHECK: f2: +; CHECK-NOT: and ; CHECK: ror define i32 @f2(i32 %v, i32 %nbits) { entry: - %shr = lshr i32 %v, %nbits - %sub = sub i32 32, %nbits + %and = and i32 %nbits, 31 + %shr = lshr i32 %v, %and + %sub = sub i32 32, %and %shl = shl i32 %v, %sub %or = or i32 %shl, %shr ret i32 %or |
