This is an archive of the discontinued LLVM Phabricator instance.

Handle indirect calls in preallocated verification
ClosedPublic

Authored by aeubanks on Apr 30 2020, 1:49 PM.

Details

Summary

getCalledFunction() returns null for indirect function invocations.

Diff Detail

Event Timeline

aeubanks created this revision.Apr 30 2020, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 30 2020, 1:50 PM
rnk accepted this revision.Apr 30 2020, 2:17 PM

lgtm

One thing you may have noticed is that LLVM has strange behavior for looking at attributes at the call site. Doing that can sometimes look at attributes on the callee if the call is direct. This makes sense for optimization hints (readonly, argmemonly etc), but not so much for ABI attributes.

llvm/test/Verifier/preallocated-valid.ll
21

This could be fragile to optimizations. I would probably take this as a parameter:

define void @preallocated_indirect(void (i32*)* %f) {
...

It's a bit arbitrary, but I like it when the IR looks like a plausible program.

This revision is now accepted and ready to land.Apr 30 2020, 2:17 PM
aeubanks marked an inline comment as done.Apr 30 2020, 2:56 PM
This revision was automatically updated to reflect the committed changes.