[PATCH] D26489: [GVN, OptDiag] Include the value that is forwarded in load elimination

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 21:22:05 PST 2016


anemet created this revision.
anemet added reviewers: hfinkel, dberlin.
anemet added a subscriber: llvm-commits.
Herald added a subscriber: fhahn.

This requires some changes to the opt-diag API.  Hal and I have
discussed this at the Dev Meeting and came up with a streaming delimiter
(setExtraArgs) to solve this.

Arguments after this delimiter are only included in the optimization
records and not in the remarks printed in the compiler output.  (Note,
how in the test the content of the YAML file changes but the remarks on
the compiler output don't.)

This implements the green GVN message with a bug fix at line
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

The fix is that now we properly include the constant value in the
message: "load of type i32 eliminated in favor of 7"


https://reviews.llvm.org/D26489

Files:
  include/llvm/Analysis/OptimizationDiagnosticInfo.h
  include/llvm/IR/DiagnosticInfo.h
  lib/IR/DiagnosticInfo.cpp
  lib/Transforms/Scalar/GVN.cpp
  test/Transforms/GVN/opt-remarks.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26489.77443.patch
Type: text/x-patch
Size: 6280 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161110/d4ffb05e/attachment.bin>


More information about the llvm-commits mailing list