[LSR] Create SCEVExpander earlier, use member isSafeToExpand() (NFC)
authorNikita Popov <npopov@redhat.com>
Thu, 14 Jul 2022 13:20:13 +0000 (15:20 +0200)
committerNikita Popov <npopov@redhat.com>
Fri, 15 Jul 2022 07:41:23 +0000 (09:41 +0200)
commitf75ccadcdd87328b946e43c8e88ccf3c8188ff4f
tree0136507f275962b4edf2c7fa328e66f7acbe8cc4
parent9510d5971eee79be481596a702bf2a3e232c30f3
[LSR] Create SCEVExpander earlier, use member isSafeToExpand() (NFC)

This is a followup to D129630, which switches LSR to the member
isSafeToExpand() variant, and removes the freestanding function.

This is done by creating the SCEVExpander early (already during the
analysis phase). Because the SCEVExpander is now available for the
whole lifetime of LSRInstance, I've also made it into a member
variable, rather than passing it around in even more places.

Differential Revision: https://reviews.llvm.org/D129769
llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp