[PATCH] D63036: [RFC] LLVM IR constant expressions never trap.

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 8 09:29:56 PDT 2019


jdoerfert added inline comments.


================
Comment at: docs/LangRef.rst:3441
+    never have undefined behavior; division operations that would have
+    undefined behavior instead produce poison.
 
----------------
I'm not really happy with this formulation.
It basically says that we somewhere define things to be UB and here we say that it is not UB if it is a constant.


================
Comment at: lib/Analysis/ValueTracking.cpp:489
+      if (V == I || !isa<Instruction>(V) ||
+          isSafeToSpeculativelyExecute(cast<Instruction>(V))) {
        EphValues.insert(V);
----------------
`V == I` implies `isa<Instruction>(V)` and you can use `isSafeToSpeculativelyExecute(I)`


Repository:
  rL LLVM

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

https://reviews.llvm.org/D63036





More information about the llvm-commits mailing list