[PATCH] D113024: [IndVars] Pass TTI to replaceCongruentIVs

Dmitry Makogon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 2 08:24:53 PDT 2021


dmakogon created this revision.
dmakogon added reviewers: mkazantsev, nikic, lebedev.ri, fhahn.
Herald added a subscriber: hiraditya.
dmakogon requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In IndVarSimplify after simplifying and extending loop IVs we call `replaceCongruentIVs()` function.
This function optionally takes a TTI argument in order to be able to replace narrow IVs uses with truncates of the widest one.
For some reason the TTI wasn't passed to the function in IndVars pass, so it couldn't perform such
transform. 
This patch fixes it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113024

Files:
  llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
  llvm/test/Transforms/IndVarSimplify/X86/pr27133.ll
  llvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll
  llvm/test/Transforms/LoopVectorize/X86/gather_scatter.ll
  llvm/test/Transforms/PhaseOrdering/X86/pixel-splat.ll
  llvm/test/Transforms/PhaseOrdering/X86/vdiv.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113024.384115.patch
Type: text/x-patch
Size: 244602 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211102/5a62f255/attachment-0001.bin>


More information about the llvm-commits mailing list