[all-commits] [llvm/llvm-project] ba1158: [DAGCombiner][AArch64] Make combineCarryDiamond av...

Craig Topper via All-commits all-commits at lists.llvm.org
Thu Apr 18 08:35:12 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ba1158813d4656585c7e345747bc4db4e3f03b9d
      https://github.com/llvm/llvm-project/commit/ba1158813d4656585c7e345747bc4db4e3f03b9d
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2024-04-18 (Thu, 18 Apr 2024)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    A llvm/test/CodeGen/AArch64/pr88966.ll

  Log Message:
  -----------
  [DAGCombiner][AArch64] Make combineCarryDiamond avoid creating UADDO_CARRY with carry in larger than setcc result type. (#89121)

In the attach test case we were creating a UADDO_CARRY with i1 carry out
and i41 carry in. i41 exceeds is larger than the setcc result type for
AArch64 which is i32. i41 needs to be promoted to i64 since it is larger
than i32. The type legalizer tried to use promoteTargetBoolean, but that
can only promote from a type smaller than setcc result type.

The easiest fix here is to force the carryin type to match the carryout
type at the type of creation. This should ensure the node won't exceeed
setcc result type as long as the output type doesn't.

I think we should explore requiring the types to match for this node.

Fixes #88966



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list