[llvm] 0596086 - [Test][AArch64] Test SADDE/SSUBE/UADDE/USUBE narrowing legalization

Cassie Jones via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 16:59:53 PST 2021


Author: Cassie Jones
Date: 2021-02-22T19:59:36-05:00
New Revision: 0596086242b2b80c084d3e0e8d755fb4a6c75ef3

URL: https://github.com/llvm/llvm-project/commit/0596086242b2b80c084d3e0e8d755fb4a6c75ef3
DIFF: https://github.com/llvm/llvm-project/commit/0596086242b2b80c084d3e0e8d755fb4a6c75ef3.diff

LOG: [Test][AArch64] Test SADDE/SSUBE/UADDE/USUBE narrowing legalization

Reviewed By: paquette

Differential Revision: https://reviews.llvm.org/D96676

Added: 
    

Modified: 
    llvm/test/CodeGen/AArch64/GlobalISel/legalize-sadde.mir
    llvm/test/CodeGen/AArch64/GlobalISel/legalize-ssube.mir
    llvm/test/CodeGen/AArch64/GlobalISel/legalize-uadde.mir
    llvm/test/CodeGen/AArch64/GlobalISel/legalize-usube.mir

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-sadde.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-sadde.mir
index 367f0ee59887..1a1ece350754 100644
--- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-sadde.mir
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-sadde.mir
@@ -1,6 +1,75 @@
 # 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_sadde_s128
+body:             |
+  bb.0.entry:
+    ; CHECK-LABEL: name: narrow_scalar_sadde_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: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
+    ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
+    ; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY]], [[COPY2]], %carry_in
+    ; CHECK: %19:_(s64), %carry_out:_(s1) = G_SADDE [[COPY1]], [[COPY3]], [[UADDE1]]
+    ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
+    ; CHECK: $x0 = COPY [[UADDE]](s64)
+    ; CHECK: $x1 = COPY %19(s64)
+    ; CHECK: $x2 = COPY %carry_out_ext(s64)
+    %0:_(s64) = COPY $x0
+    %1:_(s64) = COPY $x1
+    %2:_(s64) = COPY $x2
+    %3:_(s64) = COPY $x3
+    %4:_(s64) = COPY $x4
+    %lhs:_(s128) = G_MERGE_VALUES %0, %1
+    %rhs:_(s128) = G_MERGE_VALUES %2, %3
+    %carry_in:_(s1) = G_TRUNC %4
+    %add:_(s128), %carry_out:_(s1) = G_SADDE %lhs, %rhs, %carry_in
+    %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_sadde_big_nonpow2
+body:             |
+  bb.0.entry:
+    ; CHECK-LABEL: name: narrow_scalar_sadde_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: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
+    ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
+    ; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY]], [[COPY1]], %carry_in
+    ; CHECK: [[UADDE2:%[0-9]+]]:_(s64), [[UADDE3:%[0-9]+]]:_(s1) = G_UADDE [[COPY1]], [[COPY2]], [[UADDE1]]
+    ; CHECK: %24:_(s64), %carry_out:_(s1) = G_SADDE [[COPY2]], [[COPY3]], [[UADDE3]]
+    ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
+    ; CHECK: $x0 = COPY [[UADDE]](s64)
+    ; CHECK: $x1 = COPY [[UADDE2]](s64)
+    ; CHECK: $x2 = COPY %24(s64)
+    ; CHECK: $x3 = COPY %carry_out_ext(s64)
+    %0:_(s64) = COPY $x0
+    %1:_(s64) = COPY $x1
+    %2:_(s64) = COPY $x2
+    %3:_(s64) = COPY $x3
+    %4:_(s64) = COPY $x4
+    %lhs:_(s192) = G_MERGE_VALUES %0, %1, %2
+    %rhs:_(s192) = G_MERGE_VALUES %1, %2, %3
+    %carry_in:_(s1) = G_TRUNC %4
+    %add:_(s192), %carry_out:_(s1) = G_SADDE %lhs, %rhs, %carry_in
+    %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:            widen_scalar_sadde_s8
 body:             |

diff  --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-ssube.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-ssube.mir
index 7e23740e3a4c..2acf88b64b82 100644
--- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-ssube.mir
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-ssube.mir
@@ -1,6 +1,75 @@
 # 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_ssube_s128
