summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/AArch64/GlobalISel/legalize-mul.mir20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-mul.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-mul.mir
index e56eef0bc4f..36726b7a30c 100644
--- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-mul.mir
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-mul.mir
@@ -7,6 +7,7 @@
entry:
ret void
}
+ define void @test_mul_overflow() { ret void }
...
---
@@ -35,3 +36,22 @@ body: |
%5(s64) = G_ANYEXT %2
%x0 = COPY %5
...
+
+
+---
+name: test_mul_overflow
+body: |
+ bb.0:
+ liveins: %x0, %x1, %w2, %w3
+
+ %0:_(s64) = COPY %x0
+ %1:_(s64) = COPY %x1
+
+ ; CHECK-LABEL: name: test_mul_overflow
+ ; CHECK: %2(s64) = G_MUL %0, %1
+ ; CHECK: [[HI:%[0-9]+]](s64) = G_SMULH %0, %1
+ ; CHECK: [[ZERO:%[0-9]+]](s64) = G_CONSTANT i64 0
+ ; CHECK: %3(s1) = G_ICMP intpred(ne), [[HI]](s64), [[ZERO]]
+ %2:_(s64), %3:_(s1) = G_SMULO %0, %1
+
+...
OpenPOWER on IntegriCloud