[llvm] [X86] SimplifyDemandedBitsForTargetNode: add X86ISD::BZHI handling (PR #177881)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 26 09:54:40 PST 2026
================
@@ -45456,6 +45440,63 @@ bool X86TargetLowering::SimplifyDemandedBitsForTargetNode(
break;
}
+ case X86ISD::BZHI: {
+ SDValue Op0 = Op.getOperand(0); // src
+ SDValue Op1 = Op.getOperand(1); // mask
+
+ // Rule 1: Only the bottom 8 bits of the mask are required.
+ // Track an upper bound on mask[7:0] so we can apply Rule 2.
+ uint64_t MaxMask8 = 255;
+
+ if (auto *Cst1 = dyn_cast<ConstantSDNode>(Op1)) {
+ // NOTE: SimplifyDemandedBits won't do this for constants.
----------------
RKSimon wrote:
why does this matter?
https://github.com/llvm/llvm-project/pull/177881
More information about the llvm-commits
mailing list