[llvm] [RISCV] Split f64 loads/stores for RV32+Zdinx during isel instead of post-RA. (PR #139840)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed May 14 08:21:36 PDT 2025
================
@@ -7705,19 +7710,42 @@ SDValue RISCVTargetLowering::LowerOperation(SDValue Op,
}
case ISD::LOAD: {
auto *Load = cast<LoadSDNode>(Op);
- EVT VecTy = Load->getMemoryVT();
+ EVT VT = Load->getValueType(0);
+ if (VT == MVT::f64) {
+ assert(Subtarget.hasStdExtZdinx() && !Subtarget.is64Bit() &&
+ "Unexpected custom legalisation");
+
+ // Replace a double precision load with two i32 loads and a BuildPairF64.
+ SDLoc DL(Op);
+ SDValue BasePtr = Load->getBasePtr();
+ SDValue Chain = Load->getChain();
+
+ SDValue Lo = DAG.getLoad(MVT::i32, DL, Chain, BasePtr,
+ Load->getPointerInfo(), Load->getOriginalAlign(),
----------------
topperc wrote:
The size is not stored in PointerInfo. It is stored in `MachineMemOperand` which also contains a PointerInfo. `getLoad` will create a new `MachineMemOperand` from the `PointerInfo`, `MemVT`, `Align`, etc.
https://github.com/llvm/llvm-project/pull/139840
More information about the llvm-commits
mailing list