[ValueTracking] Make isGuaranteedNotToBeUndefOrPoison exit early when MetadataAsValue is given

It is set to conservatively return false, otherwise noundef attributes are added to function calls with metadata arguments.
This commit is contained in:
Juneyoung Lee 2020-09-25 09:49:13 +09:00
parent 1c45220028
commit 92106641ae
1 changed files with 3 additions and 0 deletions

View File

@ -4881,6 +4881,9 @@ static bool isGuaranteedNotToBeUndefOrPoison(const Value *V,
if (Depth >= MaxAnalysisRecursionDepth)
return false;
if (isa<MetadataAsValue>(V))
return false;
if (const auto *A = dyn_cast<Argument>(V)) {
if (A->hasAttribute(Attribute::NoUndef))
return true;