Skip to content

Commit 0fc6213

Browse files
authored
[LV] Clarify nature of legacy CSE (NFC) (#160855)
In order to avoid conflating the legacy CSE with the VPlan-based one, rename the legacy CSE and insert a FIXME to clarify the nature of the legacy CSE.
1 parent ddfbfd6 commit 0fc6213

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,8 +2438,9 @@ struct CSEDenseMapInfo {
24382438

24392439
} // end anonymous namespace
24402440

2441-
///Perform cse of induction variable instructions.
2442-
static void cse(BasicBlock *BB) {
2441+
/// FIXME: This legacy common-subexpression-elimination routine is scheduled for
2442+
/// removal, in favor of the VPlan-based one.
2443+
static void legacyCSE(BasicBlock *BB) {
24432444
// Perform simple cse.
24442445
SmallDenseMap<Instruction *, Instruction *, 4, CSEDenseMapInfo> CSEMap;
24452446
for (Instruction &In : llvm::make_early_inc_range(*BB)) {
@@ -2543,7 +2544,7 @@ void InnerLoopVectorizer::fixVectorizedLoop(VPTransformState &State) {
25432544
BasicBlock *HeaderBB = State.CFG.VPBB2IRBB[HeaderVPBB];
25442545

25452546
// Remove redundant induction instructions.
2546-
cse(HeaderBB);
2547+
legacyCSE(HeaderBB);
25472548
}
25482549

25492550
void InnerLoopVectorizer::fixNonInductionPHIs(VPTransformState &State) {

0 commit comments

Comments
 (0)