diff options
| author | Eli Friedman <efriedma@codeaurora.org> | 2018-06-19 00:07:30 +0000 |
|---|---|---|
| committer | Eli Friedman <efriedma@codeaurora.org> | 2018-06-19 00:07:30 +0000 |
| commit | 801c2f4c3ada19bccf6f5c6a1434ea3876626e64 (patch) | |
| tree | e4eccdc838e3e24adc4ba18900427eba37ba1956 /llvm/test | |
| parent | cf3a986087d0bb7fbd88556a66e59df6fe30fea3 (diff) | |
| download | bcm5719-llvm-801c2f4c3ada19bccf6f5c6a1434ea3876626e64.tar.gz bcm5719-llvm-801c2f4c3ada19bccf6f5c6a1434ea3876626e64.zip | |
[ARM] Testcase for missed optimization with i16 compare.
The result looks weird because the DAG actually has an explicit
shift; I haven't figured out why, exactly.
llvm-svn: 335000
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/ARM/and-cmpz.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/and-cmpz.ll b/llvm/test/CodeGen/ARM/and-cmpz.ll index 6cc3d39b58c..fb5f8fe280f 100644 --- a/llvm/test/CodeGen/ARM/and-cmpz.ll +++ b/llvm/test/CodeGen/ARM/and-cmpz.ll @@ -87,3 +87,24 @@ true: false: ret i32 2 } + +; CHECK-LABEL: i16_cmpz: +; T1: movs r2, #127 +; T1-NEXT: lsls r2, r2, #9 +; T1-NEXT: ands r2, r0 +; T1-NEXT: lsrs r0, r2, #9 +; T2: and r0, r0, #65024 +; T2-NEXT: movs r2, #0 +; T2-NEXT: cmp.w r2, r0, lsr #9 +define void @i16_cmpz(i16 %x, void (i32)* %foo) { +entry: + %cmp = icmp ult i16 %x, 512 + br i1 %cmp, label %if.then, label %if.end + +if.then: ; preds = %entry + tail call void %foo(i32 0) #1 + br label %if.end + +if.end: ; preds = %if.then, %entry + ret void +} |