+body:             |
+  bb.0.entry:
+    ; CHECK-LABEL: name: narrow_scalar_ssube_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: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
+    ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
+    ; CHECK: [[USUBE:%[0-9]+]]:_(s64), [[USUBE1:%[0-9]+]]:_(s1) = G_USUBE [[COPY]], [[COPY2]], %carry_in
+    ; CHECK: %19:_(s64), %carry_out:_(s1) = G_SSUBE [[COPY1]], [[COPY3]], [[USUBE1]]
+    ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
+    ; CHECK: $x0 = COPY [[USUBE]](s64)
+    ; CHECK: $x1 = COPY %19(s64)
+    ; CHECK: $x2 = COPY %carry_out_ext(s64)
+    %0:_(s64) = COPY $x0
+    %1:_(s64) = COPY $x1
+    %2:_(s64) = COPY $x2
+    %3:_(s64) = COPY $x3
+    %4:_(s64) = COPY $x4
+    %lhs:_(s128) = G_MERGE_VALUES %0, %1
+    %rhs:_(s128) = G_MERGE_VALUES %2, %3
+    %carry_in:_(s1) = G_TRUNC %4
+    %sub:_(s128), %carry_out:_(s1) = G_SSUBE %lhs, %rhs, %carry_in
+    %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_ssube_big_nonpow2
+body:             |
+  bb.0.entry:
+    ; CHECK-LABEL: name: narrow_scalar_ssube_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: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
+    ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
+    ; CHECK: [[USUBE:%[0-9]+]]:_(s64), [[USUBE1:%[0-9]+]]:_(s1) = G_USUBE [[COPY]], [[COPY1]], %carry_in
+    ; CHECK: [[USUBE2:%[0-9]+]]:_(s64), [[USUBE3:%[0-9]+]]:_(s1) = G_USUBE [[COPY1]], [[COPY2]], [[USUBE1]]
+    ; CHECK: %24:_(s64), %carry_out:_(s1) = G_SSUBE [[COPY2]], [[COPY3]], [[USUBE3]]
+    ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
+    ; CHECK: $x0 = COPY [[USUBE]](s64)
+    ; CHECK: $x1 = COPY [[USUBE2]](s64)
+    ; CHECK: $x2 = COPY %24(s64)
+    ; CHECK: $x3 = COPY %carry_out_ext(s64)
+    %0:_(s64) = COPY $x0
+    %1:_(s64) = COPY $x1
+    %2:_(s64) = COPY $x2
+    %3:_(s64) = COPY $x3
+    %4:_(s64) = COPY $x4
+    %lhs:_(s192) = G_MERGE_VALUES %0, %1, %2
+    %rhs:_(s192) = G_MERGE_VALUES %1, %2, %3
+    %carry_in:_(s1) = G_TRUNC %4
+    %sub:_(s192), %carry_out:_(s1) = G_SSUBE %lhs, %rhs, %carry_in
+    %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:            widen_scalar_ssube_s8
 body:             |

diff  --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-uadde.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-uadde.mir
index 236f42a2269d..68c645a721c8 100644
--- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-uadde.mir
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-uadde.mir
@@ -1,6 +1,75 @@
 # 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_uadde_s128
+body:             |
+  bb.0.entry:
+    ; CHECK-LABEL: name: narrow_scalar_uadde_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: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
+    ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
+    ; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY]], [[COPY2]], %carry_in
+    ; CHECK: %19:_(s64), %carry_out:_(s1) = G_UADDE [[COPY1]], [[COPY3]], [[UADDE1]]
+    ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
+    ; CHECK: $x0 = COPY [[UADDE]](s64)
+    ; CHECK: $x1 = COPY %19(s64)
+    ; CHECK: $x2 = COPY %carry_out_ext(s64)
+    %0:_(s64) = COPY $x0
+    %1:_(s64) = COPY $x1
+    %2:_(s64) = COPY $x2
+    %3:_(s64) = COPY $x3
+    %4:_(s64) = COPY $x4
+    %lhs:_(s128) = G_MERGE_VALUES %0, %1
+    %rhs:_(s128) = G_MERGE_VALUES %2, %3
+    %carry_in:_(s1) = G_TRUNC %4
+    %add:_(s128), %carry_out:_(s1) = G_UADDE %lhs, %rhs, %carry_in
+    %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_uadde_big_nonpow2
+body:             |
+  bb.0.entry:
+    ; CHECK-LABEL: name: narrow_scalar_uadde_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: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
+    ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
+    ; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY]], [[COPY1]], %carry_in
+    ; CHECK: [[UADDE2:%[0-9]+]]:_(s64), [[UADDE3:%[0-9]+]]:_(s1) = G_UADDE [[COPY1]], [[COPY2]], [[UADDE1]]
+    ; CHECK: %24:_(s64), %carry_out:_(s1) = G_UADDE [[COPY2]], [[COPY3]], [[UADDE3]]
+    ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
+    ; CHECK: $x0 = COPY [[UADDE]](s64)
+    ; CHECK: $x1 = COPY [[UADDE2]](s64)
+    ; CHECK: $x2 = COPY %24(s64)
+    ; CHECK: $x3 = COPY %carry_out_ext(s64)
+    %0:_(s64) = COPY $x0
+    %1:_(s64) = COPY $x1
+    %2:_(s64) = COPY $x2
+    %3:_(s64) = COPY $x3
+    %4:_(s64) = COPY $x4
+    %lhs:_(s192) = G_MERGE_VALUES %0, %1, %2
+    %rhs:_(s192) = G_MERGE_VALUES %1, %2, %3
+    %carry_in:_(s1) = G_TRUNC %4
+    %add:_(s192), %carry_out:_(s1) = G_UADDE %lhs, %rhs, %carry_in
+    %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:            widen_scalar_uadde_s8
 body:             |

