[llvm] [AArch64] canCreateUndefOrPoisonForTargetNode - AArch64ISD::MOVI opcodes can't create undef/poison (PR #149323)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 18 02:33:24 PDT 2025


================
@@ -30398,6 +30398,23 @@ bool AArch64TargetLowering::SimplifyDemandedBitsForTargetNode(
       Op, OriginalDemandedBits, OriginalDemandedElts, Known, TLO, Depth);
 }
 
+bool AArch64TargetLowering::canCreateUndefOrPoisonForTargetNode(
+    SDValue Op, const APInt &DemandedElts, const SelectionDAG &DAG,
+    bool PoisonOnly, bool ConsiderFlags, unsigned Depth) const {
+
+  // TODO: Add more target nodes.
+  switch (Op.getOpcode()) {
+  case AArch64ISD::MOVI:
+  case AArch64ISD::MOVIedit:
+  case AArch64ISD::MOVImsl:
+  case AArch64ISD::MOVIshift:
+  case AArch64ISD::MVNIshift:
----------------
RKSimon wrote:

It might be that #148191 is the first case where we manage to show the problem (we need a case where the freeze needs removing quite late into lowering) - I haven't had time to investigate though.

https://github.com/llvm/llvm-project/pull/149323


More information about the llvm-commits mailing list