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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 05:39:24 PST 2021


spatel added subscribers: nikic, aqjune, lebedev.ri.
spatel 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()),
----------------
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.


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

https://reviews.llvm.org/D97537



More information about the llvm-commits mailing list