diff  --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-usube.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-usube.mir
index f72a6885652f..7741ec1e8a15 100644
--- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-usube.mir
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-usube.mir
@@ -1,6 +1,75 @@
 # 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_usube_s128
+body:             |
+  bb.0.entry:
+    ; CHECK-LABEL: name: narrow_scalar_usube_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: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
+    ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
+    ; CHECK: [[USUBE:%[0-9]+]]:_(s64), [[USUBE1:%[0-9]+]]:_(s1) = G_USUBE [[COPY]], [[COPY2]], %carry_in
+    ; CHECK: %19:_(s64), %carry_out:_(s1) = G_USUBE [[COPY1]], [[COPY3]], [[USUBE1]]
+    ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
+    ; CHECK: $x0 = COPY [[USUBE]](s64)
+    ; CHECK: $x1 = COPY %19(s64)
+    ; CHECK: $x2 = COPY %carry_out_ext(s64)
+    %0:_(s64) = COPY $x0
+    %1:_(s64) = COPY $x1
+    %2:_(s64) = COPY $x2
+    %3:_(s64) = COPY $x3
+    %4:_(s64) = COPY $x4
+    %lhs:_(s128) = G_MERGE_VALUES %0, %1
+    %rhs:_(s128) = G_MERGE_VALUES %2, %3
+    %carry_in:_(s1) = G_TRUNC %4
+    %sub:_(s128), %carry_out:_(s1) = G_USUBE %lhs, %rhs, %carry_in
+    %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_usube_big_nonpow2
+body:             |
+  bb.0.entry:
+    ; CHECK-LABEL: name: narrow_scalar_usube_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: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
+    ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
+    ; CHECK: [[USUBE:%[0-9]+]]:_(s64), [[USUBE1:%[0-9]+]]:_(s1) = G_USUBE [[COPY]], [[COPY1]], %carry_in
+    ; CHECK: [[USUBE2:%[0-9]+]]:_(s64), [[USUBE3:%[0-9]+]]:_(s1) = G_USUBE [[COPY1]], [[COPY2]], [[USUBE1]]
+    ; CHECK: %24:_(s64), %carry_out:_(s1) = G_USUBE [[COPY2]], [[COPY3]], [[USUBE3]]
+    ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
+    ; CHECK: $x0 = COPY [[USUBE]](s64)
+    ; CHECK: $x1 = COPY [[USUBE2]](s64)
+    ; CHECK: $x2 = COPY %24(s64)
+    ; CHECK: $x3 = COPY %carry_out_ext(s64)
+    %0:_(s64) = COPY $x0
+    %1:_(s64) = COPY $x1
+    %2:_(s64) = COPY $x2
+    %3:_(s64) = COPY $x3
+    %4:_(s64) = COPY $x4
+    %lhs:_(s192) = G_MERGE_VALUES %0, %1, %2
+    %rhs:_(s192) = G_MERGE_VALUES %1, %2, %3
+    %carry_in:_(s1) = G_TRUNC %4
+    %sub:_(s192), %carry_out:_(s1) = G_USUBE %lhs, %rhs, %carry_in
+    %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:            widen_scalar_usube_s8
 body:             |


        


More information about the llvm-commits mailing list