This is an archive of the discontinued LLVM Phabricator instance.

[PGO] Fixed assertion due to mismatched memcpy size type.
ClosedPublic

Authored by apazos on Aug 17 2017, 12:48 PM.

Details

Summary

Memcpy intrinsics have size argument of any integer type, like i32 or i64.
Fixed size type along with its value when cloning the intrinsic.

Diff Detail

Repository
rL LLVM

Event Timeline

apazos created this revision.Aug 17 2017, 12:48 PM
apazos added a subscriber: llvm-commits.

Added llvm-commits.

davidxl accepted this revision.Aug 17 2017, 4:42 PM

lgtm

This revision is now accepted and ready to land.Aug 17 2017, 4:42 PM
xur edited edge metadata.Aug 18 2017, 9:09 AM

Looks good to me. Thanks for fixing.

mcrosier added inline comments.
lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp
368 ↗(On Diff #111545)

I believe this can be just a cast, rather than a dyn_cast (we know the cloned instruction is a MemIntrinsic).

370 ↗(On Diff #111545)

You might consider adding a message within the assert:
assert(SizeType && "Expected an integer size type.");

apazos updated this revision to Diff 111706.Aug 18 2017, 11:09 AM
apazos marked 2 inline comments as done.
apazos edited the summary of this revision. (Show Details)

Added assert message.

apazos marked an inline comment as not done.Aug 18 2017, 11:09 AM
This revision was automatically updated to reflect the committed changes.