[PATCH] D66287: GlobalISel: add combiner for indexed loads and stores

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 04:46:20 PDT 2019


t.p.northover created this revision.
t.p.northover added reviewers: aemerson, dsanders.
Herald added subscribers: Petar.Avramovic, volkan, arphaman, hiraditya, javed.absar, rovka, mcrosier.
Herald added a project: LLVM.

The goal here is to implement a roughly equivalent combiner to the DAG one. There are still a few edge-cases we miss, but those are all heuristics rather than correctness issues so probably not essential to begin with. See the FIXMEs for details.

The main intentional difference over the DAG situation is that `PRE_DEC` and `POST_DEC` didn't really seem relevant since address computations are carried out via `G_GEP` rather than add/sub. Therefore we just have pre/post indexed and a target will be expected to inspect the operands for negativity if it matters.

Since this doesn't add any real target support, testing is via a special option that overrides any legality claims the target might make. When there is enough target support that can be removed.

The other thing that might be worth thinking about is the proliferation of generic load/store instructions. I decided this didn't bother me particularly since indexed operations tend to be selected by C++ code anyway, but the combinatorial multiplication would be a bit annoying if TableGen had to cope too.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66287

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/include/llvm/Support/TargetOpcodes.def
  llvm/include/llvm/Target/GenericOpcodes.td
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/combiner-load-store-indexing.ll
  llvm/test/CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll
  llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir
  llvm/test/CodeGen/AArch64/O0-pipeline.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66287.215368.patch
Type: text/x-patch
Size: 27261 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190815/8dd3fb58/attachment.bin>


More information about the llvm-commits mailing list