summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/CGP/arm-cgp-overflow.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/ARM/CGP/arm-cgp-overflow.ll')
-rw-r--r--llvm/test/CodeGen/ARM/CGP/arm-cgp-overflow.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/CGP/arm-cgp-overflow.ll b/llvm/test/CodeGen/ARM/CGP/arm-cgp-overflow.ll
index 8e10876c0b1..62242d60787 100644
--- a/llvm/test/CodeGen/ARM/CGP/arm-cgp-overflow.ll
+++ b/llvm/test/CodeGen/ARM/CGP/arm-cgp-overflow.ll
@@ -230,3 +230,20 @@ entry:
%conv4 = zext i1 %cmp to i32
ret i32 %conv4
}
+
+; CHECK-LABEL: convert_add_order
+; CHECK: orr{{.*}}, #1
+; CHECK: sub{{.*}}, #40
+; CHECK-NOT: uxt
+define i8 @convert_add_order(i8 zeroext %arg) {
+ %mask.0 = and i8 %arg, 1
+ %mask.1 = and i8 %arg, 2
+ %shl = or i8 %arg, 1
+ %add = add nuw i8 %shl, 10
+ %cmp.0 = icmp ult i8 %add, 60
+ %sub = add nsw i8 %shl, -40
+ %cmp.1 = icmp ult i8 %sub, 20
+ %mask.sel = select i1 %cmp.1, i8 %mask.0, i8 %mask.1
+ %res = select i1 %cmp.0, i8 %mask.sel, i8 %arg
+ ret i8 %res
+}
OpenPOWER on IntegriCloud