diff options
| author | James Molloy <james.molloy@arm.com> | 2016-09-09 13:35:28 +0000 |
|---|---|---|
| committer | James Molloy <james.molloy@arm.com> | 2016-09-09 13:35:28 +0000 |
| commit | 1454e90f86101a08445287635bf5c9b74497e1f7 (patch) | |
| tree | a2f9d99cbf8c0e09c060192b62b007e64150e16d /llvm/test/CodeGen | |
| parent | 153b40843310a00175105908005e3197b837fbc2 (diff) | |
| download | bcm5719-llvm-1454e90f86101a08445287635bf5c9b74497e1f7.tar.gz bcm5719-llvm-1454e90f86101a08445287635bf5c9b74497e1f7.zip | |
[ARM] icmp %x, -C can be lowered to a simple ADDS or CMN
Tell TargetTransformInfo about this so ConstantHoisting is informed.
llvm-svn: 281043
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/ARM/immcost.ll | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/immcost.ll b/llvm/test/CodeGen/ARM/immcost.ll index bfc1fddd3c1..43a4989e6bd 100644 --- a/llvm/test/CodeGen/ARM/immcost.ll +++ b/llvm/test/CodeGen/ARM/immcost.ll @@ -37,3 +37,37 @@ ret: ret void } +; CHECK: Function: test_icmp_neg +; CHECK-NOT: Collect constant +define void @test_icmp_neg(i1 %cond, i32 %arg, i32 %arg2) { +entry: + %a = icmp ne i32 %arg, -5 + call void @g2(i1 %a) + br i1 %cond, label %true, label %ret + +true: + %b = icmp ne i32 %arg2, -5 + call void @g2(i1 %b) + br label %ret + +ret: + ret void +} +declare void @g2(i1) + +; CHECK: Function: test_icmp_neg2 +; CHECK: Hoist constant (i32 -500) to BB entry +define void @test_icmp_neg2(i1 %cond, i32 %arg, i32 %arg2) { +entry: + %a = icmp ne i32 %arg, -500 + call void @g2(i1 %a) + br i1 %cond, label %true, label %ret + +true: + %b = icmp ne i32 %arg2, -500 + call void @g2(i1 %b) + br label %ret + +ret: + ret void +} |

