[PATCH] D26488: [GVN] Basic optimization remark support

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 11 17:29:23 PST 2016


hfinkel added a comment.

Should we update the message to also provide the location/type of the store? (or the other load for the PRE case).

When we have debug information on the variable, should we print its name/type from the debug info? (This might be useful when we have aggregates, for example, especially after SROA is done with them). I'm happy for this to be done in follow-up if you agree it is useful.



================
Comment at: lib/Transforms/Scalar/GVN.cpp:1809
+        dbgs() << "GVN: load eliminated: " << *L << "\n");
+    ORE->emit(OptimizationRemark(DEBUG_TYPE, "LoadElim", L)
+              << "load of type " << ore::NV("Type", L->getType())
----------------
Please make a function to emit this remark; I don't want to repeat literal strings in the code.


https://reviews.llvm.org/D26488





More information about the llvm-commits mailing list