[PATCH] D107415: [AArch64][GlobalISel] Widen G_SELECT before clamping it
Jessica Paquette via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 3 18:32:08 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG564373637832: [AArch64][GlobalISel] Widen G_SELECT before clamping it (authored by paquette).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107415/new/
https://reviews.llvm.org/D107415
Files:
llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
llvm/test/CodeGen/AArch64/GlobalISel/legalize-select.mir
Index: llvm/test/CodeGen/AArch64/GlobalISel/legalize-select.mir
===================================================================
--- llvm/test/CodeGen/AArch64/GlobalISel/legalize-select.mir
+++ llvm/test/CodeGen/AArch64/GlobalISel/legalize-select.mir
@@ -158,3 +158,29 @@
RET_ReallyLR implicit $q0
...
+---
+name: s88
+tracksRegLiveness: true
+body: |
+ bb.0:
+ liveins: $w0, $w1, $x0
+
+ ; CHECK-LABEL: name: s88
+ ; CHECK: liveins: $w0, $w1, $x0
+ ; CHECK: %a:_(s32) = COPY $w0
+ ; CHECK: %b:_(s32) = COPY $w1
+ ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), %a(s32), %b
+ ; CHECK: %cmp:_(s1) = G_TRUNC [[ICMP]](s32)
+ ; CHECK: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
+ ; CHECK: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT %cmp(s1), [[DEF]], [[DEF]]
+ ; CHECK: $x0 = COPY [[SELECT]](s64)
+ ; CHECK: RET_ReallyLR implicit $x0
+ %a:_(s32) = COPY $w0
+ %b:_(s32) = COPY $w1
+ %cmp:_(s1) = G_ICMP intpred(sgt), %a(s32), %b
+ %sel_a:_(s88) = G_IMPLICIT_DEF
+ %sel_b:_(s88) = G_IMPLICIT_DEF
+ %select:_(s88) = G_SELECT %cmp(s1), %sel_a, %sel_b
+ %trunc:_(s64) = G_TRUNC %select
+ $x0 = COPY %trunc
+ RET_ReallyLR implicit $x0
Index: llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
===================================================================
--- llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
+++ llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
@@ -477,8 +477,8 @@
getActionDefinitionsBuilder(G_SELECT)
.legalFor({{s32, s1}, {s64, s1}, {p0, s1}})
- .clampScalar(0, s32, s64)
.widenScalarToNextPow2(0)
+ .clampScalar(0, s32, s64)
.minScalarEltSameAsIf(all(isVector(0), isVector(1)), 1, 0)
.lowerIf(isVector(0));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107415.363930.patch
Type: text/x-patch
Size: 1778 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210804/233b2cd8/attachment.bin>
More information about the llvm-commits
mailing list