[PATCH] D14007: Load elimination based on new 'InvarantInfo' property for global variables.

Nick Lewycky via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 8 16:06:07 PST 2015


nlewycky added a comment.

I've been thinking about this patch and I don't understand what change you're trying to make at a high level.

Here's a hypothesis about how to support invariant intrinsics in globalopt: ignore them entirely. GlobalOpt evaluates each instruction in turn, following from caller into the body of a callee. If it can't see any instruction at any time, it aborts the whole chain of evaluation. The point of 'invariant' intrinsics is to mark that an *opaque* callee will not mutate memory, but globalopt never takes any action when given an opaque callee. Therefore, there is nothing to support here, we just need to silently ignore the invariant intrinsics. Does that sound right?


================
Comment at: lib/Transforms/IPO/GlobalOpt.cpp:2704-2705
@@ +2703,4 @@
+  while (CurInst) {
+    if (isa<CallInst>(CurInst) || isa<InvokeInst>(CurInst)) {
+      CallSite CS(CurInst);
+
----------------
CallSite CS(CurInst);
if (!CS) continue;



http://reviews.llvm.org/D14007





More information about the llvm-commits mailing list