[llvm] 2ddd25f - [Test][AArch64] Test SADDO/SSUBO narrowing legalization
Cassie Jones via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 23 23:41:27 PST 2021
Author: Cassie Jones
Date: 2021-02-24T02:41:04-05:00
New Revision: 2ddd25fd0d6faf3d2faaab68bcd29d4f0ab36dfb
URL: https://github.com/llvm/llvm-project/commit/2ddd25fd0d6faf3d2faaab68bcd29d4f0ab36dfb
DIFF: https://github.com/llvm/llvm-project/commit/2ddd25fd0d6faf3d2faaab68bcd29d4f0ab36dfb.diff
LOG: [Test][AArch64] Test SADDO/SSUBO narrowing legalization
Reviewed By: aemerson
Differential Revision: https://reviews.llvm.org/D96675
Added:
Modified:
llvm/test/CodeGen/AArch64/GlobalISel/legalize-saddo.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-ssubo.mir
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-saddo.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-saddo.mir
index 0548db171779..7015a923d4b7 100644
--- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-saddo.mir
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-saddo.mir
@@ -1,6 +1,67 @@
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple aarch64 -verify-machineinstrs -run-pass=legalizer -debugify-and-strip-all-safe %s -o - | FileCheck %s
+---
+name: narrow_scalar_saddo_s128
+body: |
+ bb.0.entry:
+ ; CHECK-LABEL: name: narrow_scalar_saddo_s128
+ ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
+ ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
+ ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
+ ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
+ ; CHECK: [[UADDO:%[0-9]+]]:_(s64), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[COPY]], [[COPY2]]
+ ; CHECK: %17:_(s64), %carry_out:_(s1) = G_SADDE [[COPY1]], [[COPY3]], [[UADDO1]]
+ ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
+ ; CHECK: $x0 = COPY [[UADDO]](s64)
+ ; CHECK: $x1 = COPY %17(s64)
+ ; CHECK: $x2 = COPY %carry_out_ext(s64)
+ %0:_(s64) = COPY $x0
+ %1:_(s64) = COPY $x1
+ %2:_(s64) = COPY $x2
+ %3:_(s64) = COPY $x3
+ %lhs:_(s128) = G_MERGE_VALUES %0, %1
+ %rhs:_(s128) = G_MERGE_VALUES %2, %3
+ %add:_(s128), %carry_out:_(s1) = G_SADDO %lhs, %rhs
+ %add0:_(s64), %add1:_(s64) = G_UNMERGE_VALUES %add
+ %carry_out_ext:_(s64) = G_ANYEXT %carry_out
+ $x0 = COPY %add0
+ $x1 = COPY %add1
+ $x2 = COPY %carry_out_ext
+
+...
+---
+name: narrow_scalar_saddo_big_nonpow2
+body: |
+ bb.0.entry:
+ ; CHECK-LABEL: name: narrow_scalar_saddo_big_nonpow2
+ ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
+ ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
+ ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
+ ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
+ ; CHECK: [[UADDO:%[0-9]+]]:_(s64), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[COPY]], [[COPY1]]
+ ; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY1]], [[COPY2]], [[UADDO1]]
+ ; CHECK: %22:_(s64), %carry_out:_(s1) = G_SADDE [[COPY2]], [[COPY3]], [[UADDE1]]
+ ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
+ ; CHECK: $x0 = COPY [[UADDO]](s64)
+ ; CHECK: $x1 = COPY [[UADDE]](s64)
+ ; CHECK: $x2 = COPY %22(s64)
+ ; CHECK: $x3 = COPY %carry_out_ext(s64)
+ %0:_(s64) = COPY $x0
+ %1:_(s64) = COPY $x1
+ %2:_(s64) = COPY $x2
+ %3:_(s64) = COPY $x3
+ %lhs:_(s192) = G_MERGE_VALUES %0, %1, %2
+ %rhs:_(s192) = G_MERGE_VALUES %1, %2, %3
+ %add:_(s192), %carry_out:_(s1) = G_SADDO %lhs, %rhs
+ %add0:_(s64), %add1:_(s64), %add2:_(s64) = G_UNMERGE_VALUES %add
+ %carry_out_ext:_(s64) = G_ANYEXT %carry_out
+ $x0 = COPY %add0
+ $x1 = COPY %add1
+ $x2 = COPY %add2
+ $x3 = COPY %carry_out_ext
+
+...
---
name: test_scalar_saddo_small
body: |
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-ssubo.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-ssubo.mir
index e3a2dc7e9e2f..7686d66acf8f 100644
--- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-ssubo.mir
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-ssubo.mir
@@ -1,6 +1,67 @@
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple aarch64 -verify-machineinstrs -run-pass=legalizer -debugify-and-strip-all-safe %s -o - | FileCheck %s
+---
+name: narrow_scalar_ssubo_s128
+body: |
+ bb.0.entry:
+ ; CHECK-LABEL: name: narrow_scalar_ssubo_s128
+ ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
+ ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
+ ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
+ ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
+ ; CHECK: [[USUBO:%[0-9]+]]:_(s64), [[USUBO1:%[0-9]+]]:_(s1) = G_USUBO [[COPY]], [[COPY2]]
+ ; CHECK: %17:_(s64), %carry_out:_(s1) = G_SSUBE [[COPY1]], [[COPY3]], [[USUBO1]]
+ ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
+ ; CHECK: $x0 = COPY [[USUBO]](s64)
+ ; CHECK: $x1 = COPY %17(s64)
+ ; CHECK: $x2 = COPY %carry_out_ext(s64)
+ %0:_(s64) = COPY $x0
+ %1:_(s64) = COPY $x1
+ %2:_(s64) = COPY $x2
+ %3:_(s64) = COPY $x3
+ %lhs:_(s128) = G_MERGE_VALUES %0, %1
+ %rhs:_(s128) = G_MERGE_VALUES %2, %3
+ %sub:_(s128), %carry_out:_(s1) = G_SSUBO %lhs, %rhs
+ %sub0:_(s64), %sub1:_(s64) = G_UNMERGE_VALUES %sub
+ %carry_out_ext:_(s64) = G_ANYEXT %carry_out
+ $x0 = COPY %sub0
+ $x1 = COPY %sub1
+ $x2 = COPY %carry_out_ext
+
+...
+---
+name: narrow_scalar_ssubo_big_nonpow2
+body: |
+ bb.0.entry:
+ ; CHECK-LABEL: name: narrow_scalar_ssubo_big_nonpow2
+ ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
+ ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
+ ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
+ ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
+ ; CHECK: [[USUBO:%[0-9]+]]:_(s64), [[USUBO1:%[0-9]+]]:_(s1) = G_USUBO [[COPY]], [[COPY1]]
+ ; CHECK: [[USUBE:%[0-9]+]]:_(s64), [[USUBE1:%[0-9]+]]:_(s1) = G_USUBE [[COPY1]], [[COPY2]], [[USUBO1]]
+ ; CHECK: %22:_(s64), %carry_out:_(s1) = G_SSUBE [[COPY2]], [[COPY3]], [[USUBE1]]
+ ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
+ ; CHECK: $x0 = COPY [[USUBO]](s64)
+ ; CHECK: $x1 = COPY [[USUBE]](s64)
+ ; CHECK: $x2 = COPY %22(s64)
+ ; CHECK: $x3 = COPY %carry_out_ext(s64)
+ %0:_(s64) = COPY $x0
+ %1:_(s64) = COPY $x1
+ %2:_(s64) = COPY $x2
+ %3:_(s64) = COPY $x3
+ %lhs:_(s192) = G_MERGE_VALUES %0, %1, %2
+ %rhs:_(s192) = G_MERGE_VALUES %1, %2, %3
+ %sub:_(s192), %carry_out:_(s1) = G_SSUBO %lhs, %rhs
+ %sub0:_(s64), %sub1:_(s64), %sub2:_(s64) = G_UNMERGE_VALUES %sub
+ %carry_out_ext:_(s64) = G_ANYEXT %carry_out
+ $x0 = COPY %sub0
+ $x1 = COPY %sub1
+ $x2 = COPY %sub2
+ $x3 = COPY %carry_out_ext
+
+...
---
name: test_scalar_ssubo_small
body: |
More information about the llvm-commits
mailing list