[PATCH] D151473: [LegalizeTypes][AArch64][ARM] Teach PromoteIntegerResult to preserve NSW/NUW flags for ADD/SUB.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 10:45:15 PDT 2023


craig.topper created this revision.
craig.topper added reviewers: nikic, 0xdc03, efriedma, RKSimon.
Herald added subscribers: StephenFan, dmgreen, hiraditya, kristof.beyls.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added a project: LLVM.

If the promoted inputs are known to be sign/zero extended, we can
preserve these flags when we promote the operation.

Alternatively, we could forcibly sign/zero extend the input in order
to preserve the flag, but that could lead to extra code that may
not be beneficial.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151473

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151473.525701.patch
Type: text/x-patch
Size: 13928 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230525/c8bfa5bf/attachment.bin>


More information about the llvm-commits mailing list