summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-02 02:16:23 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-02 02:16:23 +0000
commit2341c22ec71aed773101eef6bc725df2047e5154 (patch)
tree453d820479bbe83769e54e01abc702ac8ef71312 /llvm/lib/Analysis
parent48b094d9ddbca690da41f5711d8e1fcb46c50e05 (diff)
downloadbcm5719-llvm-2341c22ec71aed773101eef6bc725df2047e5154.tar.gz
bcm5719-llvm-2341c22ec71aed773101eef6bc725df2047e5154.zip
Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. llvm-svn: 33776
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp4
-rw-r--r--llvm/lib/Analysis/IPA/Andersens.cpp3
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp2
3 files changed, 1 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 1bf6b50333e..25a64ab9a68 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -216,10 +216,6 @@ Constant *llvm::ConstantFoldInstOperands(const Instruction* I,
case Instruction::FCmp:
return ConstantExpr::getCompare(cast<CmpInst>(I)->getPredicate(), Ops[0],
Ops[1]);
- case Instruction::Shl:
- case Instruction::LShr:
- case Instruction::AShr:
- return ConstantExpr::get(Opc, Ops[0], Ops[1]);
case Instruction::Trunc:
case Instruction::ZExt:
case Instruction::SExt:
diff --git a/llvm/lib/Analysis/IPA/Andersens.cpp b/llvm/lib/Analysis/IPA/Andersens.cpp
index b6855f65030..aa2188bc951 100644
--- a/llvm/lib/Analysis/IPA/Andersens.cpp
+++ b/llvm/lib/Analysis/IPA/Andersens.cpp
@@ -776,9 +776,6 @@ void Andersens::visitInstruction(Instruction &I) {
case Instruction::Unwind:
case Instruction::Unreachable:
case Instruction::Free:
- case Instruction::Shl:
- case Instruction::LShr:
- case Instruction::AShr:
case Instruction::ICmp:
case Instruction::FCmp:
return;
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 75dabf7cadc..a81f24f117f 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -1736,7 +1736,7 @@ ComputeLoadConstantCompareIterationCount(LoadInst *LI, Constant *RHS,
/// CanConstantFold - Return true if we can constant fold an instruction of the
/// specified type, assuming that all operands were constants.
static bool CanConstantFold(const Instruction *I) {
- if (isa<BinaryOperator>(I) || isa<ShiftInst>(I) || isa<CmpInst>(I) ||
+ if (isa<BinaryOperator>(I) || isa<CmpInst>(I) ||
isa<SelectInst>(I) || isa<CastInst>(I) || isa<GetElementPtrInst>(I))
return true;
OpenPOWER on IntegriCloud