This is an archive of the discontinued LLVM Phabricator instance.

[CallSite Removal][CodeGenPrepare] permit optimizations for CallBrInst
Needs ReviewPublic

Authored by nickdesaulniers on Apr 10 2020, 12:49 PM.

Details

Summary

Craig noticed that some of the optimizations here for inline assembly
are handled for CallInsts but not CallBrInsts.

Since CallInst and CallBrInst now share the same base CallBase class,
use that instead. This unlocks these optimizations for CallBrInst.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2020, 12:49 PM
nickdesaulniers planned changes to this revision.Apr 10 2020, 12:50 PM

WIP: I'd like to clean up TLI and FortifiedLibCallSimplifier first, which will simplify this patch. Posting it early for review.

craig.topper added inline comments.Apr 10 2020, 1:04 PM
llvm/lib/CodeGen/CodeGenPrepare.cpp
1892–1904

Why is this CallInst?

llvm/lib/CodeGen/CodeGenPrepare.cpp
1892–1904

The call below to TLI->ExpandInlineAsm(CI) requires a CallInst.

The added dyn_cast<CallInst> in the patch are what I want to remove. That will require fixing up similar interface issues in FortifiedLibCallSimplifier and TargetLoweringInfo.

Should I shave those yaks in this one change, or submit this first separately, then rebase+revist this one? (Then I can drop my added dyn_cast).

llvm/lib/CodeGen/CodeGenPrepare.cpp
1892–1904

s/or submit this/or submit those/

  • fixup shouldAlignPointerArgs, drop related dyn_cast