[GVN, OptDiag] Print the interesting instructions involved in missed load-elimination
authorAdam Nemet <anemet@apple.com>
Tue, 29 Nov 2016 00:09:22 +0000 (00:09 +0000)
committerAdam Nemet <anemet@apple.com>
Tue, 29 Nov 2016 00:09:22 +0000 (00:09 +0000)
commitb9e53c9056fad09fb5e1a5b61ab4b7acffd8d6ad
treee9f812332971157c6d367473b19be4da29a78fdf
parent9e749f663647545fd897e516cee57d19c3daeca5
[GVN, OptDiag] Print the interesting instructions involved in missed load-elimination

This includes the intervening store and the load/store that we're trying
to forward from in the optimization remark for the missed load
elimination.

This is hooked up under a new mode in ORE that allows for compile-time
budget for a bit more analysis to print more insightful messages.  This
mode is currently enabled for -fsave-optimization-record (-Rpass is
trickier since it is controlled in the front-end).

With this we can now print the red remark in http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/SingleSource/Benchmarks/Dhrystone/CMakeFiles/dry.dir/html/_org_test-suite_SingleSource_Benchmarks_Dhrystone_dry.c.html#L446

Differential Revision: https://reviews.llvm.org/D26490

llvm-svn: 288090
llvm/include/llvm/Analysis/OptimizationDiagnosticInfo.h
llvm/lib/Transforms/Scalar/GVN.cpp
llvm/test/Transforms/GVN/opt-remarks.ll