[llvm] [RISCV] Hoist immediate addresses from loads/stores (PR #83644)
Visoiu Mistrih Francis via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 4 10:22:14 PST 2024
================
@@ -162,6 +162,14 @@ InstructionCost RISCVTTIImpl::getIntImmCostInst(unsigned Opcode, unsigned Idx,
// split up large offsets in GEP into better parts than ConstantHoisting
// can.
return TTI::TCC_Free;
+ case Instruction::Store:
+ // If the address is a constant, use the materialization cost.
+ if (Idx == 1)
+ return getIntImmCost(Imm, Ty, CostKind);
----------------
francisvm wrote:
Sure! Added.
https://github.com/llvm/llvm-project/pull/83644
More information about the llvm-commits
mailing list