[PATCH] D76179: [CodeGenPrepare] Freeze condition when transforming select to br

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 14 11:15:58 PDT 2020


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

> If it is not freezed, instsimplify or the later pipeline can potentially exploit undefined behavior.

Do we actually have instsimplify invocations so late, after CGP? I thought we didn't.



================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:6223
+  IRBuilder<> IB(SI);
+  auto CondFr = IB.CreateFreeze(SI->getCondition(), SI->getName() + ".fr");
+  IB.CreateCondBr(CondFr, TT, FT, SI);
----------------
`+".frozen"`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76179





More information about the llvm-commits mailing list