[PATCH] D141256: [DAGCombine]Don't check for Undef/Poison if the node is deleted
Zhang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 9 06:09:45 PST 2023
Naville updated this revision to Diff 487403.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141256/new/
https://reviews.llvm.org/D141256
Files:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/dagcombine-deleted-freeze.ll
Index: llvm/test/CodeGen/AArch64/dagcombine-deleted-freeze.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/AArch64/dagcombine-deleted-freeze.ll
@@ -0,0 +1,18 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=aarch64 | FileCheck %s
+target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
+
+define i8 @f(i64 %0) {
+; CHECK-LABEL: f:
+; CHECK: // %bb.0:
+; CHECK-NEXT: eor w8, w0, w0
+; CHECK-NEXT: and w0, w8, #0x1
+; CHECK-NEXT: ret
+ %2 = freeze i64 %0
+ %3 = trunc i64 %2 to i1
+ %4 = trunc i64 %0 to i1
+ %5 = xor i1 %3, %4
+ %6 = freeze i1 %5
+ %7 = zext i1 %6 to i8
+ ret i8 %7
+}
Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -14341,6 +14341,9 @@
MaybePoisonOperand);
}
}
+ // Early-out if the node has already been updated in place.
+ if(N0.getOpcode() == ISD::DELETED_NODE)
+ return SDValue();
// Finally, recreate the node, it's operands were updated to use
// frozen operands, so we just need to use it's "original" operands.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141256.487403.patch
Type: text/x-patch
Size: 1323 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230109/3cca09af/attachment.bin>
More information about the llvm-commits
mailing list