1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[Attributor][NFC] Do not manifest noundef for positions to be changed to undef

This patch fixes AANoUndef manifestation.
We should not manifest noundef for positions that will be changed to undef.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D86835
This commit is contained in:
Shinji Okumura 2020-08-30 03:23:41 +09:00
parent 861127265e
commit 408b703e38

View File

@ -7812,6 +7812,13 @@ struct AANoUndefImpl : AANoUndef {
// values.
if (A.isAssumedDead(getIRPosition(), nullptr, nullptr))
return ChangeStatus::UNCHANGED;
// A position whose simplified value does not have any value is
// considered to be dead. We don't manifest noundef in such positions for
// the same reason above.
auto &ValueSimplifyAA = A.getAAFor<AAValueSimplify>(
*this, getIRPosition(), /* TrackDependence */ false);
if (!ValueSimplifyAA.getAssumedSimplifiedValue(A).hasValue())
return ChangeStatus::UNCHANGED;
return AANoUndef::manifest(A);
}
};