[PATCH] D116696: [SCEVExpand] Do not create redundant 'or false' for pred expansion.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 5 13:28:34 PST 2022


fhahn created this revision.
fhahn added reviewers: reames, nikic, lebedev.ri, mkazantsev.
Herald added subscribers: dmgreen, javed.absar, hiraditya.
fhahn requested review of this revision.
Herald added a project: LLVM.

This patch updates SCEVExpander::expandWrapPredicate to not create
redundant 'or false, x' instructions. While those are trivially
foldable, they can be easily avoided and hinder code that checks the
size/cost of the generated checks before further folds.

I am planning on look into a few other similar improvements to code
generated by SCEVExpander.

I remember a while ago @lebedev.ri working on doing some trivial folds
like that in IRBuilder itself, but there where concerns that such
changes may subtly break existing code. AFAIK this effort is not active
any longer?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116696

Files:
  llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
  llvm/test/Transforms/LoopDistribute/scev-inserted-runtime-check.ll
  llvm/test/Transforms/LoopVectorize/ARM/mve-gather-scatter-tailpred.ll
  llvm/test/Transforms/LoopVectorize/X86/illegal-parallel-loop-uniform-write.ll
  llvm/test/Transforms/LoopVectorize/X86/pr35432.ll
  llvm/test/Transforms/LoopVectorize/first-order-recurrence-complex.ll
  llvm/test/Transforms/LoopVectorize/induction.ll
  llvm/test/Transforms/LoopVectorize/pr30654-phiscev-sext-trunc.ll
  llvm/test/Transforms/LoopVectorize/pr45259.ll
  llvm/test/Transforms/LoopVectorize/runtime-check-needed-but-empty.ll
  llvm/test/Transforms/LoopVectorize/runtime-check-small-clamped-bounds.ll
  llvm/test/Transforms/LoopVersioning/wrapping-pointer-versioning.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116696.397698.patch
Type: text/x-patch
Size: 28050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220105/4379fc30/attachment.bin>


More information about the llvm-commits mailing list