[llvm] [LLVM][AArch64] Correctly lower funnel shifts by zero. (PR #140058)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Thu May 15 07:27:35 PDT 2025
================
@@ -7266,12 +7266,18 @@ static SDValue LowerFunnelShift(SDValue Op, SelectionDAG &DAG) {
MVT VT = Op.getSimpleValueType();
if (Op.getOpcode() == ISD::FSHL) {
+ if (ShiftNo->isZero())
+ return Op.getOperand(0);
+
unsigned int NewShiftNo =
VT.getFixedSizeInBits() - ShiftNo->getZExtValue();
----------------
jayfoad wrote:
> Or to ask another, there is no way to represent `fshl(a,b,multiple_of_src_bit_length)` using `fshr`?
Correct. TargetLowering already copes with this, see: https://github.com/llvm/llvm-project/blob/3667f29dfd1100a0eda7bfc4584ba2cfb6880b94/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp#L8074
https://github.com/llvm/llvm-project/pull/140058
More information about the llvm-commits
mailing list