[llvm] [DAG] SimplifyDemandedBits - fold FSHR(X, Y, Amt) -> SRL(Y, Amt) (PR #182294)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 19 08:06:51 PST 2026
================
@@ -2256,6 +2256,23 @@ bool TargetLowering::SimplifyDemandedBits(
}
}
+ // Fold FSHR(Op0,Op1,Op2) -> SRL(Op1,Op2)
+ // iff we're guaranteed not to use Op0.
+ // TODO: Add FSHL equivalent?
+ if (!IsFSHL && !DemandedBits.isAllOnes() &&
+ (!TLO.LegalOperations() || isOperationLegal(ISD::SRL, VT))) {
+ uint64_t MaxShiftAmt = BitWidth - 1; // urem(Op2, BitWidth)
----------------
topperc wrote:
uint64_t -> unsigned?
https://github.com/llvm/llvm-project/pull/182294
More information about the llvm-commits
mailing list