[IVUsers] Check getExpr result in findAddRecForLoop.
authorFlorian Hahn <flo@fhahn.com>
Thu, 20 Jul 2023 13:56:18 +0000 (14:56 +0100)
committerFlorian Hahn <flo@fhahn.com>
Thu, 20 Jul 2023 13:56:19 +0000 (14:56 +0100)
commit3ba3ea3c0695547c2adb3cdf63528cb54270ff45
treef62b1aeda344a5f991258692289d42451cc87dde
parent794928b022e9432b3dd16ada2e71579b6532f15f
[IVUsers] Check getExpr result in findAddRecForLoop.

This fixes a crash if the SCEV for the use isn't invertible and nullptr
is returned.

Fixes https://github.com/llvm/llvm-project/issues/63840
llvm/lib/Analysis/IVUsers.cpp
llvm/test/Transforms/LoopStrengthReduce/X86/pr62660-normalization-failure.ll