[PATCH] D72636: Cancelling out G_MERGE_VALUES/G_UNMERGE pairs sometimes needs a copy
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 13 12:09:28 PST 2020
arsenm added a comment.
Needs tests
================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h:402
+ auto *NewRC = MRI.getRegClassOrNull(NewDef);
+ if ((!OldRC && !NewRC) || (OldRC && NewRC && OldRC == NewRC))
+ MRI.replaceRegWith(OldReg, NewDef);
----------------
This is just OldRC == NewRC
================
Comment at: llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h:406
+ Builder.setInstr(MI);
+ Builder.buildInstr(TargetOpcode::COPY, {OldReg}, {NewDef});
+ }
----------------
buildCopy
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72636/new/
https://reviews.llvm.org/D72636
More information about the llvm-commits
mailing list