This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Check for ConstantExpr before using recursive helpers.
ClosedPublic

Authored by fhahn on Jul 24 2020, 4:22 AM.

Details

Summary

Make sure we do not call
constainsConstantExpression/containsUndefElement on ConstantExpression,
which is not supported.

In particular, containsUndefElement/constainsConstantExpression are only
supported on constants which are supported by getAggregateElement.

Unfortunately there's no convenient way to check if a constant supports
getAggregateElement, so just check for non-constantexpressions with
vector type. Other users of those functions do so too.

Diff Detail

Event Timeline

fhahn created this revision.Jul 24 2020, 4:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2020, 4:22 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
This revision is now accepted and ready to land.Jul 24 2020, 6:07 AM
This revision was automatically updated to reflect the committed changes.