[PATCH] D70240: [ARM][ReachingDefs] Remove dead code in loloops.

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 06:04:30 PST 2019


samparker marked 3 inline comments as done.
samparker added inline comments.


================
Comment at: llvm/lib/CodeGen/ReachingDefAnalysis.cpp:229
+  MachineBasicBlock::iterator MI = MachineBasicBlock::iterator(Def);
+  while (++MI != MBB->end()) {
+    for (auto &MO : MI->operands()) {
----------------
dmgreen wrote:
> Does this detect other uses outside of the BB? If the value is live-out.
No, which is okay for my use, but I'll rename the function to be clear.


================
Comment at: llvm/lib/CodeGen/ReachingDefAnalysis.cpp:234
+ 
+      if (getReachingMIDef(&*MI, PhysReg) != Def)
+        return;
----------------
SjoerdMeijer wrote:
> Just a quick question on this. 
> At this point, I think we have found an instruction that defines PhysReg, so I was looking into why we need to call getReachingMIDef , but perhaps you can help me, and/or place a comment if you think that is useful.
We're looking for uses of 'Def', so as soon as the ReachingDef of PhysReg stops being 'Def', we know there's no more users. I'll add a comment.


================
Comment at: llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp:375
+    if (RDA->getReachingDef(VCTP, NumElements) >= 0)
+      CannotTailPredicate = true;
+    else {
----------------
dmgreen wrote:
> Maybe make this into a lambda and do some early exits.
I'll give it a go.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70240/new/

https://reviews.llvm.org/D70240





More information about the llvm-commits mailing list