summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/BPF/32-bit-subreg-peephole.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/BPF/32-bit-subreg-peephole.ll b/llvm/test/CodeGen/BPF/32-bit-subreg-peephole.ll
index 6b3edaf9cf9..78c344b1577 100644
--- a/llvm/test/CodeGen/BPF/32-bit-subreg-peephole.ll
+++ b/llvm/test/CodeGen/BPF/32-bit-subreg-peephole.ll
@@ -8,6 +8,14 @@
; return d;
; }
;
+; long long select_u_2(unsigned a, unsigned long long b, long long c, long long d)
+; {
+; if (a > b)
+; return c;
+; else
+; return d;
+; }
+;
; long long select_s(signed a, signed b, long long c, long long d)
; {
; if (a > b)
@@ -41,6 +49,18 @@ entry:
}
; Function Attrs: norecurse nounwind readnone
+define dso_local i64 @select_u_2(i32 %a, i64 %b, i64 %c, i64 %d) local_unnamed_addr #0 {
+; CHECK-LABEL: select_u_2:
+entry:
+ %conv = zext i32 %a to i64
+; CHECK-NOT: r{{[0-9]+}} <<= 32
+; CHECK-NOT: r{{[0-9]+}} >>= 32
+ %cmp = icmp ugt i64 %conv, %b
+ %c.d = select i1 %cmp, i64 %c, i64 %d
+ ret i64 %c.d
+}
+
+; Function Attrs: norecurse nounwind readnone
define dso_local i64 @select_s(i32 %a, i32 %b, i64 %c, i64 %d) local_unnamed_addr #0 {
; CHECK-LABEL: select_s:
entry:
OpenPOWER on IntegriCloud