[PATCH] D111530: [TargetLowering] Optimize expanded SRL/SHL feeded into SETCC ne/eq 0

Filipp Zhinkin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 11 03:12:42 PDT 2021


fzhinkin created this revision.
Herald added subscribers: pengfei, hiraditya.
fzhinkin requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

During legalization SHL/SRL nodes could be expanded into expression
that rotates low/high part of original input and then apply OR to
rotated part and other part. If the result of this operation is
compared for equality/not-equality with zero then rotation could
be removed as it does not affect comparision result.

Bug report: https://bugs.llvm.org/show_bug.cgi?id=50197


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111530

Files:
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/test/CodeGen/AArch64/arm64-icmp-shift-opt.ll
  llvm/test/CodeGen/ARM/arm-icmp-shift-opt.ll
  llvm/test/CodeGen/ARM/consthoist-icmpimm.ll
  llvm/test/CodeGen/X86/icmp-shift-opt.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111530.378602.patch
Type: text/x-patch
Size: 20553 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211011/3225b38e/attachment.bin>


More information about the llvm-commits mailing list