[PATCH] D17257: New utility class ReachingPhysDefs for post-ra analysis.

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 00:51:04 PDT 2016


jonpa added inline comments.

================
Comment at: lib/Target/AArch64/AArch64CollectLOH.cpp:127
@@ -125,3 +126,3 @@
 
-#define DEBUG_TYPE "aarch64-collect-loh"
+#define DEBUG_TYPE "reachingdefs"
 
----------------
qcolombet wrote:
> Actually, I’ve found that this is already possible.
> One has to separate the passes name with a comma.
> E.g.,  -debug-only=isel,machine-licm
> 
> In other words, please do not change that debug type :).
aah, that's good to know! :)

================
Comment at: lib/Target/AArch64/AArch64CollectLOH.cpp:532
@@ -703,3 +531,3 @@
 
-  const MachineInstr *Def = *UseToDefs.find(Instr)->second.begin();
+  MachineInstr *Def = *UseToDefs.find(Instr)->second.begin();
   if (Def->getOpcode() != AArch64::ADRP) {
----------------
qcolombet wrote:
> What I was saying is even if the UseToDefs structure hold non-const refs (which is fine), this particular use could remain const without impacting other clients, right?
Sorry, I should have mentioned that if I do not remove the const for the 'Def' variable, I get compilation errors:

...
lib/Target/AArch64/AArch64CollectLOH.cpp:543:27: error: no matching function for call to ‘llvm::MapVector<llvm::MachineInstr*, llvm::SetOfMachineInstr>::find(const llvm::MachineInstr*&) const’
     if (UseToDefs.find(Def) ==
...
note:   no known conversion for argument 1 from ‘const llvm::MachineInstr*’ to ‘llvm::MachineInstr* const&’
// It's a bit weird that UseToDefs can't use a const MachineInstr* as a key...
...
AArch64CollectLOH.cpp:549:11: error: invalid conversion from ‘const llvm::MachineInstr*’ to ‘llvm::MachineInstr*’ [-fpermissive]
     Instr = Def;
// Function would also have to be rewritten a bit, since Instr is non-const.

Not sure how to fix this, so I settled for removing the const on 'Def'...



http://reviews.llvm.org/D17257





More information about the llvm-commits mailing list