[llvm] [ISel] Propagate disjoint flag in ShrinkDemandedOp (PR #114560)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 1 09:21:38 PDT 2024
================
@@ -609,6 +609,11 @@ bool TargetLowering::ShrinkDemandedOp(SDValue Op, unsigned BitWidth,
Op.getOpcode(), dl, SmallVT,
DAG.getNode(ISD::TRUNCATE, dl, SmallVT, Op.getOperand(0)),
DAG.getNode(ISD::TRUNCATE, dl, SmallVT, Op.getOperand(1)));
+ // If the operation has the 'disjoint' flag, then the operands on
+ // the new node are also disjoint.
+ SDNodeFlags Flags = Op->getFlags();
+ X->setFlags(Flags.hasDisjoint() ? SDNodeFlags::Disjoint
----------------
dtcxzyw wrote:
You can pass flags into `DAG.getNode`.
https://github.com/llvm/llvm-project/pull/114560
More information about the llvm-commits
mailing list