[PATCH] D128039: Fix D125335 accidentally change control flow.
Adrian Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 17 07:16:06 PDT 2022
adriantong1024 added inline comments.
================
Comment at: llvm/lib/CodeGen/MachineCopyPropagation.cpp:663
- if (TRI->regsOverlap(RegDef, RegSrc))
- continue;
-
- assert(RegDef.isPhysical() && RegSrc.isPhysical() &&
- "MachineCopyPropagation should be run after register allocation!");
-
- MCRegister Def = RegDef.asMCReg();
- MCRegister Src = RegSrc.asMCReg();
-
- // The two copies cancel out and the source of the first copy
- // hasn't been overridden, eliminate the second one. e.g.
- // %ecx = COPY %eax
- // ... nothing clobbered eax.
- // %eax = COPY %ecx
- // =>
- // %ecx = COPY %eax
- //
- // or
- //
- // %ecx = COPY %eax
- // ... nothing clobbered eax.
- // %ecx = COPY %eax
- // =>
- // %ecx = COPY %eax
- if (eraseIfRedundant(MI, Def, Src) || eraseIfRedundant(MI, Src, Def))
- continue;
+ if (!TRI->regsOverlap(RegDef, RegSrc)) {
+ assert(RegDef.isPhysical() && RegSrc.isPhysical() &&
----------------
Is this not the same as what is here already ?
================
Comment at: llvm/lib/CodeGen/MachineCopyPropagation.cpp:933
- if (TRI->regsOverlap(DefReg, SrcReg))
- continue;
-
- MCRegister Def = DefReg.asMCReg();
- MCRegister Src = SrcReg.asMCReg();
+ if (!TRI->regsOverlap(DefReg, SrcReg)) {
+ MCRegister Def = DefReg.asMCReg();
----------------
Same here. Is this not the same as what is here already ?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128039/new/
https://reviews.llvm.org/D128039
More information about the llvm-commits
mailing list