[LSR] Fix bug for optimizing unused IVs to final values
authorZaara Syeda <syzaara@ca.ibm.com>
Tue, 5 Jul 2022 16:16:08 +0000 (12:16 -0400)
committerZaara Syeda <syzaara@ca.ibm.com>
Tue, 5 Jul 2022 16:30:58 +0000 (12:30 -0400)
commitdbf6ab5ef9ae0e1f4706917c2b3f98a67c35826e
tree65be081b0d25ca8f136299116fd92dd6570eceed
parentb8dbc6ffea93976dc0d8569c9d23e9c21e33e317
[LSR] Fix bug for optimizing unused IVs to final values

This is a fix for a crash reported for https://reviews.llvm.org/D118808
The fix is to only consider PHINodes which are induction phis.
Fixes #55529

Differential Revision: https://reviews.llvm.org/D125990
llvm/include/llvm/Transforms/Utils/LoopUtils.h
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
llvm/lib/Transforms/Utils/LoopUtils.cpp
llvm/test/Transforms/LoopStrengthReduce/remove_scev_indvars.ll