This is an archive of the discontinued LLVM Phabricator instance.

Thread TargetLibraryInfo through PHITransAddr.
Needs ReviewPublic

Authored by nicholas on Apr 23 2016, 11:08 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

PHITransAddr has a TargetLibraryInfo* member which it always sets to nullptr at construction. It has the logic to pass the TLI down to instruction simplify utility functions, but it doesn't take any value from the pass.

The attached pass simply adds the plumbing to the four callees, three of which have TLIs to pass in.

There is no testcase included, all the existing tests continue to pass. This change wasn't motivated by any example code, only by the "huh that's funny" of seeing the PHITransAddr constructor always set TLI to nullptr.

Diff Detail

Repository
rL LLVM

Event Timeline

nicholas updated this revision to Diff 54793.Apr 23 2016, 11:08 PM
nicholas retitled this revision from to Thread TargetLibraryInfo through PHITransAddr..
nicholas updated this object.
nicholas set the repository for this revision to rL LLVM.
nicholas added a subscriber: llvm-commits.

Why not just delete the field instead?

Ping? (Phab doesn't note that I replied to Rafael, it was on llvm-commits.)

I think it makes more sense to pass TLI from people who have it to utility functions that take it, even if they don't use it today.

If we don't thread it through we should remove it PHITransAddr but also from the parts of simplify instruction that don't use it too.