[PATCH] D38336: Add an @llvm.sideeffect intrinsic

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 15:46:53 PDT 2017


efriedma added inline comments.


================
Comment at: docs/LangRef.rst:14208
+has externally observable side effects and therefore may not be deleted
+or reordered past other externally observable side effects.
+
----------------
A language that needs these is going to be inserting a lot of them; assuming a language doesn't have goto, I think the frontend needs to insert one at the beginning of every function and every loop.  Is there some rule for coalescing and/or eliminating llvm.sideeffect calls which aren't necessary?


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:5667
+    // Discard annotate attributes, assumptions, and artificial side-effects.
     return nullptr;
 
----------------
Why is it safe to drop the llvm.sideeffect call in SelectionDAG?


Repository:
  rL LLVM

https://reviews.llvm.org/D38336





More information about the llvm-commits mailing list