Luke Lau
be23cdc858
[RegAlloc] Account for use availability when applying rematerializable weight discount ( #159180 )
...
This aims to fix the issue that caused https://reviews.llvm.org/D106408
to be reverted.
CalcSpillWeights will reduce the weight of an interval by half if it's
considered rematerializable, so it will be evicted before others.
It does this by checking TII.isTriviallyReMaterializable. However
rematerialization may still fail if any of the defining MI's uses aren't
available at the locations it needs to be rematerialized.
LiveRangeEdit::canRematerializeAt calls allUsesAvailableAt to check this
but CalcSpillWeights doesn't, so the two diverge.
This fixes it by also checking allUsesAvailableAt in CalcSpillWeights.
In practice this has zero change AArch64/X86-64/RISC-V as measured on
llvm-test-suite, but prevents weights from being perturbed in an
upcoming patch which enables more rematerialization by re-attempting
https://reviews.llvm.org/D106408
2025-09-26 07:57:12 +08:00
..
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-09-26 07:57:12 +08:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-07-14 16:48:54 +01:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-07-03 07:48:08 -04:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-07-10 21:06:52 +01:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-07-14 16:48:54 +01:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-07-03 07:48:08 -04:00
2025-07-10 21:06:52 +01:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-07-03 07:48:08 -04:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-07-03 07:48:08 -04:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00
2025-08-12 11:23:05 -07:00