This is an archive of the discontinued LLVM Phabricator instance.

[TargetLowering] Use IRBuilderBase instead of IRBuilder<> (NFC)
ClosedPublic

Authored by nikic on Jun 5 2021, 1:58 PM.

Details

Summary

Don't require a specific kind of IRBuilder for TargetLowering hooks. This allows us to drop the IRBuilder.h include from TargetLowering.h.

Diff Detail

Event Timeline

nikic created this revision.Jun 5 2021, 1:58 PM
nikic requested review of this revision.Jun 5 2021, 1:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2021, 1:58 PM
RKSimon added inline comments.Jun 5 2021, 2:06 PM
llvm/include/llvm/CodeGen/TargetLowering.h
42–43

I don't suppose this will let us drop the IRBuilder.h include and just use forward declarations? TargetLowering.h is a pretty heavy include and anything to reduce it would be very useful.

nikic added inline comments.Jun 5 2021, 2:10 PM
llvm/include/llvm/CodeGen/TargetLowering.h
42–43

Yes, that's exactly the goal here :) I just wanted to separate the API changing part of the change first. Otherwise this should be matter of moving a couple default implementations out of line and lots of include fixup in other files.

RKSimon added inline comments.Jun 5 2021, 2:15 PM
llvm/include/llvm/CodeGen/TargetLowering.h
42–43

Sorry I obviously didn't fully read the summary :)

Just to be certain - is this actually going to work? After fixing the implicit dependencies will you be able to remove the include?

nikic updated this revision to Diff 350102.Jun 6 2021, 7:14 AM
nikic edited the summary of this revision. (Show Details)

Rebase and remove include.

RKSimon accepted this revision.Jun 6 2021, 7:23 AM

Awesome! LGTM, cheers.

This revision is now accepted and ready to land.Jun 6 2021, 7:23 AM
This revision was landed with ongoing or failed builds.Jun 6 2021, 7:30 AM
This revision was automatically updated to reflect the committed changes.