[llvm] [AArch64] All bits of an exact right shift are demanded (PR #97448)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 2 13:38:52 PDT 2024
https://github.com/davemgreen commented:
I see.. because we need the bits to be 0's. This sounds good, but should we also apply this to VLSHR too? The code for SRA looks like this (but we are not using the input DemandBits here), and SRL has the hasExact part.
```
// If the shift is exact, then it does demand the low bits (and knows that
// they are zero).
if (Op->getFlags().hasExact())
InDemandedMask.setLowBits(ShAmt);
// If any of the demanded bits are produced by the sign extension, we also
// demand the input sign bit.
if (DemandedBits.countl_zero() < ShAmt)
InDemandedMask.setSignBit();
```
https://github.com/llvm/llvm-project/pull/97448
More information about the llvm-commits
mailing list