[PATCH] D109311: [AArch64][SVE] Implement all-inactive predicate with PFALSE.
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 7 06:29:41 PDT 2021
This revision was automatically updated to reflect the committed changes.
sdesmalen marked an inline comment as done.
Closed by commit rG448d47f7438e: [AArch64][SVE] Implement all-inactive predicate with PFALSE. (authored by sdesmalen).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109311/new/
https://reviews.llvm.org/D109311
Files:
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/sve-intrinsics-int-compares-with-imm.ll
llvm/test/CodeGen/AArch64/sve-zeroinit.ll
Index: llvm/test/CodeGen/AArch64/sve-zeroinit.ll
===================================================================
--- llvm/test/CodeGen/AArch64/sve-zeroinit.ll
+++ llvm/test/CodeGen/AArch64/sve-zeroinit.ll
@@ -54,28 +54,28 @@
define <vscale x 2 x i1> @test_zeroinit_2xi1() {
; CHECK-LABEL: test_zeroinit_2xi1
-; CHECK: whilelo p0.d, xzr, xzr
+; CHECK: pfalse p0.b
; CHECK-NEXT: ret
ret <vscale x 2 x i1> zeroinitializer
}
define <vscale x 4 x i1> @test_zeroinit_4xi1() {
; CHECK-LABEL: test_zeroinit_4xi1
-; CHECK: whilelo p0.s, xzr, xzr
+; CHECK: pfalse p0.b
; CHECK-NEXT: ret
ret <vscale x 4 x i1> zeroinitializer
}
define <vscale x 8 x i1> @test_zeroinit_8xi1() {
; CHECK-LABEL: test_zeroinit_8xi1
-; CHECK: whilelo p0.h, xzr, xzr
+; CHECK: pfalse p0.b
; CHECK-NEXT: ret
ret <vscale x 8 x i1> zeroinitializer
}
define <vscale x 16 x i1> @test_zeroinit_16xi1() {
; CHECK-LABEL: test_zeroinit_16xi1
-; CHECK: whilelo p0.b, xzr, xzr
+; CHECK: pfalse p0.b
; CHECK-NEXT: ret
ret <vscale x 16 x i1> zeroinitializer
}
Index: llvm/test/CodeGen/AArch64/sve-intrinsics-int-compares-with-imm.ll
===================================================================
--- llvm/test/CodeGen/AArch64/sve-intrinsics-int-compares-with-imm.ll
+++ llvm/test/CodeGen/AArch64/sve-intrinsics-int-compares-with-imm.ll
@@ -1072,7 +1072,7 @@
define <vscale x 8 x i1> @ir_cmplo_h(<vscale x 8 x i16> %a) {
; CHECK-LABEL: ir_cmplo_h
-; CHECK: whilelo p0.h, xzr, xzr
+; CHECK: pfalse p0.b
; CHECK-NEXT: ret
%elt = insertelement <vscale x 8 x i16> undef, i16 0, i32 0
%splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
Index: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -9643,9 +9643,10 @@
// The only legal i1 vectors are SVE vectors, so we can use SVE-specific
// lowering code.
if (auto *ConstVal = dyn_cast<ConstantSDNode>(SplatVal)) {
+ if (ConstVal->isNullValue())
+ return SDValue(DAG.getMachineNode(AArch64::PFALSE, dl, VT), 0);
if (ConstVal->isOne())
return getPTrue(DAG, dl, VT, AArch64SVEPredPattern::all);
- // TODO: Add special case for constant false
}
// The general case of i1. There isn't any natural way to do this,
// so we use some trickery with whilelo.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109311.371060.patch
Type: text/x-patch
Size: 2550 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210907/3b9769ed/attachment.bin>
More information about the llvm-commits
mailing list