aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-10-19 04:27:49 +0000
committerNadav Rotem <nrotem@apple.com>2012-10-19 04:27:49 +0000
commit4985ddc5e011a9ebde17788fb49d603dcc36aa19 (patch)
tree9579d76edecda619dd45c6809a2a8161a655077a /llvm/lib/Analysis/ScalarEvolutionExpander.cpp
parente9c233b1c59a087bd44862e726e691605e9f53d1 (diff)
downloadllvm-4985ddc5e011a9ebde17788fb49d603dcc36aa19.zip
llvm-4985ddc5e011a9ebde17788fb49d603dcc36aa19.tar.gz
llvm-4985ddc5e011a9ebde17788fb49d603dcc36aa19.tar.bz2
recommit the patch that makes LSR and LowerInvoke use the TargetTransform interface.
llvm-svn: 166264
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index 5e05f4c..5c2a49e 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -19,8 +19,8 @@
#include "llvm/LLVMContext.h"
#include "llvm/Support/Debug.h"
#include "llvm/DataLayout.h"
-#include "llvm/Target/TargetLowering.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/TargetTransformInfo.h"
using namespace llvm;
@@ -1599,15 +1599,15 @@ static bool width_descending(Value *lhs, Value *rhs) {
/// This does not depend on any SCEVExpander state but should be used in
/// the same context that SCEVExpander is used.
unsigned SCEVExpander::replaceCongruentIVs(Loop *L, const DominatorTree *DT,
- SmallVectorImpl<WeakVH> &DeadInsts,
- const TargetLowering *TLI) {
+ SmallVectorImpl<WeakVH> &DeadInsts,
+ const ScalarTargetTransformInfo *STTI) {
// Find integer phis in order of increasing width.
SmallVector<PHINode*, 8> Phis;
for (BasicBlock::iterator I = L->getHeader()->begin();
PHINode *Phi = dyn_cast<PHINode>(I); ++I) {
Phis.push_back(Phi);
}
- if (TLI)
+ if (STTI)
std::sort(Phis.begin(), Phis.end(), width_descending);
unsigned NumElim = 0;
@@ -1624,8 +1624,8 @@ unsigned SCEVExpander::replaceCongruentIVs(Loop *L, const DominatorTree *DT,
PHINode *&OrigPhiRef = ExprToIVMap[SE.getSCEV(Phi)];
if (!OrigPhiRef) {
OrigPhiRef = Phi;
- if (Phi->getType()->isIntegerTy() && TLI
- && TLI->isTruncateFree(Phi->getType(), Phis.back()->getType())) {
+ if (Phi->getType()->isIntegerTy() && STTI &&
+ STTI->isTruncateFree(Phi->getType(), Phis.back()->getType())) {
// This phi can be freely truncated to the narrowest phi type. Map the
// truncated expression to it so it will be reused for narrow types.
const SCEV *TruncExpr =