Incorporate the insertion point into the key of SCEVExpander's CSE map.
authorDan Gohman <gohman@apple.com>
Fri, 26 Jun 2009 22:53:46 +0000 (22:53 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 26 Jun 2009 22:53:46 +0000 (22:53 +0000)
commit667d787c0a21cf3f5dfcde03ca471162ba35b614
tree717e8620e15b156cca07901a296ab52ea05ac3c5
parentacec7b35aa031a98dcd9ab9263445d1008ee60e5
Incorporate the insertion point into the key of SCEVExpander's CSE map.
This helps it avoid reusing an instruction that doesn't dominate all
of the users, in cases where the original instruction was inserted
before all of the users were known.  This may result in redundant
expansions of sub-expressions that depend on loop-unpredictable values
in some cases, however this isn't very common, and it primarily impacts
IndVarSimplify, so GVN can be expected to clean these up.

This eliminates the need for IndVarSimplify's FixUsesBeforeDefs,
which fixes several bugs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74352 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ScalarEvolutionExpander.h
lib/Analysis/ScalarEvolutionExpander.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp