[all-commits] [llvm/llvm-project] 8cdbf8: [SelectionDAG][AArch64][ARM] Remove setFlags call ...

Craig Topper via All-commits all-commits at lists.llvm.org
Thu May 25 11:01:41 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8cdbf8d3e7b88da376a09a58ddd1fcc00cf30bb2
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
    M llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
    M llvm/test/CodeGen/AArch64/arm64-vhadd.ll
    M llvm/test/CodeGen/AArch64/sve-hadd.ll
    M llvm/test/CodeGen/Thumb2/mve-vhadd.ll

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

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.

Differential Revision: https://reviews.llvm.org/D151472

More information about the All-commits mailing list