[PATCH] D153202: [LSR] Return nullptr from getExpr if the result isn't invertible.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 17 09:48:34 PDT 2023


fhahn created this revision.
fhahn added reviewers: reames, nikic, efriedma, qcolombet, dmakogon.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
fhahn requested review of this revision.
Herald added a project: LLVM.

getExpr is missing a check to make sure the result is invertible.
This can lead to incorrect results, so return nullptr in those cases
like in other places in IVUsers.

Fixes #62660.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153202

Files:
  llvm/include/llvm/Analysis/IVUsers.h
  llvm/lib/Analysis/IVUsers.cpp
  llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
  llvm/test/Transforms/LoopStrengthReduce/X86/pr62660-normalization-failure.ll
  llvm/test/Transforms/LoopStrengthReduce/scaling-factor-incompat-type.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153202.532407.patch
Type: text/x-patch
Size: 5062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230617/879743e3/attachment.bin>


More information about the llvm-commits mailing list