[PATCH] D135078: [AArch64][GlobalISel] Fold away lowered vector sign-extend of vector compares

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 07:26:58 PDT 2022


aemerson created this revision.
aemerson added a reviewer: paquette.
aemerson added a project: LLVM.
Herald added subscribers: hiraditya, kristof.beyls, rovka.
Herald added a project: All.
aemerson requested review of this revision.

This fixes a long standing cause of awful code generation when legalization creates
G_SEXT(G_FCMP(...)), for example due to promoting the condition of a vector G_SELECT.

Since on AArch64 vector compares sign-extend the condition value, there's no need
for this extra G_SEXT. Unfortunately by the time we get to post-legalization these
G_SEXTs have already been lowered into shifts, so this combine is a bit more
involved than I'd ideally like. Oh well.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135078

Files:
  llvm/lib/Target/AArch64/AArch64Combine.td
  llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/combine-udiv.ll
  llvm/test/CodeGen/AArch64/GlobalISel/postlegalizer-combiner-sext-of-vcmp.mir
  llvm/test/CodeGen/AArch64/arm64-vabs.ll
  llvm/test/CodeGen/AArch64/min-max.ll
  llvm/test/CodeGen/AArch64/neon-compare-instructions.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135078.464680.patch
Type: text/x-patch
Size: 130580 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221003/61beeee6/attachment-0001.bin>


More information about the llvm-commits mailing list