This is an archive of the discontinued LLVM Phabricator instance.

[SDAG] Fix incorrect use of undef for boolean contents (PR63055)
ClosedPublic

Authored by nikic on Jun 1 2023, 5:38 AM.

Details

Summary

FoldSetCC() returns UNDEF in a number of cases. However, the SetCC result must follow BooleanContents. Unless the type is a pre-legalization i1 or we have UndefinedBooleanContents, the use of UNDEF will not uphold the requirement that the top bits are either zero or match the low bit. In such cases, return zero instead.

Fixes https://github.com/llvm/llvm-project/issues/63055.

Diff Detail

Event Timeline

nikic created this revision.Jun 1 2023, 5:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2023, 5:38 AM
nikic requested review of this revision.Jun 1 2023, 5:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2023, 5:38 AM
nikic updated this revision to Diff 527378.Jun 1 2023, 5:44 AM

Check the scalar type for i1. This avoids the ARM test regressions.

RKSimon accepted this revision.Jun 1 2023, 5:58 AM

LGTM

This revision is now accepted and ready to land.Jun 1 2023, 5:58 AM
This revision was landed with ongoing or failed builds.Jun 1 2023, 6:19 AM
This revision was automatically updated to reflect the committed changes.