This change shall be NFC since the value of the used register
will not be available anyway if it is killed, but there is no
point to even attempt rematerialization. We could skip a lot
of logic in the RA by bailing out early.
Details
Diff Detail
Event Timeline
I.e. rationale: when we do remat original instruction is still in place and one of its operands is killed. It is certainly either dead or VNI is different at the point of rematerialization, so it will not pass a check for "all uses are available". There is no even a point to report it can be rematerialized when an extensive check will say it is not. For the very same reason I was unable to create a test for it, it never happens.
@arsenm We may want to add this check for VOP, just to speedup RA a bit. This will be an extra work, however. Generic implementation scans operands anyway, so it is cheap, but we don't.
llvm/lib/CodeGen/TargetInstrInfo.cpp | ||
---|---|---|
988–990 | Can't the caller base this check on the live segment? |
llvm/lib/CodeGen/TargetInstrInfo.cpp | ||
---|---|---|
988–990 | TII does not have LIS and multiple callers which do have it would need to scan operands again, which defeats the purpose of the patch to quickly bail if we cannot process it anyway. Here we already have MO available and the check is very cheap. |
Can't the caller base this check on the live segment?