This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG][AArch64][ARM] Remove setFlags call from DAGTypeLegalizer::SetPromotedInteger.
ClosedPublic

Authored by craig.topper on May 25 2023, 10:22 AM.

Details

Summary

This was originally added to preserve FMF on SETCC. Unfortunately,
it also incorrectly preserves nuw/nsw on ADD/SUB in some cases.

There's also no guarantee the new opcode is even the same opcode
as the original node.

This patch removes the code and adds code to explicitly preserve
FMF flags in the SETCC promotion function.

The other test changes are from nuw/nsw not being preserved. I
believe for all these tests it was correct to preserve the flags,
so we need new code to preserve the flags when possible. I'll post
another patch for that since it's a riskier change.

This should unblock D150769.

Diff Detail

Event Timeline

craig.topper created this revision.May 25 2023, 10:22 AM
craig.topper requested review of this revision.May 25 2023, 10:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2023, 10:22 AM
bjope added a subscriber: bjope.May 25 2023, 10:25 AM
This revision is now accepted and ready to land.May 25 2023, 10:43 AM
This revision was landed with ongoing or failed builds.May 25 2023, 11:01 AM
This revision was automatically updated to reflect the committed changes.