[PATCH] D97537: [Codegenprepare] Use IV increment instead of IV if we can prove it is not a poisoned value

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 05:42:30 PST 2021


nikic added inline comments.


================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:3874
+          ICmpInst::Predicate Pred;
+          if (match(BB->getTerminator(),
+                    m_Br(m_ICmp(Pred, m_Specific(IVInc), m_Value()),
----------------
spatel wrote:
> reames wrote:
> > Detail on the proof here -- the fact the branch is a loop exit is definitely irrelevant.
> > 
> > It's not clear to me whether branching on poison is immediate UB.  LangRef seems to say "yes", but the code in ValueTracking seems to say "no".  We need to draw in the experts here.  (Juneyoung)
> cc @aqjune @lebedev.ri @nikic for branch-on-poison question.
See D92739. Branch on poison is UB, but we're currently being conservative about it due to some known bugs (imho to our detriment).


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

https://reviews.llvm.org/D97537



More information about the llvm-commits mailing list