[llvm] [ValueTracking][X86] Compute KnownBits for phadd/phsub (PR #92429)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu May 16 10:11:52 PDT 2024
================
@@ -37262,6 +37262,27 @@ void X86TargetLowering::computeKnownBitsForTargetNode(const SDValue Op,
}
break;
}
+ case X86ISD::HADD: {
+ Known = DAG.computeKnownBits(Op.getOperand(0), DemandedElts, Depth + 1);
+ KnownBits Known2 =
+ DAG.computeKnownBits(Op.getOperand(1), DemandedElts, Depth + 1);
+
+ Known = KnownBits::computeForAddSub(true, false, false, Known, Known)
+ .intersectWith(KnownBits::computeForAddSub(true, false, false,
+ Known2, Known2));
+ break;
+ }
+ case X86ISD::HSUB: {
----------------
RKSimon wrote:
You can merge HADD/HSUB cases and call `computeForAddSub(Opc == X86ISD::HADD, ...)`
https://github.com/llvm/llvm-project/pull/92429
More information about the llvm-commits
mailing list