This is an archive of the discontinued LLVM Phabricator instance.

[llvm][NFC] CallSite removal from inliner-related files
ClosedPublic

Authored by mtrofin on Apr 12 2020, 8:08 PM.

Details

Summary

This removes CallSite from inliner files. Some dependencies where thus affected.

Diff Detail

Event Timeline

mtrofin created this revision.Apr 12 2020, 8:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2020, 8:08 PM
craig.topper added inline comments.Apr 12 2020, 11:32 PM
llvm/lib/CodeGen/SafeStack.cpp
324

Shouldn't this be CallBase? Instruction::Call uses this code too.

707–709

Use CallInst to match the only caller?

719–720

I think this should be CI not CB since its CallInst not CallBase.

llvm/lib/Transforms/IPO/PartialInlining.cpp
306–307

Since you're here anyway, drop the else

307–311

Drop this since it should be obviously unreachable without the elses?

769

Why do we need this variable?

779–780

Can we just use CB instead of *Call

llvm/lib/Transforms/Utils/InlineFunction.cpp
1658–1659

Drop this variable?

mtrofin updated this revision to Diff 256989.Apr 13 2020, 8:42 AM
mtrofin marked 10 inline comments as done.

feedback

mtrofin added inline comments.Apr 13 2020, 11:02 AM
llvm/lib/CodeGen/SafeStack.cpp
324

True, thanks for the catch!

llvm/lib/Transforms/IPO/PartialInlining.cpp
306–307

There's still the case of a CallBrInst. Rewrote as it could be simpler, though.

dblaikie added inline comments.Apr 13 2020, 12:48 PM
llvm/lib/CodeGen/SafeStack.cpp
346–347

Probably commit things like this independently (before/after this refactor, whichever suits better) without precommit review.

llvm/lib/Transforms/Utils/InlineFunction.cpp
1662

You don't need to add a & here, I think?

mtrofin updated this revision to Diff 257166.Apr 13 2020, 5:11 PM
mtrofin marked 3 inline comments as done.

small fixes

llvm/lib/CodeGen/SafeStack.cpp
346–347

In this case, we needed ImmutableCallSite::arg_iterator -> auto because we don't want ImmutableCallSite

dblaikie accepted this revision.Apr 13 2020, 6:21 PM

Sounds good!

This revision is now accepted and ready to land.Apr 13 2020, 6:21 PM
This revision was automatically updated to reflect the committed changes.