diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-08-25 16:58:05 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-08-25 16:58:05 +0000 |
commit | 3cc3283fcbb90924196cc38ee5977b35c4ee28b5 (patch) | |
tree | 724550bcbc6d879dd99793439f657154175cc4f5 /test | |
parent | 0a0073daab2c85b958566f0e84d59cb89585fc45 (diff) | |
download | external_llvm-3cc3283fcbb90924196cc38ee5977b35c4ee28b5.zip external_llvm-3cc3283fcbb90924196cc38ee5977b35c4ee28b5.tar.gz external_llvm-3cc3283fcbb90924196cc38ee5977b35c4ee28b5.tar.bz2 |
ARM/Thumb2: Fix a misselect in getARMCmp, when attempting to adjust a signed
comparison that would overflow.
- The other under/overflow cases can't actually happen because the immediates
which would trigger them are legal (so we don't enter this code), but
adjusted the style to make it clear the transform is always valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112053 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/Thumb2/thumb2-cmp.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-cmp.ll b/test/CodeGen/Thumb2/thumb2-cmp.ll index d4773bb..63249f4 100644 --- a/test/CodeGen/Thumb2/thumb2-cmp.ll +++ b/test/CodeGen/Thumb2/thumb2-cmp.ll @@ -39,3 +39,17 @@ define i1 @f5(i32 %a) { %tmp = icmp eq i32 %a, 1114112 ret i1 %tmp } + +; Check that we don't do an invalid (a > b) --> !(a < b + 1) transform. +; +; CHECK: f6: +; CHECK-NOT: cmp.w r0, #-2147483648 +; CHECK: bx lr +define i32 @f6(i32 %a) { + %tmp = icmp sgt i32 %a, 2147483647 + br i1 %tmp, label %true, label %false +true: + ret i32 2 +false: + ret i32 0 +} |