[all-commits] [llvm/llvm-project] 8687f7: [RISCV] Support constant hoisting of immediate sto...
Alex Bradbury via All-commits
all-commits at lists.llvm.org
Wed Jul 17 07:19:52 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8687f7cd662384e3bd009a0f43eabbbe87f4387a
https://github.com/llvm/llvm-project/commit/8687f7cd662384e3bd009a0f43eabbbe87f4387a
Author: Alex Bradbury <asb at igalia.com>
Date: 2024-07-17 (Wed, 17 Jul 2024)
Changed paths:
M llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp
M llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.h
M llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
M llvm/test/Transforms/ConstantHoisting/RISCV/immediates.ll
Log Message:
-----------
[RISCV] Support constant hoisting of immediate store values (#96073)
Previously getIntImmInstCost only calculated the cost of materialising
the argument of a store if it was the address. This means
ConstantHoisting's transformation wouldn't kick in for cases like
storing two values that require multiple instructions to materialise but
where one can be cheaply generated from the other (e.g. by an addition).
Two key changes were needed to avoid regressions when enabling this:
* Allowing constant materialisation cost to be calculated assuming
zeroes are free (as might happen if you had a 2*XLEN constant and one
half is zero).
* Avoiding constant hoisting if we have a misaligned store that's going
to be a legalised to a sequence of narrower stores. I'm seeing cases
where hoisting the constant ends up with worse codegen in that case.
Out of caution and so as not to unexpectedly degrade other existing hoisting logic, FreeZeroes is used only for the new cost calculations for the load instruction. It would likely make sense to revisit this later.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list