This is a pilot change to verify the logic. The rest will be
done in a same way, at least the rest of VOP1.
Details
- Reviewers
arsenm - Commits
- rGd46d534dbbba: [AMDGPU] Make some VOP1 instructions rematerializable
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
RA has VirtRegAuxInfo::weightCalcHelper() function which halves a weight of a LI if it is rematerializable, which in turn leads to different RA decisions. We will generally have a lot of small codegen changes, not just rematerialization instead of spilling:
// If all of the definitions of the interval are re-materializable, // it is a preferred candidate for spilling. // FIXME: this gets much more complicated once we support non-trivial // re-materialization. if (isRematerializable(LI, LIS, VRM, *MF.getSubtarget().getInstrInfo())) TotalWeight *= 0.5F;
It may be beneficial to only do it if we have isAsCheapAsAMove or at least use a different weight multiplier. This is however a different and much more intrusive change.
llvm/test/tools/llvm-mca/AMDGPU/gfx10-double.s | ||
---|---|---|
63 ↗ | (On Diff #357656) | Something is wrong here, latency should not been changed... |
I have misplaces braces in the td file, that's why there are so many codegen changes.
Fixed brances in the td. There are no parasite codegen changes anymore and no regressions. Only the rematerialization/spilling is actually changed.
- Make more VOP1 rematerializable.
- Added instructions with SDWA and verified SDWA handling (unused_preserve cannot be rematerialized).
- Dropped old logic to specifically list and handle move instructions, it is covered by the new more generic code.
Braces