From 832254e1c2387c0cbeb0a820b8315fbe85cb003a Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Fri, 2 Feb 2007 02:16:23 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33776 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/ConstantFolding.cpp | 4 ---- lib/Analysis/IPA/Andersens.cpp | 3 --- lib/Analysis/ScalarEvolution.cpp | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) (limited to 'lib/Analysis') diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index 1bf6b50..25a64ab 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/lib/Analysis/ConstantFolding.cpp @@ -216,10 +216,6 @@ Constant *llvm::ConstantFoldInstOperands(const Instruction* I, case Instruction::FCmp: return ConstantExpr::getCompare(cast(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/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp index b6855f6..aa2188b 100644 --- a/lib/Analysis/IPA/Andersens.cpp +++ b/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/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 75dabf7..a81f24f 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/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(I) || isa(I) || isa(I) || + if (isa(I) || isa(I) || isa(I) || isa(I) || isa(I)) return true; -- cgit v1.1