This is an archive of the discontinued LLVM Phabricator instance.

[GVN, OptDiag] Include the value that is forwarded in load elimination
ClosedPublic

Authored by anemet on Nov 9 2016, 9:22 PM.

Details

Summary

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"

Event Timeline

anemet updated this revision to Diff 77443.Nov 9 2016, 9:22 PM
anemet retitled this revision from to [GVN, OptDiag] Include the value that is forwarded in load elimination.
anemet updated this object.
anemet added reviewers: hfinkel, dberlin.
anemet added a subscriber: llvm-commits.
anemet updated this revision to Diff 77839.Nov 14 2016, 10:46 AM

Rebase patch-set

hfinkel accepted this revision.Nov 22 2016, 6:20 AM
hfinkel edited edge metadata.

LGTM

lib/IR/DiagnosticInfo.cpp
190

In the future, we should try harder here to use debug info to get a real name.

This revision is now accepted and ready to land.Nov 22 2016, 6:20 AM
anemet added inline comments.Nov 28 2016, 9:43 AM
lib/IR/DiagnosticInfo.cpp
190

Added a FIXME about this.

Thanks for your review!

This revision was automatically updated to reflect the committed changes.