[llvm] [SelectionDAG] Fix load/store legalization for softened x86_fp80 (PR #209991)
Muhammed Shiyas N via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 16 01:11:56 PDT 2026
================
@@ -1016,10 +1016,19 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_LOAD(SDNode *N) {
~(MachineMemOperand::MOInvariant | MachineMemOperand::MODereferenceable);
SDValue NewL;
if (L->getExtensionType() == ISD::NON_EXTLOAD) {
- NewL = DAG.getLoad(L->getAddressingMode(), L->getExtensionType(), NVT, dl,
- L->getChain(), L->getBasePtr(), L->getOffset(),
- L->getPointerInfo(), NVT, L->getBaseAlign(), MMOFlags,
- L->getAAInfo());
+ // If softening widens the integer representation (e.g. x86_fp80 -> i96),
+ // load the original memory width and extend to the softened type.
+ EVT MemVT = EVT::getIntegerVT(*DAG.getContext(), VT.getSizeInBits());
+ if (NVT.bitsGT(MemVT))
----------------
Shiyas-N wrote:
updated to use single getLoad() call
https://github.com/llvm/llvm-project/pull/209991
More information about the llvm-commits
mailing list