1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

- Use correct header for SCEV inside LoopPass.cpp

- Move SCEVExpander::expand() out-of-line workarounding possible toolchain bug

llvm-svn: 41197
This commit is contained in:
Anton Korobeynikov 2007-08-20 21:17:26 +00:00
parent b6ebf8cbf3
commit 4e15adaf04
3 changed files with 15 additions and 12 deletions

View File

@ -93,16 +93,7 @@ namespace llvm {
static Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS,
Value *RHS, Instruction *&InsertPt);
protected:
Value *expand(SCEV *S) {
// Check to see if we already expanded this.
std::map<SCEVHandle, Value*>::iterator I = InsertedExpressions.find(S);
if (I != InsertedExpressions.end())
return I->second;
Value *V = visit(S);
InsertedExpressions[S] = V;
return V;
}
Value *expand(SCEV *S);
Value *visitConstant(SCEVConstant *S) {
return S->getValue();

View File

@ -14,7 +14,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/ScalarEvolutionExpander.h"
#include "llvm/Analysis/ScalarEvolution.h"
using namespace llvm;
//===----------------------------------------------------------------------===//

View File

@ -207,3 +207,15 @@ Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) {
return expand(V);
}
Value *SCEVExpander::expand(SCEV *S) {
// Check to see if we already expanded this.
std::map<SCEVHandle, Value*>::iterator I = InsertedExpressions.find(S);
if (I != InsertedExpressions.end())
return I->second;
Value *V = visit(S);
InsertedExpressions[S] = V;
return V;
}