[llvm] [RISCV] Support constant hoisting of immediate store values (PR #96073)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 20 06:57:53 PDT 2024
================
@@ -510,10 +510,12 @@ int getIntMatCost(const APInt &Val, unsigned Size, const MCSubtargetInfo &STI,
int Cost = 0;
for (unsigned ShiftVal = 0; ShiftVal < Size; ShiftVal += PlatRegSize) {
APInt Chunk = Val.ashr(ShiftVal).sextOrTrunc(PlatRegSize);
+ if (FreeZeroes && Chunk == 0)
----------------
topperc wrote:
It's smaller in code size to check for 0 using the int64_t returned from `Chunk.getSExtValue()` since there won't be code emitted for the non-small APInt case.
https://github.com/llvm/llvm-project/pull/96073
More information about the llvm-commits
mailing list