[PATCH] D36435: [MachineOutliner] Ensure AArch64 outliner doesn't mess with any register that overlaps with LR

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 16:35:09 PDT 2017


MatzeB accepted this revision.
MatzeB added a comment.
This revision is now accepted and ready to land.

This looks simple enough and comes with a test so LGTM.
So I'd suggest making an attempt to stay with readsReg()/modifiesRegister() before comitting.



================
Comment at: lib/Target/AArch64/AArch64InstrInfo.cpp:4505
+    // Don't outline anything that uses the link register.
+    if (MOP.isReg() && getRegisterInfo().regsOverlap(MOP.getReg(), AArch64::LR))
+      return MachineOutlinerInstrType::Illegal;
----------------
`modifiesRegister()`/`readsRegister()` can figure this out for you as well if you pass in a TRI argument (without that it has no idea about aliases unfortunately).


https://reviews.llvm.org/D36435





More information about the llvm-commits mailing list