[PATCH] D86438: [SDAG] Convert FSHL <--> FSHR if the target only supports one of them

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 02:57:19 PDT 2020


foad created this revision.
foad added reviewers: bjope, arsenm, RKSimon, lebedev.ri.
Herald added subscribers: llvm-commits, kerbowa, hiraditya, tpr, nhaehnle, jvesely.
Herald added a project: LLVM.
foad requested review of this revision.
Herald added a subscriber: wdng.

D77152 <https://reviews.llvm.org/D77152> tried to do this but got it wrong in the shift-by-zero case.
D86430 <https://reviews.llvm.org/D86430> reverted the wrong code. Reimplement the optimization with
different code depending on whether the shift amount is known to be
non-zero (modulo bitwidth).

This improves code quality for fshl tests on AMDGPU, which only has an
fshr instruction.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86438

Files:
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/test/CodeGen/AMDGPU/fshl.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86438.287319.patch
Type: text/x-patch
Size: 19991 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200824/75c5a538/attachment.bin>


More information about the llvm-commits mailing list