[llvm] [TailDup][MachineSSAUpdater] Let RewriteUse insert a COPY when needed (PR #95553)
Björn Pettersson via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 19 08:47:00 PDT 2024
================
@@ -236,6 +236,19 @@ void MachineSSAUpdater::RewriteUse(MachineOperand &U) {
NewVR = GetValueInMiddleOfBlock(UseMI->getParent());
}
+ // Insert a COPY if register class contraint isn't fulfilled.
+ if (const TargetRegisterClass *RC =
+ dyn_cast_or_null<const TargetRegisterClass *>(RegAttrs.RCOrRB)) {
+ if (NewVR && !RC->hasSubClassEq(MRI->getRegClass(NewVR))) {
----------------
bjope wrote:
What would the difference be compared to just using hasSubClassEq to check if the new class is subset of the original class?
https://github.com/llvm/llvm-project/pull/95553
More information about the llvm-commits
mailing list