[PATCH] D104394: [MachineCopyPropagation] Fix differences in code gen when compiling with -g
Kai Luo via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 28 08:15:01 PDT 2021
lkail added inline comments.
================
Comment at: llvm/lib/CodeGen/MachineCopyPropagation.cpp:882
+ // register is changed.
+ for (MCRegUnitIterator RUI(MO.getReg().asMCReg(), TRI); RUI.isValid();
+ ++RUI) {
----------------
```
- if (MO.readsReg())
- Tracker.invalidateRegister(MO.getReg().asMCReg(), *TRI);
+ if (MO.readsReg()) {
+ if (MO.isDebug()) {
+ for (MCRegUnitIterator RUI(MO.getReg(), TRI); RUI.isValid(); ++RUI) {
+ if (MachineInstr *Copy = Tracker.findCopyDefViaUnit(*RUI, *TRI)) {
+ CopyDbgUsers[Copy].insert(MI);
+ }
+ }
+ } else {
+ Tracker.invalidateRegister(MO.getReg().asMCReg(), *TRI);
+ }
+ }
```
Doesn't it work?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104394/new/
https://reviews.llvm.org/D104394
More information about the llvm-commits
mailing list