[PATCH] D63809: [HardwareLoops] Loop counter guard Loop intrinsic

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 01:41:24 PDT 2019


SjoerdMeijer added inline comments.


================
Comment at: lib/CodeGen/HardwareLoops.cpp:276
+
+    return cast<BranchInst>(Pred->getTerminator())->isConditional();
+  };
----------------
samparker wrote:
> samparker wrote:
> > SjoerdMeijer wrote:
> > > perhaps silly question, I guess the assumption here is that is if this is a conditional then it must be the loop check, but is that always true?
> > Well it certainly is controlling whether the loop is entered or not... I had the same thought tbh but I reasoned that any other condition of entering a loop would be handled before the iteration condition - i will add some tests along these lines though.
> My assumption was totally wrong :) so I'll revert to what I did originally: check for an icmp ne 0 so that the semantics don't change. I think we should be able to handle other icmp later by transforming them, if it's profitable.
cheers, sounds like a good plan


Repository:
  rL LLVM

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

https://reviews.llvm.org/D63809





More information about the llvm-commits mailing list