This is an archive of the discontinued LLVM Phabricator instance.

ConstantFolding: Avoid a crash.
ClosedPublic

Authored by manojgupta on Jul 23 2018, 12:10 PM.

Details

Summary

Check if the parent basic block and caller exists
before calling CS.getCaller when constant folding
strip.invariant.group instrinsic.

This avoids a crash when the function containing the intrinsic
is being inlined. The instruction is checked for any simplifiction
but has not yet been added to a basic block.

Diff Detail

Repository
rL LLVM

Event Timeline

manojgupta created this revision.Jul 23 2018, 12:10 PM

Thanks Piotr for the testcase.

This revision is now accepted and ready to land.Jul 23 2018, 1:56 PM
This revision was automatically updated to reflect the committed changes.

Thanks for the quick review!