[llvm] [AArch64] All bits of an exact right shift are demanded (PR #97448)
Shu-Chun Weng via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 8 09:29:18 PDT 2024
================
@@ -22142,6 +22142,10 @@ static SDValue performVectorShiftCombine(SDNode *N,
if (DCI.DAG.ComputeNumSignBits(Op.getOperand(0)) > ShiftImm)
return Op.getOperand(0);
+ // If the right shift is exact, the shifted out bits matter.
----------------
scweng wrote:
nit: perhaps elaborate a bit on why the shifted out bits matter. E.g. "because we may fold the right shift with other instructions and thus require the lower bits to be set."
Now that gets me thinking. Wouldn't this condition than make code that does not fold the right shift with other instructions less efficient? Shouldn't the onus be on wherever folds right shift with sitofp (scvtf) to make sure to clear the lower bits?
https://github.com/llvm/llvm-project/pull/97448
More information about the llvm-commits
mailing list