This is an archive of the discontinued LLVM Phabricator instance.

Fix the bug of samplepgo indirect call promption when type casting of the return value is needed.
ClosedPublic

Authored by danielcdh on Feb 5 2017, 2:45 PM.

Details

Summary

When type casting of the return value is needed, promoteIndirectCall will return the type casting instruction instead of the direct call. This patch changed to return the direct call instruction instead.

Event Timeline

danielcdh created this revision.Feb 5 2017, 2:45 PM
danielcdh updated this revision to Diff 87239.Feb 6 2017, 8:46 AM

update to include InvokeInst too.

davidxl added inline comments.Feb 6 2017, 9:40 AM
lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
562 ↗(On Diff #87239)

stripPointerCasts call? This probably should be called at the caller of promoteIndirectcall

danielcdh updated this revision to Diff 87245.Feb 6 2017, 9:50 AM
danielcdh marked an inline comment as done.

update

davidxl accepted this revision.Feb 6 2017, 10:01 AM

lgtm

This revision is now accepted and ready to land.Feb 6 2017, 10:01 AM
danielcdh closed this revision.Feb 6 2017, 10:21 AM