[all-commits] [llvm/llvm-project] 331ba4: [AArch64] Take cmn into account when adjusting com...

AtariDreams via All-commits all-commits at lists.llvm.org
Mon Jul 15 23:57:28 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 331ba4369ac3cdf2ac2c6f724f9beaf43fb3fea7
      https://github.com/llvm/llvm-project/commit/331ba4369ac3cdf2ac2c6f724f9beaf43fb3fea7
  Author: AtariDreams <gfunni234 at gmail.com>
  Date:   2024-07-16 (Tue, 16 Jul 2024)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/test/CodeGen/AArch64/cmp-to-cmn.ll
    M llvm/test/CodeGen/AArch64/typepromotion-overflow.ll

  Log Message:
  -----------
  [AArch64] Take cmn into account when adjusting compare constants (#98634)

Turning a cmp into cmn saves an extra mov and negate instruction, so
take that into account when choosing when to flip the compare operands.

This will allow further optimizations down the line when we fold more
variations of negative compares to cmn.

As part of this, do not consider right-hand operands whose absolute
value can be encoded into a cmn if it is the 2nd operand.



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