aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-06-22 19:09:18 +0000
committerDan Gohman <gohman@apple.com>2008-06-22 19:09:18 +0000
commit11f6d3b478c4fa09d126833c57fbac1d795ead31 (patch)
treeadf1a365cecf929a6e38840a7c6118ddecec2b01 /lib
parent963a97f1a365c8d09ca681e922371f9ec3473ee8 (diff)
downloadexternal_llvm-11f6d3b478c4fa09d126833c57fbac1d795ead31.zip
external_llvm-11f6d3b478c4fa09d126833c57fbac1d795ead31.tar.gz
external_llvm-11f6d3b478c4fa09d126833c57fbac1d795ead31.tar.bz2
Move a few more SCEVExpander methods out-of-line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52612 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/ScalarEvolutionExpander.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp
index e32b21e..07850f7 100644
--- a/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -226,6 +226,21 @@ Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) {
return expand(V);
}
+Value *SCEVExpander::visitTruncateExpr(SCEVTruncateExpr *S) {
+ Value *V = expand(S->getOperand());
+ return CastInst::createTruncOrBitCast(V, S->getType(), "tmp.", InsertPt);
+}
+
+Value *SCEVExpander::visitZeroExtendExpr(SCEVZeroExtendExpr *S) {
+ Value *V = expand(S->getOperand());
+ return CastInst::createZExtOrBitCast(V, S->getType(), "tmp.", InsertPt);
+}
+
+Value *SCEVExpander::visitSignExtendExpr(SCEVSignExtendExpr *S) {
+ Value *V = expand(S->getOperand());
+ return CastInst::createSExtOrBitCast(V, S->getType(), "tmp.", InsertPt);
+}
+
Value *SCEVExpander::visitSMaxExpr(SCEVSMaxExpr *S) {
Value *LHS = expand(S->getOperand(0));
for (unsigned i = 1; i < S->getNumOperands(); ++i) {
@@ -246,6 +261,12 @@ Value *SCEVExpander::visitUMaxExpr(SCEVUMaxExpr *S) {
return LHS;
}
+Value *SCEVExpander::expandCodeFor(SCEVHandle SH, Instruction *IP) {
+ // Expand the code for this SCEV.
+ this->InsertPt = IP;
+ return expand(SH);
+}
+
Value *SCEVExpander::expand(SCEV *S) {
// Check to see if we already expanded this.
std::map<SCEVHandle, Value*>::iterator I = InsertedExpressions.find(S);