[PATCH] D68831: [LV] Mark instructions with loop invariant arguments as uniform. (WIP)

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 13:46:17 PDT 2019


fhahn created this revision.
fhahn added reviewers: hsaito, rengolin, dcaballe, Ayal.
Herald added subscribers: rkruppe, hiraditya.
Herald added a project: LLVM.

As suggested by Ayal in D59995 <https://reviews.llvm.org/D59995>, we can mark instructions with
loop invariant arguments as uniform. They will always produce
the same result.

Now that we can have more uniform instructions, there were some
assertions that needed relaxing a bit.

Also, there still seems to be an issue with constant folding in LV not
being able to simplify some uniform values compared to their replicated
equivalents. I still have to look into that, but I wanted to make sure
the overall approach aligns well.

The overall impact of the change is probably quite low, but at least in
the test-suite, there are around 4 benchmarks were we ended up
vectorizing a few more loops.

Currently we still miss some uniform instructions, that only have
uniform operands, but that can be addressed as follow-up.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68831

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/AArch64/extractvalue-no-scalarization-required.ll
  llvm/test/Transforms/LoopVectorize/X86/assume.ll
  llvm/test/Transforms/LoopVectorize/X86/constant-fold.ll
  llvm/test/Transforms/LoopVectorize/X86/cost-model-assert.ll
  llvm/test/Transforms/LoopVectorize/X86/funclet.ll
  llvm/test/Transforms/LoopVectorize/X86/invariant-load-gather.ll
  llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
  llvm/test/Transforms/LoopVectorize/X86/load-deref-pred.ll
  llvm/test/Transforms/LoopVectorize/first-order-recurrence.ll
  llvm/test/Transforms/LoopVectorize/no_outside_user.ll
  llvm/test/Transforms/LoopVectorize/pr32859.ll
  llvm/test/Transforms/LoopVectorize/vector-intrinsic-call-cost.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68831.224463.patch
Type: text/x-patch
Size: 69350 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191010/f9f967ed/attachment.bin>


More information about the llvm-commits mailing list