[llvm-commits] [llvm] r51147 - in /llvm/branches/ggreif/use-diet: examples/Fibonacci/ examples/HowToUseJIT/ examples/ModuleMaker/ examples/ParallelJIT/ include/llvm/ include/llvm/Analysis/ include/llvm/Support/ lib/Analysis/ lib/AsmParser/ lib/Bitcode/Reader/ lib/CodeGen/ lib/Target/CppBackend/ lib/Transforms/IPO/ lib/Transforms/Instrumentation/ lib/Transforms/Scalar/ lib/Transforms/Utils/ lib/VMCore/
Gabor Greif
ggreif at gmail.com
Thu May 15 06:08:17 PDT 2008
Author: ggreif
Date: Thu May 15 08:08:16 2008
New Revision: 51147
URL: http://llvm.org/viewvc/llvm-project?rev=51147&view=rev
Log:
API change: BinaryOperator::create -> Create (CmpInst, CastInst too)
Modified:
llvm/branches/ggreif/use-diet/examples/Fibonacci/fibonacci.cpp
llvm/branches/ggreif/use-diet/examples/HowToUseJIT/HowToUseJIT.cpp
llvm/branches/ggreif/use-diet/examples/ModuleMaker/ModuleMaker.cpp
llvm/branches/ggreif/use-diet/examples/ParallelJIT/ParallelJIT.cpp
llvm/branches/ggreif/use-diet/include/llvm/Analysis/ScalarEvolutionExpander.h
llvm/branches/ggreif/use-diet/include/llvm/InstrTypes.h
llvm/branches/ggreif/use-diet/include/llvm/Support/IRBuilder.h
llvm/branches/ggreif/use-diet/lib/Analysis/ScalarEvolutionExpander.cpp
llvm/branches/ggreif/use-diet/lib/AsmParser/llvmAsmParser.y
llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/branches/ggreif/use-diet/lib/CodeGen/IntrinsicLowering.cpp
llvm/branches/ggreif/use-diet/lib/Target/CppBackend/CPPBackend.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalOpt.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IndMemRemoval.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/IPO/RaiseAllocations.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/ProfilingUtils.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/RSProfiling.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/CodeGenPrepare.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/GVNPRE.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/LoopIndexSplit.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/MemCpyOptimizer.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/Reassociate.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/Reg2Mem.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/ScalarReplAggregates.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LowerAllocations.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LowerSwitch.cpp
llvm/branches/ggreif/use-diet/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/branches/ggreif/use-diet/lib/VMCore/AutoUpgrade.cpp
llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp
Modified: llvm/branches/ggreif/use-diet/examples/Fibonacci/fibonacci.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/examples/Fibonacci/fibonacci.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/examples/Fibonacci/fibonacci.cpp (original)
+++ llvm/branches/ggreif/use-diet/examples/Fibonacci/fibonacci.cpp Thu May 15 08:08:16 2008
@@ -66,18 +66,18 @@
ReturnInst::Create(One, RetBB);
// create fib(x-1)
- Value *Sub = BinaryOperator::createSub(ArgX, One, "arg", RecurseBB);
+ Value *Sub = BinaryOperator::CreateSub(ArgX, One, "arg", RecurseBB);
CallInst *CallFibX1 = CallInst::Create(FibF, Sub, "fibx1", RecurseBB);
CallFibX1->setTailCall();
// create fib(x-2)
- Sub = BinaryOperator::createSub(ArgX, Two, "arg", RecurseBB);
+ Sub = BinaryOperator::CreateSub(ArgX, Two, "arg", RecurseBB);
CallInst *CallFibX2 = CallInst::Create(FibF, Sub, "fibx2", RecurseBB);
CallFibX2->setTailCall();
// fib(x-1)+fib(x-2)
- Value *Sum = BinaryOperator::createAdd(CallFibX1, CallFibX2,
+ Value *Sum = BinaryOperator::CreateAdd(CallFibX1, CallFibX2,
"addresult", RecurseBB);
// Create the return instruction and add it to the basic block
Modified: llvm/branches/ggreif/use-diet/examples/HowToUseJIT/HowToUseJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/examples/HowToUseJIT/HowToUseJIT.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/examples/HowToUseJIT/HowToUseJIT.cpp (original)
+++ llvm/branches/ggreif/use-diet/examples/HowToUseJIT/HowToUseJIT.cpp Thu May 15 08:08:16 2008
@@ -69,7 +69,7 @@
ArgX->setName("AnArg"); // Give it a nice symbolic name for fun.
// Create the add instruction, inserting it into the end of BB.
- Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB);
+ Instruction *Add = BinaryOperator::CreateAdd(One, ArgX, "addresult", BB);
// Create the return instruction and add it to the basic block
ReturnInst::Create(Add, BB);
Modified: llvm/branches/ggreif/use-diet/examples/ModuleMaker/ModuleMaker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/examples/ModuleMaker/ModuleMaker.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/examples/ModuleMaker/ModuleMaker.cpp (original)
+++ llvm/branches/ggreif/use-diet/examples/ModuleMaker/ModuleMaker.cpp Thu May 15 08:08:16 2008
@@ -43,7 +43,7 @@
Value *Three = ConstantInt::get(Type::Int32Ty, 3);
// Create the add instruction... does not insert...
- Instruction *Add = BinaryOperator::create(Instruction::Add, Two, Three,
+ Instruction *Add = BinaryOperator::Create(Instruction::Add, Two, Three,
"addresult");
// explicitly insert it into the basic block...
Modified: llvm/branches/ggreif/use-diet/examples/ParallelJIT/ParallelJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/examples/ParallelJIT/ParallelJIT.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/examples/ParallelJIT/ParallelJIT.cpp (original)
+++ llvm/branches/ggreif/use-diet/examples/ParallelJIT/ParallelJIT.cpp Thu May 15 08:08:16 2008
@@ -50,7 +50,7 @@
ArgX->setName("AnArg"); // Give it a nice symbolic name for fun.
// Create the add instruction, inserting it into the end of BB.
- Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB);
+ Instruction *Add = BinaryOperator::CreateAdd(One, ArgX, "addresult", BB);
// Create the return instruction and add it to the basic block
ReturnInst::Create(Add, BB);
@@ -90,16 +90,16 @@
ReturnInst::Create(One, RetBB);
// create fib(x-1)
- Value *Sub = BinaryOperator::createSub(ArgX, One, "arg", RecurseBB);
+ Value *Sub = BinaryOperator::CreateSub(ArgX, One, "arg", RecurseBB);
Value *CallFibX1 = CallInst::Create(FibF, Sub, "fibx1", RecurseBB);
// create fib(x-2)
- Sub = BinaryOperator::createSub(ArgX, Two, "arg", RecurseBB);
+ Sub = BinaryOperator::CreateSub(ArgX, Two, "arg", RecurseBB);
Value *CallFibX2 = CallInst::Create(FibF, Sub, "fibx2", RecurseBB);
// fib(x-1)+fib(x-2)
Value *Sum =
- BinaryOperator::createAdd(CallFibX1, CallFibX2, "addresult", RecurseBB);
+ BinaryOperator::CreateAdd(CallFibX1, CallFibX2, "addresult", RecurseBB);
// Create the return instruction and add it to the basic block
ReturnInst::Create(Sum, RecurseBB);
Modified: llvm/branches/ggreif/use-diet/include/llvm/Analysis/ScalarEvolutionExpander.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Analysis/ScalarEvolutionExpander.h?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/Analysis/ScalarEvolutionExpander.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/Analysis/ScalarEvolutionExpander.h Thu May 15 08:08:16 2008
@@ -101,17 +101,17 @@
Value *visitTruncateExpr(SCEVTruncateExpr *S) {
Value *V = expand(S->getOperand());
- return CastInst::createTruncOrBitCast(V, S->getType(), "tmp.", InsertPt);
+ return CastInst::CreateTruncOrBitCast(V, S->getType(), "tmp.", InsertPt);
}
Value *visitZeroExtendExpr(SCEVZeroExtendExpr *S) {
Value *V = expand(S->getOperand());
- return CastInst::createZExtOrBitCast(V, S->getType(), "tmp.", InsertPt);
+ return CastInst::CreateZExtOrBitCast(V, S->getType(), "tmp.", InsertPt);
}
Value *visitSignExtendExpr(SCEVSignExtendExpr *S) {
Value *V = expand(S->getOperand());
- return CastInst::createSExtOrBitCast(V, S->getType(), "tmp.", InsertPt);
+ return CastInst::CreateSExtOrBitCast(V, S->getType(), "tmp.", InsertPt);
}
Value *visitAddExpr(SCEVAddExpr *S) {
Modified: llvm/branches/ggreif/use-diet/include/llvm/InstrTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/InstrTypes.h?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/InstrTypes.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/InstrTypes.h Thu May 15 08:08:16 2008
@@ -152,42 +152,42 @@
/// Transparently provide more efficient getOperand methods.
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
- /// create() - Construct a binary instruction, given the opcode and the two
+ /// Create() - Construct a binary instruction, given the opcode and the two
/// operands. Optionally (if InstBefore is specified) insert the instruction
/// into a BasicBlock right before the specified instruction. The specified
/// Instruction is allowed to be a dereferenced end iterator.
///
- static BinaryOperator *create(BinaryOps Op, Value *S1, Value *S2,
+ static BinaryOperator *Create(BinaryOps Op, Value *S1, Value *S2,
const std::string &Name = "",
Instruction *InsertBefore = 0);
- /// create() - Construct a binary instruction, given the opcode and the two
+ /// Create() - Construct a binary instruction, given the opcode and the two
/// operands. Also automatically insert this instruction to the end of the
/// BasicBlock specified.
///
- static BinaryOperator *create(BinaryOps Op, Value *S1, Value *S2,
+ static BinaryOperator *Create(BinaryOps Op, Value *S1, Value *S2,
const std::string &Name,
BasicBlock *InsertAtEnd);
- /// create* - These methods just forward to create, and are useful when you
+ /// Create* - These methods just forward to create, and are useful when you
/// statically know what type of instruction you're going to create. These
/// helpers just save some typing.
#define HANDLE_BINARY_INST(N, OPC, CLASS) \
- static BinaryOperator *create##OPC(Value *V1, Value *V2, \
+ static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
const std::string &Name = "") {\
- return create(Instruction::OPC, V1, V2, Name);\
+ return Create(Instruction::OPC, V1, V2, Name);\
}
#include "llvm/Instruction.def"
#define HANDLE_BINARY_INST(N, OPC, CLASS) \
- static BinaryOperator *create##OPC(Value *V1, Value *V2, \
+ static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
const std::string &Name, BasicBlock *BB) {\
- return create(Instruction::OPC, V1, V2, Name, BB);\
+ return Create(Instruction::OPC, V1, V2, Name, BB);\
}
#include "llvm/Instruction.def"
#define HANDLE_BINARY_INST(N, OPC, CLASS) \
- static BinaryOperator *create##OPC(Value *V1, Value *V2, \
+ static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
const std::string &Name, Instruction *I) {\
- return create(Instruction::OPC, V1, V2, Name, I);\
+ return Create(Instruction::OPC, V1, V2, Name, I);\
}
#include "llvm/Instruction.def"
@@ -195,16 +195,16 @@
/// Helper functions to construct and inspect unary operations (NEG and NOT)
/// via binary operators SUB and XOR:
///
- /// createNeg, createNot - Create the NEG and NOT
+ /// CreateNeg, CreateNot - Create the NEG and NOT
/// instructions out of SUB and XOR instructions.
///
- static BinaryOperator *createNeg(Value *Op, const std::string &Name = "",
+ static BinaryOperator *CreateNeg(Value *Op, const std::string &Name = "",
Instruction *InsertBefore = 0);
- static BinaryOperator *createNeg(Value *Op, const std::string &Name,
+ static BinaryOperator *CreateNeg(Value *Op, const std::string &Name,
BasicBlock *InsertAtEnd);
- static BinaryOperator *createNot(Value *Op, const std::string &Name = "",
+ static BinaryOperator *CreateNot(Value *Op, const std::string &Name = "",
Instruction *InsertBefore = 0);
- static BinaryOperator *createNot(Value *Op, const std::string &Name,
+ static BinaryOperator *CreateNot(Value *Op, const std::string &Name,
BasicBlock *InsertAtEnd);
/// isNeg, isNot - Check if the given Value is a NEG or NOT instruction.
@@ -286,7 +286,7 @@
/// constructor has insert-before-instruction semantics to automatically
/// insert the new CastInst before InsertBefore (if it is non-null).
/// @brief Construct any of the CastInst subclasses
- static CastInst *create(
+ static CastInst *Create(
Instruction::CastOps, ///< The opcode of the cast instruction
Value *S, ///< The value to be casted (operand 0)
const Type *Ty, ///< The type to which cast should be made
@@ -299,7 +299,7 @@
/// to automatically insert the new CastInst at the end of InsertAtEnd (if
/// its non-null).
/// @brief Construct any of the CastInst subclasses
- static CastInst *create(
+ static CastInst *Create(
Instruction::CastOps, ///< The opcode for the cast instruction
Value *S, ///< The value to be casted (operand 0)
const Type *Ty, ///< The type to which operand is casted
@@ -308,7 +308,7 @@
);
/// @brief Create a ZExt or BitCast cast instruction
- static CastInst *createZExtOrBitCast(
+ static CastInst *CreateZExtOrBitCast(
Value *S, ///< The value to be casted (operand 0)
const Type *Ty, ///< The type to which cast should be made
const std::string &Name = "", ///< Name for the instruction
@@ -316,7 +316,7 @@
);
/// @brief Create a ZExt or BitCast cast instruction
- static CastInst *createZExtOrBitCast(
+ static CastInst *CreateZExtOrBitCast(
Value *S, ///< The value to be casted (operand 0)
const Type *Ty, ///< The type to which operand is casted
const std::string &Name, ///< The name for the instruction
@@ -324,7 +324,7 @@
);
/// @brief Create a SExt or BitCast cast instruction
- static CastInst *createSExtOrBitCast(
+ static CastInst *CreateSExtOrBitCast(
Value *S, ///< The value to be casted (operand 0)
const Type *Ty, ///< The type to which cast should be made
const std::string &Name = "", ///< Name for the instruction
@@ -332,7 +332,7 @@
);
/// @brief Create a BitCast or a PtrToInt cast instruction
- static CastInst *createPointerCast(
+ static CastInst *CreatePointerCast(
Value *S, ///< The pointer value to be casted (operand 0)
const Type *Ty, ///< The type to which operand is casted
const std::string &Name, ///< The name for the instruction
@@ -340,7 +340,7 @@
);
/// @brief Create a BitCast or a PtrToInt cast instruction
- static CastInst *createPointerCast(
+ static CastInst *CreatePointerCast(
Value *S, ///< The pointer value to be casted (operand 0)
const Type *Ty, ///< The type to which cast should be made
const std::string &Name = "", ///< Name for the instruction
@@ -348,7 +348,7 @@
);
/// @brief Create a ZExt, BitCast, or Trunc for int -> int casts.
- static CastInst *createIntegerCast(
+ static CastInst *CreateIntegerCast(
Value *S, ///< The pointer value to be casted (operand 0)
const Type *Ty, ///< The type to which cast should be made
bool isSigned, ///< Whether to regard S as signed or not
@@ -357,7 +357,7 @@
);
/// @brief Create a ZExt, BitCast, or Trunc for int -> int casts.
- static CastInst *createIntegerCast(
+ static CastInst *CreateIntegerCast(
Value *S, ///< The integer value to be casted (operand 0)
const Type *Ty, ///< The integer type to which operand is casted
bool isSigned, ///< Whether to regard S as signed or not
@@ -366,7 +366,7 @@
);
/// @brief Create an FPExt, BitCast, or FPTrunc for fp -> fp casts
- static CastInst *createFPCast(
+ static CastInst *CreateFPCast(
Value *S, ///< The floating point value to be casted
const Type *Ty, ///< The floating point type to cast to
const std::string &Name = "", ///< Name for the instruction
@@ -374,7 +374,7 @@
);
/// @brief Create an FPExt, BitCast, or FPTrunc for fp -> fp casts
- static CastInst *createFPCast(
+ static CastInst *CreateFPCast(
Value *S, ///< The floating point value to be casted
const Type *Ty, ///< The floating point type to cast to
const std::string &Name, ///< The name for the instruction
@@ -382,7 +382,7 @@
);
/// @brief Create a SExt or BitCast cast instruction
- static CastInst *createSExtOrBitCast(
+ static CastInst *CreateSExtOrBitCast(
Value *S, ///< The value to be casted (operand 0)
const Type *Ty, ///< The type to which operand is casted
const std::string &Name, ///< The name for the instruction
@@ -390,7 +390,7 @@
);
/// @brief Create a Trunc or BitCast cast instruction
- static CastInst *createTruncOrBitCast(
+ static CastInst *CreateTruncOrBitCast(
Value *S, ///< The value to be casted (operand 0)
const Type *Ty, ///< The type to which cast should be made
const std::string &Name = "", ///< Name for the instruction
@@ -398,7 +398,7 @@
);
/// @brief Create a Trunc or BitCast cast instruction
- static CastInst *createTruncOrBitCast(
+ static CastInst *CreateTruncOrBitCast(
Value *S, ///< The value to be casted (operand 0)
const Type *Ty, ///< The type to which operand is casted
const std::string &Name, ///< The name for the instruction
@@ -558,7 +558,7 @@
/// instruction into a BasicBlock right before the specified instruction.
/// The specified Instruction is allowed to be a dereferenced end iterator.
/// @brief Create a CmpInst
- static CmpInst *create(OtherOps Op, unsigned short predicate, Value *S1,
+ static CmpInst *Create(OtherOps Op, unsigned short predicate, Value *S1,
Value *S2, const std::string &Name = "",
Instruction *InsertBefore = 0);
@@ -566,7 +566,7 @@
/// two operands. Also automatically insert this instruction to the end of
/// the BasicBlock specified.
/// @brief Create a CmpInst
- static CmpInst *create(OtherOps Op, unsigned short predicate, Value *S1,
+ static CmpInst *Create(OtherOps Op, unsigned short predicate, Value *S1,
Value *S2, const std::string &Name,
BasicBlock *InsertAtEnd);
Modified: llvm/branches/ggreif/use-diet/include/llvm/Support/IRBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Support/IRBuilder.h?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/Support/IRBuilder.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/Support/IRBuilder.h Thu May 15 08:08:16 2008
@@ -149,103 +149,103 @@
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getAdd(LC, RC);
- return Insert(BinaryOperator::createAdd(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateAdd(LHS, RHS, Name));
}
Value *CreateSub(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getSub(LC, RC);
- return Insert(BinaryOperator::createSub(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateSub(LHS, RHS, Name));
}
Value *CreateMul(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getMul(LC, RC);
- return Insert(BinaryOperator::createMul(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateMul(LHS, RHS, Name));
}
Value *CreateUDiv(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getUDiv(LC, RC);
- return Insert(BinaryOperator::createUDiv(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateUDiv(LHS, RHS, Name));
}
Value *CreateSDiv(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getSDiv(LC, RC);
- return Insert(BinaryOperator::createSDiv(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateSDiv(LHS, RHS, Name));
}
Value *CreateFDiv(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getFDiv(LC, RC);
- return Insert(BinaryOperator::createFDiv(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateFDiv(LHS, RHS, Name));
}
Value *CreateURem(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getURem(LC, RC);
- return Insert(BinaryOperator::createURem(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateURem(LHS, RHS, Name));
}
Value *CreateSRem(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getSRem(LC, RC);
- return Insert(BinaryOperator::createSRem(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateSRem(LHS, RHS, Name));
}
Value *CreateFRem(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getFRem(LC, RC);
- return Insert(BinaryOperator::createFRem(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateFRem(LHS, RHS, Name));
}
Value *CreateShl(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getShl(LC, RC);
- return Insert(BinaryOperator::createShl(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateShl(LHS, RHS, Name));
}
Value *CreateLShr(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getLShr(LC, RC);
- return Insert(BinaryOperator::createLShr(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateLShr(LHS, RHS, Name));
}
Value *CreateAShr(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getAShr(LC, RC);
- return Insert(BinaryOperator::createAShr(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateAShr(LHS, RHS, Name));
}
Value *CreateAnd(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getAnd(LC, RC);
- return Insert(BinaryOperator::createAnd(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateAnd(LHS, RHS, Name));
}
Value *CreateOr(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getOr(LC, RC);
- return Insert(BinaryOperator::createOr(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateOr(LHS, RHS, Name));
}
Value *CreateXor(Value *LHS, Value *RHS, const char *Name = "") {
if (Constant *LC = dyn_cast<Constant>(LHS))
if (Constant *RC = dyn_cast<Constant>(RHS))
return ConstantExpr::getXor(LC, RC);
- return Insert(BinaryOperator::createXor(LHS, RHS, Name));
+ return Insert(BinaryOperator::CreateXor(LHS, RHS, Name));
}
BinaryOperator *CreateBinOp(Instruction::BinaryOps Opc,
Value *LHS, Value *RHS, const char *Name = "") {
- return Insert(BinaryOperator::create(Opc, LHS, RHS, Name));
+ return Insert(BinaryOperator::Create(Opc, LHS, RHS, Name));
}
BinaryOperator *CreateNeg(Value *V, const char *Name = "") {
- return Insert(BinaryOperator::createNeg(V, Name));
+ return Insert(BinaryOperator::CreateNeg(V, Name));
}
BinaryOperator *CreateNot(Value *V, const char *Name = "") {
- return Insert(BinaryOperator::createNot(V, Name));
+ return Insert(BinaryOperator::CreateNot(V, Name));
}
//===--------------------------------------------------------------------===//
@@ -357,7 +357,7 @@
return V;
if (Constant *VC = dyn_cast<Constant>(V))
return ConstantExpr::getCast(Op, VC, DestTy);
- return Insert(CastInst::create(Op, V, DestTy, Name));
+ return Insert(CastInst::Create(Op, V, DestTy, Name));
}
Value *CreateIntCast(Value *V, const Type *DestTy, bool isSigned,
const char *Name = "") {
@@ -365,7 +365,7 @@
return V;
if (Constant *VC = dyn_cast<Constant>(V))
return ConstantExpr::getIntegerCast(VC, DestTy, isSigned);
- return Insert(CastInst::createIntegerCast(V, DestTy, isSigned, Name));
+ return Insert(CastInst::CreateIntegerCast(V, DestTy, isSigned, Name));
}
//===--------------------------------------------------------------------===//
Modified: llvm/branches/ggreif/use-diet/lib/Analysis/ScalarEvolutionExpander.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Analysis/ScalarEvolutionExpander.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Analysis/ScalarEvolutionExpander.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Analysis/ScalarEvolutionExpander.cpp Thu May 15 08:08:16 2008
@@ -40,7 +40,7 @@
return CI;
}
}
- return CastInst::create(opcode, V, Ty, V->getName(),
+ return CastInst::Create(opcode, V, Ty, V->getName(),
A->getParent()->getEntryBlock().begin());
}
@@ -67,7 +67,7 @@
if (InvokeInst *II = dyn_cast<InvokeInst>(I))
IP = II->getNormalDest()->begin();
while (isa<PHINode>(IP)) ++IP;
- return CastInst::create(opcode, V, Ty, V->getName(), IP);
+ return CastInst::Create(opcode, V, Ty, V->getName(), IP);
}
/// InsertBinop - Insert the specified binary operator, doing a small amount
@@ -96,7 +96,7 @@
}
// If we don't have
- return BinaryOperator::create(Opcode, LHS, RHS, "tmp", InsertPt);
+ return BinaryOperator::Create(Opcode, LHS, RHS, "tmp", InsertPt);
}
Value *SCEVExpander::visitMulExpr(SCEVMulExpr *S) {
@@ -155,7 +155,7 @@
// Insert a unit add instruction right before the terminator corresponding
// to the back-edge.
Constant *One = ConstantInt::get(Ty, 1);
- Instruction *Add = BinaryOperator::createAdd(PN, One, "indvar.next",
+ Instruction *Add = BinaryOperator::CreateAdd(PN, One, "indvar.next",
(*HPI)->getTerminator());
pred_iterator PI = pred_begin(Header);
Modified: llvm/branches/ggreif/use-diet/lib/AsmParser/llvmAsmParser.y
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/AsmParser/llvmAsmParser.y?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/AsmParser/llvmAsmParser.y (original)
+++ llvm/branches/ggreif/use-diet/lib/AsmParser/llvmAsmParser.y Thu May 15 08:08:16 2008
@@ -2852,7 +2852,7 @@
CHECK_FOR_ERROR
Value* val2 = getVal(*$2, $5);
CHECK_FOR_ERROR
- $$ = BinaryOperator::create($1, val1, val2);
+ $$ = BinaryOperator::Create($1, val1, val2);
if ($$ == 0)
GEN_ERROR("binary operator returned null");
delete $2;
@@ -2869,7 +2869,7 @@
CHECK_FOR_ERROR
Value* tmpVal2 = getVal(*$2, $5);
CHECK_FOR_ERROR
- $$ = BinaryOperator::create($1, tmpVal1, tmpVal2);
+ $$ = BinaryOperator::Create($1, tmpVal1, tmpVal2);
if ($$ == 0)
GEN_ERROR("binary operator returned null");
delete $2;
@@ -2883,7 +2883,7 @@
CHECK_FOR_ERROR
Value* tmpVal2 = getVal(*$3, $6);
CHECK_FOR_ERROR
- $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2);
+ $$ = CmpInst::Create($1, $2, tmpVal1, tmpVal2);
if ($$ == 0)
GEN_ERROR("icmp operator returned null");
delete $3;
@@ -2897,7 +2897,7 @@
CHECK_FOR_ERROR
Value* tmpVal2 = getVal(*$3, $6);
CHECK_FOR_ERROR
- $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2);
+ $$ = CmpInst::Create($1, $2, tmpVal1, tmpVal2);
if ($$ == 0)
GEN_ERROR("fcmp operator returned null");
delete $3;
@@ -2911,7 +2911,7 @@
CHECK_FOR_ERROR
Value* tmpVal2 = getVal(*$3, $6);
CHECK_FOR_ERROR
- $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2);
+ $$ = CmpInst::Create($1, $2, tmpVal1, tmpVal2);
if ($$ == 0)
GEN_ERROR("icmp operator returned null");
delete $3;
@@ -2925,7 +2925,7 @@
CHECK_FOR_ERROR
Value* tmpVal2 = getVal(*$3, $6);
CHECK_FOR_ERROR
- $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2);
+ $$ = CmpInst::Create($1, $2, tmpVal1, tmpVal2);
if ($$ == 0)
GEN_ERROR("fcmp operator returned null");
delete $3;
@@ -2939,7 +2939,7 @@
GEN_ERROR("invalid cast opcode for cast from '" +
Val->getType()->getDescription() + "' to '" +
DestTy->getDescription() + "'");
- $$ = CastInst::create($1, Val, DestTy);
+ $$ = CastInst::Create($1, Val, DestTy);
delete $4;
}
| SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal {
Modified: llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp Thu May 15 08:08:16 2008
@@ -1265,7 +1265,7 @@
int Opc = GetDecodedBinaryOpcode(Record[OpNum], LHS->getType());
if (Opc == -1) return Error("Invalid BINOP record");
- I = BinaryOperator::create((Instruction::BinaryOps)Opc, LHS, RHS);
+ I = BinaryOperator::Create((Instruction::BinaryOps)Opc, LHS, RHS);
break;
}
case bitc::FUNC_CODE_INST_CAST: { // CAST: [opval, opty, destty, castopc]
@@ -1279,7 +1279,7 @@
int Opc = GetDecodedCastOpcode(Record[OpNum+1]);
if (Opc == -1 || ResTy == 0)
return Error("Invalid CAST record");
- I = CastInst::create((Instruction::CastOps)Opc, Op, ResTy);
+ I = CastInst::Create((Instruction::CastOps)Opc, Op, ResTy);
break;
}
case bitc::FUNC_CODE_INST_GEP: { // GEP: [n x operands]
Modified: llvm/branches/ggreif/use-diet/lib/CodeGen/IntrinsicLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/CodeGen/IntrinsicLowering.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/CodeGen/IntrinsicLowering.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/CodeGen/IntrinsicLowering.cpp Thu May 15 08:08:16 2008
@@ -173,76 +173,76 @@
switch(BitSize) {
default: assert(0 && "Unhandled type size of value to byteswap!");
case 16: {
- Value *Tmp1 = BinaryOperator::createShl(V,
+ Value *Tmp1 = BinaryOperator::CreateShl(V,
ConstantInt::get(V->getType(),8),"bswap.2",IP);
- Value *Tmp2 = BinaryOperator::createLShr(V,
+ Value *Tmp2 = BinaryOperator::CreateLShr(V,
ConstantInt::get(V->getType(),8),"bswap.1",IP);
- V = BinaryOperator::createOr(Tmp1, Tmp2, "bswap.i16", IP);
+ V = BinaryOperator::CreateOr(Tmp1, Tmp2, "bswap.i16", IP);
break;
}
case 32: {
- Value *Tmp4 = BinaryOperator::createShl(V,
+ Value *Tmp4 = BinaryOperator::CreateShl(V,
ConstantInt::get(V->getType(),24),"bswap.4", IP);
- Value *Tmp3 = BinaryOperator::createShl(V,
+ Value *Tmp3 = BinaryOperator::CreateShl(V,
ConstantInt::get(V->getType(),8),"bswap.3",IP);
- Value *Tmp2 = BinaryOperator::createLShr(V,
+ Value *Tmp2 = BinaryOperator::CreateLShr(V,
ConstantInt::get(V->getType(),8),"bswap.2",IP);
- Value *Tmp1 = BinaryOperator::createLShr(V,
+ Value *Tmp1 = BinaryOperator::CreateLShr(V,
ConstantInt::get(V->getType(),24),"bswap.1", IP);
- Tmp3 = BinaryOperator::createAnd(Tmp3,
+ Tmp3 = BinaryOperator::CreateAnd(Tmp3,
ConstantInt::get(Type::Int32Ty, 0xFF0000),
"bswap.and3", IP);
- Tmp2 = BinaryOperator::createAnd(Tmp2,
+ Tmp2 = BinaryOperator::CreateAnd(Tmp2,
ConstantInt::get(Type::Int32Ty, 0xFF00),
"bswap.and2", IP);
- Tmp4 = BinaryOperator::createOr(Tmp4, Tmp3, "bswap.or1", IP);
- Tmp2 = BinaryOperator::createOr(Tmp2, Tmp1, "bswap.or2", IP);
- V = BinaryOperator::createOr(Tmp4, Tmp2, "bswap.i32", IP);
+ Tmp4 = BinaryOperator::CreateOr(Tmp4, Tmp3, "bswap.or1", IP);
+ Tmp2 = BinaryOperator::CreateOr(Tmp2, Tmp1, "bswap.or2", IP);
+ V = BinaryOperator::CreateOr(Tmp4, Tmp2, "bswap.i32", IP);
break;
}
case 64: {
- Value *Tmp8 = BinaryOperator::createShl(V,
+ Value *Tmp8 = BinaryOperator::CreateShl(V,
ConstantInt::get(V->getType(),56),"bswap.8", IP);
- Value *Tmp7 = BinaryOperator::createShl(V,
+ Value *Tmp7 = BinaryOperator::CreateShl(V,
ConstantInt::get(V->getType(),40),"bswap.7", IP);
- Value *Tmp6 = BinaryOperator::createShl(V,
+ Value *Tmp6 = BinaryOperator::CreateShl(V,
ConstantInt::get(V->getType(),24),"bswap.6", IP);
- Value *Tmp5 = BinaryOperator::createShl(V,
+ Value *Tmp5 = BinaryOperator::CreateShl(V,
ConstantInt::get(V->getType(),8),"bswap.5", IP);
- Value* Tmp4 = BinaryOperator::createLShr(V,
+ Value* Tmp4 = BinaryOperator::CreateLShr(V,
ConstantInt::get(V->getType(),8),"bswap.4", IP);
- Value* Tmp3 = BinaryOperator::createLShr(V,
+ Value* Tmp3 = BinaryOperator::CreateLShr(V,
ConstantInt::get(V->getType(),24),"bswap.3", IP);
- Value* Tmp2 = BinaryOperator::createLShr(V,
+ Value* Tmp2 = BinaryOperator::CreateLShr(V,
ConstantInt::get(V->getType(),40),"bswap.2", IP);
- Value* Tmp1 = BinaryOperator::createLShr(V,
+ Value* Tmp1 = BinaryOperator::CreateLShr(V,
ConstantInt::get(V->getType(),56),"bswap.1", IP);
- Tmp7 = BinaryOperator::createAnd(Tmp7,
+ Tmp7 = BinaryOperator::CreateAnd(Tmp7,
ConstantInt::get(Type::Int64Ty,
0xFF000000000000ULL),
"bswap.and7", IP);
- Tmp6 = BinaryOperator::createAnd(Tmp6,
+ Tmp6 = BinaryOperator::CreateAnd(Tmp6,
ConstantInt::get(Type::Int64Ty, 0xFF0000000000ULL),
"bswap.and6", IP);
- Tmp5 = BinaryOperator::createAnd(Tmp5,
+ Tmp5 = BinaryOperator::CreateAnd(Tmp5,
ConstantInt::get(Type::Int64Ty, 0xFF00000000ULL),
"bswap.and5", IP);
- Tmp4 = BinaryOperator::createAnd(Tmp4,
+ Tmp4 = BinaryOperator::CreateAnd(Tmp4,
ConstantInt::get(Type::Int64Ty, 0xFF000000ULL),
"bswap.and4", IP);
- Tmp3 = BinaryOperator::createAnd(Tmp3,
+ Tmp3 = BinaryOperator::CreateAnd(Tmp3,
ConstantInt::get(Type::Int64Ty, 0xFF0000ULL),
"bswap.and3", IP);
- Tmp2 = BinaryOperator::createAnd(Tmp2,
+ Tmp2 = BinaryOperator::CreateAnd(Tmp2,
ConstantInt::get(Type::Int64Ty, 0xFF00ULL),
"bswap.and2", IP);
- Tmp8 = BinaryOperator::createOr(Tmp8, Tmp7, "bswap.or1", IP);
- Tmp6 = BinaryOperator::createOr(Tmp6, Tmp5, "bswap.or2", IP);
- Tmp4 = BinaryOperator::createOr(Tmp4, Tmp3, "bswap.or3", IP);
- Tmp2 = BinaryOperator::createOr(Tmp2, Tmp1, "bswap.or4", IP);
- Tmp8 = BinaryOperator::createOr(Tmp8, Tmp6, "bswap.or5", IP);
- Tmp4 = BinaryOperator::createOr(Tmp4, Tmp2, "bswap.or6", IP);
- V = BinaryOperator::createOr(Tmp8, Tmp4, "bswap.i64", IP);
+ Tmp8 = BinaryOperator::CreateOr(Tmp8, Tmp7, "bswap.or1", IP);
+ Tmp6 = BinaryOperator::CreateOr(Tmp6, Tmp5, "bswap.or2", IP);
+ Tmp4 = BinaryOperator::CreateOr(Tmp4, Tmp3, "bswap.or3", IP);
+ Tmp2 = BinaryOperator::CreateOr(Tmp2, Tmp1, "bswap.or4", IP);
+ Tmp8 = BinaryOperator::CreateOr(Tmp8, Tmp6, "bswap.or5", IP);
+ Tmp4 = BinaryOperator::CreateOr(Tmp4, Tmp2, "bswap.or6", IP);
+ V = BinaryOperator::CreateOr(Tmp8, Tmp4, "bswap.i64", IP);
break;
}
}
@@ -269,16 +269,16 @@
for (unsigned i = 1, ct = 0; i < (BitSize>64 ? 64 : BitSize);
i <<= 1, ++ct) {
Value *MaskCst = ConstantInt::get(V->getType(), MaskValues[ct]);
- Value *LHS = BinaryOperator::createAnd(
+ Value *LHS = BinaryOperator::CreateAnd(
PartValue, MaskCst, "cppop.and1", IP);
- Value *VShift = BinaryOperator::createLShr(PartValue,
+ Value *VShift = BinaryOperator::CreateLShr(PartValue,
ConstantInt::get(V->getType(), i), "ctpop.sh", IP);
- Value *RHS = BinaryOperator::createAnd(VShift, MaskCst, "cppop.and2", IP);
- PartValue = BinaryOperator::createAdd(LHS, RHS, "ctpop.step", IP);
+ Value *RHS = BinaryOperator::CreateAnd(VShift, MaskCst, "cppop.and2", IP);
+ PartValue = BinaryOperator::CreateAdd(LHS, RHS, "ctpop.step", IP);
}
- Count = BinaryOperator::createAdd(PartValue, Count, "ctpop.part", IP);
+ Count = BinaryOperator::CreateAdd(PartValue, Count, "ctpop.part", IP);
if (BitSize > 64) {
- V = BinaryOperator::createLShr(V, ConstantInt::get(V->getType(), 64),
+ V = BinaryOperator::CreateLShr(V, ConstantInt::get(V->getType(), 64),
"ctpop.part.sh", IP);
BitSize -= 64;
}
@@ -294,11 +294,11 @@
unsigned BitSize = V->getType()->getPrimitiveSizeInBits();
for (unsigned i = 1; i < BitSize; i <<= 1) {
Value *ShVal = ConstantInt::get(V->getType(), i);
- ShVal = BinaryOperator::createLShr(V, ShVal, "ctlz.sh", IP);
- V = BinaryOperator::createOr(V, ShVal, "ctlz.step", IP);
+ ShVal = BinaryOperator::CreateLShr(V, ShVal, "ctlz.sh", IP);
+ V = BinaryOperator::CreateOr(V, ShVal, "ctlz.step", IP);
}
- V = BinaryOperator::createNot(V, "", IP);
+ V = BinaryOperator::CreateNot(V, "", IP);
return LowerCTPOP(V, IP);
}
@@ -355,10 +355,10 @@
// Cast Hi and Lo to the size of Val so the widths are all the same
if (Hi->getType() != Val->getType())
- Hi = CastInst::createIntegerCast(Hi, Val->getType(), false,
+ Hi = CastInst::CreateIntegerCast(Hi, Val->getType(), false,
"tmp", CurBB);
if (Lo->getType() != Val->getType())
- Lo = CastInst::createIntegerCast(Lo, Val->getType(), false,
+ Lo = CastInst::CreateIntegerCast(Lo, Val->getType(), false,
"tmp", CurBB);
// Compute a few things that both cases will need, up front.
@@ -373,12 +373,12 @@
// First, copmute the number of bits in the forward case.
Instruction* FBitSize =
- BinaryOperator::createSub(Hi, Lo,"fbits", FwdSize);
+ BinaryOperator::CreateSub(Hi, Lo,"fbits", FwdSize);
BranchInst::Create(Compute, FwdSize);
// Second, compute the number of bits in the reverse case.
Instruction* RBitSize =
- BinaryOperator::createSub(Lo, Hi, "rbits", RevSize);
+ BinaryOperator::CreateSub(Lo, Hi, "rbits", RevSize);
BranchInst::Create(Compute, RevSize);
// Now, compute the bit range. Start by getting the bitsize and the shift
@@ -402,17 +402,17 @@
// Increment the bit size
Instruction *BitSizePlusOne =
- BinaryOperator::createAdd(BitSize, One, "bits", Compute);
+ BinaryOperator::CreateAdd(BitSize, One, "bits", Compute);
// Create a Mask to zero out the high order bits.
Instruction* Mask =
- BinaryOperator::createShl(AllOnes, BitSizePlusOne, "mask", Compute);
- Mask = BinaryOperator::createNot(Mask, "mask", Compute);
+ BinaryOperator::CreateShl(AllOnes, BitSizePlusOne, "mask", Compute);
+ Mask = BinaryOperator::CreateNot(Mask, "mask", Compute);
// Shift the bits down and apply the mask
Instruction* FRes =
- BinaryOperator::createLShr(Val, ShiftAmt, "fres", Compute);
- FRes = BinaryOperator::createAnd(FRes, Mask, "fres", Compute);
+ BinaryOperator::CreateLShr(Val, ShiftAmt, "fres", Compute);
+ FRes = BinaryOperator::CreateAnd(FRes, Mask, "fres", Compute);
BranchInst::Create(Reverse, RsltBlk, Cmp, Compute);
// In the Reverse block we have the mask already in FRes but we must reverse
@@ -435,22 +435,22 @@
RRes->addIncoming(Zero, Compute);
// Decrement the counter
- Instruction *Decr = BinaryOperator::createSub(Count, One, "decr", Reverse);
+ Instruction *Decr = BinaryOperator::CreateSub(Count, One, "decr", Reverse);
Count->addIncoming(Decr, Reverse);
// Compute the Bit that we want to move
Instruction *Bit =
- BinaryOperator::createAnd(BitsToShift, One, "bit", Reverse);
+ BinaryOperator::CreateAnd(BitsToShift, One, "bit", Reverse);
// Compute the new value for next iteration.
Instruction *NewVal =
- BinaryOperator::createLShr(BitsToShift, One, "rshift", Reverse);
+ BinaryOperator::CreateLShr(BitsToShift, One, "rshift", Reverse);
BitsToShift->addIncoming(NewVal, Reverse);
// Shift the bit into the low bits of the result.
Instruction *NewRes =
- BinaryOperator::createShl(RRes, One, "lshift", Reverse);
- NewRes = BinaryOperator::createOr(NewRes, Bit, "addbit", Reverse);
+ BinaryOperator::CreateShl(RRes, One, "lshift", Reverse);
+ NewRes = BinaryOperator::CreateOr(NewRes, Bit, "addbit", Reverse);
RRes->addIncoming(NewRes, Reverse);
// Terminate loop if we've moved all the bits.
@@ -543,8 +543,8 @@
new ICmpInst(ICmpInst::ICMP_ULT, Lo, Hi, "", entry);
SelectInst* Hi_pn = SelectInst::Create(is_forward, Hi, Lo, "", entry);
SelectInst* Lo_pn = SelectInst::Create(is_forward, Lo, Hi, "", entry);
- BinaryOperator* NumBits = BinaryOperator::createSub(Hi_pn, Lo_pn, "",entry);
- NumBits = BinaryOperator::createAdd(NumBits, One, "", entry);
+ BinaryOperator* NumBits = BinaryOperator::CreateSub(Hi_pn, Lo_pn, "",entry);
+ NumBits = BinaryOperator::CreateAdd(NumBits, One, "", entry);
// Now, convert Lo and Hi to ValTy bit width
if (ValBits > 32) {
Lo = new ZExtInst(Lo_pn, ValTy, "", entry);
@@ -559,12 +559,12 @@
// BASIC BLOCK: large
Instruction* MaskBits =
- BinaryOperator::createSub(RepBitWidth, NumBits, "", large);
- MaskBits = CastInst::createIntegerCast(MaskBits, RepMask->getType(),
+ BinaryOperator::CreateSub(RepBitWidth, NumBits, "", large);
+ MaskBits = CastInst::CreateIntegerCast(MaskBits, RepMask->getType(),
false, "", large);
BinaryOperator* Mask1 =
- BinaryOperator::createLShr(RepMask, MaskBits, "", large);
- BinaryOperator* Rep2 = BinaryOperator::createAnd(Mask1, Rep, "", large);
+ BinaryOperator::CreateLShr(RepMask, MaskBits, "", large);
+ BinaryOperator* Rep2 = BinaryOperator::CreateAnd(Mask1, Rep, "", large);
BranchInst::Create(small, large);
// BASIC BLOCK: small
@@ -598,19 +598,19 @@
RRes->addIncoming(ValZero, small);
// Decrement the loop counter by one
- Instruction *Decr = BinaryOperator::createSub(Count, One, "", reverse);
+ Instruction *Decr = BinaryOperator::CreateSub(Count, One, "", reverse);
Count->addIncoming(Decr, reverse);
// Get the bit that we want to move into the result
- Value *Bit = BinaryOperator::createAnd(BitsToShift, ValOne, "", reverse);
+ Value *Bit = BinaryOperator::CreateAnd(BitsToShift, ValOne, "", reverse);
// Compute the new value of the bits to shift for the next iteration.
- Value *NewVal = BinaryOperator::createLShr(BitsToShift, ValOne,"", reverse);
+ Value *NewVal = BinaryOperator::CreateLShr(BitsToShift, ValOne,"", reverse);
BitsToShift->addIncoming(NewVal, reverse);
// Shift the bit we extracted into the low bit of the result.
- Instruction *NewRes = BinaryOperator::createShl(RRes, ValOne, "", reverse);
- NewRes = BinaryOperator::createOr(NewRes, Bit, "", reverse);
+ Instruction *NewRes = BinaryOperator::CreateShl(RRes, ValOne, "", reverse);
+ NewRes = BinaryOperator::CreateOr(NewRes, Bit, "", reverse);
RRes->addIncoming(NewRes, reverse);
// Terminate loop if we've moved all the bits.
@@ -622,14 +622,14 @@
Rplcmnt->reserveOperandSpace(2);
Rplcmnt->addIncoming(NewRes, reverse);
Rplcmnt->addIncoming(Rep4, small);
- Value* t0 = CastInst::createIntegerCast(NumBits,ValTy,false,"",result);
- Value* t1 = BinaryOperator::createShl(ValMask, Lo, "", result);
- Value* t2 = BinaryOperator::createNot(t1, "", result);
- Value* t3 = BinaryOperator::createShl(t1, t0, "", result);
- Value* t4 = BinaryOperator::createOr(t2, t3, "", result);
- Value* t5 = BinaryOperator::createAnd(t4, Val, "", result);
- Value* t6 = BinaryOperator::createShl(Rplcmnt, Lo, "", result);
- Value* Rslt = BinaryOperator::createOr(t5, t6, "part_set", result);
+ Value* t0 = CastInst::CreateIntegerCast(NumBits,ValTy,false,"",result);
+ Value* t1 = BinaryOperator::CreateShl(ValMask, Lo, "", result);
+ Value* t2 = BinaryOperator::CreateNot(t1, "", result);
+ Value* t3 = BinaryOperator::CreateShl(t1, t0, "", result);
+ Value* t4 = BinaryOperator::CreateOr(t2, t3, "", result);
+ Value* t5 = BinaryOperator::CreateAnd(t4, Val, "", result);
+ Value* t6 = BinaryOperator::CreateShl(Rplcmnt, Lo, "", result);
+ Value* Rslt = BinaryOperator::CreateOr(t5, t6, "part_set", result);
ReturnInst::Create(Rslt, result);
}
@@ -704,10 +704,10 @@
case Intrinsic::cttz: {
// cttz(x) -> ctpop(~X & (X-1))
Value *Src = CI->getOperand(1);
- Value *NotSrc = BinaryOperator::createNot(Src, Src->getName()+".not", CI);
+ Value *NotSrc = BinaryOperator::CreateNot(Src, Src->getName()+".not", CI);
Value *SrcM1 = ConstantInt::get(Src->getType(), 1);
- SrcM1 = BinaryOperator::createSub(Src, SrcM1, "", CI);
- Src = LowerCTPOP(BinaryOperator::createAnd(NotSrc, SrcM1, "", CI), CI);
+ SrcM1 = BinaryOperator::CreateSub(Src, SrcM1, "", CI);
+ Src = LowerCTPOP(BinaryOperator::CreateAnd(NotSrc, SrcM1, "", CI), CI);
CI->replaceAllUsesWith(Src);
break;
}
Modified: llvm/branches/ggreif/use-diet/lib/Target/CppBackend/CPPBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Target/CppBackend/CPPBackend.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Target/CppBackend/CPPBackend.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Target/CppBackend/CPPBackend.cpp Thu May 15 08:08:16 2008
@@ -1153,7 +1153,7 @@
case Instruction::Shl:
case Instruction::LShr:
case Instruction::AShr:{
- Out << "BinaryOperator* " << iName << " = BinaryOperator::create(";
+ Out << "BinaryOperator* " << iName << " = BinaryOperator::Create(";
switch (I->getOpcode()) {
case Instruction::Add: Out << "Instruction::Add"; break;
case Instruction::Sub: Out << "Instruction::Sub"; break;
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalOpt.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/IPO/GlobalOpt.cpp Thu May 15 08:08:16 2008
@@ -872,7 +872,7 @@
case ICmpInst::ICMP_ULE:
case ICmpInst::ICMP_SLE:
case ICmpInst::ICMP_EQ:
- LV = BinaryOperator::createNot(LV, "notinit", CI);
+ LV = BinaryOperator::CreateNot(LV, "notinit", CI);
break;
case ICmpInst::ICMP_NE:
case ICmpInst::ICMP_UGE:
@@ -1193,7 +1193,7 @@
if (!RunningOr)
RunningOr = Cond; // First seteq
else
- RunningOr = BinaryOperator::createOr(RunningOr, Cond, "tmp", MI);
+ RunningOr = BinaryOperator::CreateOr(RunningOr, Cond, "tmp", MI);
}
// Split the basic block at the old malloc.
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IndMemRemoval.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IndMemRemoval.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IndMemRemoval.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/IPO/IndMemRemoval.cpp Thu May 15 08:08:16 2008
@@ -72,7 +72,7 @@
GlobalValue::LinkOnceLinkage,
"malloc_llvm_bounce", &M);
BasicBlock* bb = BasicBlock::Create("entry",FN);
- Instruction* c = CastInst::createIntegerCast(
+ Instruction* c = CastInst::CreateIntegerCast(
FN->arg_begin(), Type::Int32Ty, false, "c", bb);
Instruction* a = new MallocInst(Type::Int8Ty, c, "m", bb);
ReturnInst::Create(a, bb);
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/IPO/RaiseAllocations.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/IPO/RaiseAllocations.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/IPO/RaiseAllocations.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/IPO/RaiseAllocations.cpp Thu May 15 08:08:16 2008
@@ -164,7 +164,7 @@
// source size.
if (Source->getType() != Type::Int32Ty)
Source =
- CastInst::createIntegerCast(Source, Type::Int32Ty, false/*ZExt*/,
+ CastInst::CreateIntegerCast(Source, Type::Int32Ty, false/*ZExt*/,
"MallocAmtCast", I);
MallocInst *MI = new MallocInst(Type::Int8Ty, Source, "", I);
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/ProfilingUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/ProfilingUtils.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/ProfilingUtils.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/ProfilingUtils.cpp Thu May 15 08:08:16 2008
@@ -68,7 +68,7 @@
Instruction::CastOps opcode = CastInst::getCastOpcode(AI, false, ArgVTy,
false);
InitCall->setOperand(2,
- CastInst::create(opcode, AI, ArgVTy, "argv.cast", InitCall));
+ CastInst::Create(opcode, AI, ArgVTy, "argv.cast", InitCall));
} else {
InitCall->setOperand(2, AI);
}
@@ -83,11 +83,11 @@
if (!AI->use_empty()) {
opcode = CastInst::getCastOpcode(InitCall, true, AI->getType(), true);
AI->replaceAllUsesWith(
- CastInst::create(opcode, InitCall, AI->getType(), "", InsertPos));
+ CastInst::Create(opcode, InitCall, AI->getType(), "", InsertPos));
}
opcode = CastInst::getCastOpcode(AI, true, Type::Int32Ty, true);
InitCall->setOperand(1,
- CastInst::create(opcode, AI, Type::Int32Ty, "argc.cast", InitCall));
+ CastInst::Create(opcode, AI, Type::Int32Ty, "argc.cast", InitCall));
} else {
AI->replaceAllUsesWith(InitCall);
InitCall->setOperand(1, AI);
@@ -113,7 +113,7 @@
// Load, increment and store the value back.
Value *OldVal = new LoadInst(ElementPtr, "OldFuncCounter", InsertPos);
- Value *NewVal = BinaryOperator::create(Instruction::Add, OldVal,
+ Value *NewVal = BinaryOperator::Create(Instruction::Add, OldVal,
ConstantInt::get(Type::Int32Ty, 1),
"NewFuncCounter", InsertPos);
new StoreInst(NewVal, ElementPtr, InsertPos);
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/RSProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/RSProfiling.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/RSProfiling.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Instrumentation/RSProfiling.cpp Thu May 15 08:08:16 2008
@@ -215,7 +215,7 @@
ICmpInst* s = new ICmpInst(ICmpInst::ICMP_EQ, l, ConstantInt::get(T, 0),
"countercc", t);
- Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1),
+ Value* nv = BinaryOperator::CreateSub(l, ConstantInt::get(T, 1),
"counternew", t);
new StoreInst(nv, Counter, t);
t->setCondition(s);
@@ -290,7 +290,7 @@
ICmpInst* s = new ICmpInst(ICmpInst::ICMP_EQ, l, ConstantInt::get(T, 0),
"countercc", t);
- Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1),
+ Value* nv = BinaryOperator::CreateSub(l, ConstantInt::get(T, 1),
"counternew", t);
new StoreInst(nv, AI, t);
t->setCondition(s);
@@ -319,7 +319,7 @@
CallInst* c = CallInst::Create(F, "rdcc", t);
BinaryOperator* b =
- BinaryOperator::createAnd(c, ConstantInt::get(Type::Int64Ty, rm),
+ BinaryOperator::CreateAnd(c, ConstantInt::get(Type::Int64Ty, rm),
"mrdcc", t);
ICmpInst *s = new ICmpInst(ICmpInst::ICMP_EQ, b,
@@ -357,7 +357,7 @@
// Load, increment and store the value back.
Value *OldVal = new LoadInst(ElementPtr, "OldCounter", InsertPos);
profcode.insert(OldVal);
- Value *NewVal = BinaryOperator::createAdd(OldVal,
+ Value *NewVal = BinaryOperator::CreateAdd(OldVal,
ConstantInt::get(Type::Int32Ty, 1),
"NewCounter", InsertPos);
profcode.insert(NewVal);
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/CodeGenPrepare.cpp Thu May 15 08:08:16 2008
@@ -389,7 +389,7 @@
while (isa<PHINode>(InsertPt)) ++InsertPt;
InsertedCast =
- CastInst::create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "",
+ CastInst::Create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "",
InsertPt);
MadeChange = true;
}
@@ -447,7 +447,7 @@
while (isa<PHINode>(InsertPt)) ++InsertPt;
InsertedCmp =
- CmpInst::create(CI->getOpcode(), CI->getPredicate(), CI->getOperand(0),
+ CmpInst::Create(CI->getOpcode(), CI->getPredicate(), CI->getOperand(0),
CI->getOperand(1), "", InsertPt);
MadeChange = true;
}
@@ -880,7 +880,7 @@
V = new SExtInst(V, IntPtrTy, "sunkaddr", InsertPt);
}
if (AddrMode.Scale != 1)
- V = BinaryOperator::createMul(V, ConstantInt::get(IntPtrTy,
+ V = BinaryOperator::CreateMul(V, ConstantInt::get(IntPtrTy,
AddrMode.Scale),
"sunkaddr", InsertPt);
Result = V;
@@ -892,7 +892,7 @@
if (V->getType() != IntPtrTy)
V = new PtrToIntInst(V, IntPtrTy, "sunkaddr", InsertPt);
if (Result)
- Result = BinaryOperator::createAdd(Result, V, "sunkaddr", InsertPt);
+ Result = BinaryOperator::CreateAdd(Result, V, "sunkaddr", InsertPt);
else
Result = V;
}
@@ -902,7 +902,7 @@
Value *V = new PtrToIntInst(AddrMode.BaseGV, IntPtrTy, "sunkaddr",
InsertPt);
if (Result)
- Result = BinaryOperator::createAdd(Result, V, "sunkaddr", InsertPt);
+ Result = BinaryOperator::CreateAdd(Result, V, "sunkaddr", InsertPt);
else
Result = V;
}
@@ -911,7 +911,7 @@
if (AddrMode.BaseOffs) {
Value *V = ConstantInt::get(IntPtrTy, AddrMode.BaseOffs);
if (Result)
- Result = BinaryOperator::createAdd(Result, V, "sunkaddr", InsertPt);
+ Result = BinaryOperator::CreateAdd(Result, V, "sunkaddr", InsertPt);
else
Result = V;
}
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/GVNPRE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/GVNPRE.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/GVNPRE.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/GVNPRE.cpp Thu May 15 08:08:16 2008
@@ -804,7 +804,7 @@
if (newOp1 != U->getOperand(0)) {
Instruction* newVal = 0;
if (CastInst* C = dyn_cast<CastInst>(U))
- newVal = CastInst::create(C->getOpcode(),
+ newVal = CastInst::Create(C->getOpcode(),
newOp1, C->getType(),
C->getName()+".expr");
@@ -847,11 +847,11 @@
if (newOp1 != U->getOperand(0) || newOp2 != U->getOperand(1)) {
Instruction* newVal = 0;
if (BinaryOperator* BO = dyn_cast<BinaryOperator>(U))
- newVal = BinaryOperator::create(BO->getOpcode(),
+ newVal = BinaryOperator::Create(BO->getOpcode(),
newOp1, newOp2,
BO->getName()+".expr");
else if (CmpInst* C = dyn_cast<CmpInst>(U))
- newVal = CmpInst::create(C->getOpcode(),
+ newVal = CmpInst::Create(C->getOpcode(),
C->getPredicate(),
newOp1, newOp2,
C->getName()+".expr");
@@ -1665,11 +1665,11 @@
Value* newVal = 0;
if (BinaryOperator* BO = dyn_cast<BinaryOperator>(U))
- newVal = BinaryOperator::create(BO->getOpcode(), s1, s2,
+ newVal = BinaryOperator::Create(BO->getOpcode(), s1, s2,
BO->getName()+".gvnpre",
(*PI)->getTerminator());
else if (CmpInst* C = dyn_cast<CmpInst>(U))
- newVal = CmpInst::create(C->getOpcode(), C->getPredicate(), s1, s2,
+ newVal = CmpInst::Create(C->getOpcode(), C->getPredicate(), s1, s2,
C->getName()+".gvnpre",
(*PI)->getTerminator());
else if (ShuffleVectorInst* S = dyn_cast<ShuffleVectorInst>(U))
@@ -1685,7 +1685,7 @@
newVal = SelectInst::Create(s1, s2, s3, S->getName()+".gvnpre",
(*PI)->getTerminator());
else if (CastInst* C = dyn_cast<CastInst>(U))
- newVal = CastInst::create(C->getOpcode(), s1, C->getType(),
+ newVal = CastInst::Create(C->getOpcode(), s1, C->getType(),
C->getName()+".gvnpre",
(*PI)->getTerminator());
else if (GetElementPtrInst* G = dyn_cast<GetElementPtrInst>(U))
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/IndVarSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/IndVarSimplify.cpp Thu May 15 08:08:16 2008
@@ -151,7 +151,7 @@
NewPhi->addIncoming(Constant::getNullValue(NewPhi->getType()), Preheader);
// Create the new add instruction.
- Value *NewAdd = BinaryOperator::createAdd(NewPhi, AddedVal,
+ Value *NewAdd = BinaryOperator::CreateAdd(NewPhi, AddedVal,
GEPI->getName()+".rec", GEPI);
NewPhi->addIncoming(NewAdd, PN->getIncomingBlock(BackedgeIdx));
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/InstructionCombining.cpp Thu May 15 08:08:16 2008
@@ -263,7 +263,7 @@
if (Constant *CV = dyn_cast<Constant>(V))
return ConstantExpr::getCast(opc, CV, Ty);
- Instruction *C = CastInst::create(opc, V, Ty, V->getName(), &Pos);
+ Instruction *C = CastInst::Create(opc, V, Ty, V->getName(), &Pos);
AddToWorkList(C);
return C;
}
@@ -513,7 +513,7 @@
// Fold (op (op V1, C1), (op V2, C2)) ==> (op (op V1, V2), (op C1,C2))
Constant *Folded = ConstantExpr::get(I.getOpcode(), C1, C2);
- Instruction *New = BinaryOperator::create(Opcode, Op->getOperand(0),
+ Instruction *New = BinaryOperator::Create(Opcode, Op->getOperand(0),
Op1->getOperand(0),
Op1->getName(), &I);
AddToWorkList(New);
@@ -1393,7 +1393,7 @@
// e.g. (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
if ((DemandedMask & ~RHSKnownZero & ~LHSKnownZero) == 0) {
Instruction *Or =
- BinaryOperator::createOr(I->getOperand(0), I->getOperand(1),
+ BinaryOperator::CreateOr(I->getOperand(0), I->getOperand(1),
I->getName());
InsertNewInstBefore(Or, *I);
return UpdateValueUsesWith(I, Or);
@@ -1408,7 +1408,7 @@
if ((RHSKnownOne & LHSKnownOne) == RHSKnownOne) {
Constant *AndC = ConstantInt::get(~RHSKnownOne & DemandedMask);
Instruction *And =
- BinaryOperator::createAnd(I->getOperand(0), AndC, "tmp");
+ BinaryOperator::CreateAnd(I->getOperand(0), AndC, "tmp");
InsertNewInstBefore(And, *I);
return UpdateValueUsesWith(I, And);
}
@@ -1567,7 +1567,7 @@
// Turn it into OR if input bits are zero.
if ((LHSKnownZero & RHS->getValue()) == RHS->getValue()) {
Instruction *Or =
- BinaryOperator::createOr(I->getOperand(0), I->getOperand(1),
+ BinaryOperator::CreateOr(I->getOperand(0), I->getOperand(1),
I->getName());
InsertNewInstBefore(Or, *I);
return UpdateValueUsesWith(I, Or);
@@ -1675,7 +1675,7 @@
// the shift amount is >= the size of the datatype, which is undefined.
if (DemandedMask == 1) {
// Perform the logical shift right.
- Value *NewVal = BinaryOperator::createLShr(
+ Value *NewVal = BinaryOperator::CreateLShr(
I->getOperand(0), I->getOperand(1), I->getName());
InsertNewInstBefore(cast<Instruction>(NewVal), *I);
return UpdateValueUsesWith(I, NewVal);
@@ -1716,7 +1716,7 @@
if (RHSKnownZero[BitWidth-ShiftAmt-1] ||
(HighBits & ~DemandedMask) == HighBits) {
// Perform the logical shift right.
- Value *NewVal = BinaryOperator::createLShr(
+ Value *NewVal = BinaryOperator::CreateLShr(
I->getOperand(0), SA, I->getName());
InsertNewInstBefore(cast<Instruction>(NewVal), *I);
return UpdateValueUsesWith(I, NewVal);
@@ -2026,12 +2026,12 @@
default: assert(0 && "Case stmts out of sync!");
case Intrinsic::x86_sse_sub_ss:
case Intrinsic::x86_sse2_sub_sd:
- TmpV = InsertNewInstBefore(BinaryOperator::createSub(LHS, RHS,
+ TmpV = InsertNewInstBefore(BinaryOperator::CreateSub(LHS, RHS,
II->getName()), *II);
break;
case Intrinsic::x86_sse_mul_ss:
case Intrinsic::x86_sse2_mul_sd:
- TmpV = InsertNewInstBefore(BinaryOperator::createMul(LHS, RHS,
+ TmpV = InsertNewInstBefore(BinaryOperator::CreateMul(LHS, RHS,
II->getName()), *II);
break;
}
@@ -2160,7 +2160,7 @@
AddRHS(Value *rhs) : RHS(rhs) {}
bool shouldApply(Value *LHS) const { return LHS == RHS; }
Instruction *apply(BinaryOperator &Add) const {
- return BinaryOperator::createShl(Add.getOperand(0),
+ return BinaryOperator::CreateShl(Add.getOperand(0),
ConstantInt::get(Add.getType(), 1));
}
};
@@ -2176,7 +2176,7 @@
ConstantExpr::getAnd(C1, C2)->isNullValue();
}
Instruction *apply(BinaryOperator &Add) const {
- return BinaryOperator::createOr(Add.getOperand(0), Add.getOperand(1));
+ return BinaryOperator::CreateOr(Add.getOperand(0), Add.getOperand(1));
}
};
@@ -2188,7 +2188,7 @@
if (Constant *SOC = dyn_cast<Constant>(SO))
return ConstantExpr::getCast(CI->getOpcode(), SOC, I.getType());
- return IC->InsertNewInstBefore(CastInst::create(
+ return IC->InsertNewInstBefore(CastInst::Create(
CI->getOpcode(), SO, I.getType(), SO->getName() + ".cast"), I);
}
@@ -2207,9 +2207,9 @@
std::swap(Op0, Op1);
Instruction *New;
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(&I))
- New = BinaryOperator::create(BO->getOpcode(), Op0, Op1,SO->getName()+".op");
+ New = BinaryOperator::Create(BO->getOpcode(), Op0, Op1,SO->getName()+".op");
else if (CmpInst *CI = dyn_cast<CmpInst>(&I))
- New = CmpInst::create(CI->getOpcode(), CI->getPredicate(), Op0, Op1,
+ New = CmpInst::Create(CI->getOpcode(), CI->getPredicate(), Op0, Op1,
SO->getName()+".cmp");
else {
assert(0 && "Unknown binary instruction type!");
@@ -2295,11 +2295,11 @@
} else {
assert(PN->getIncomingBlock(i) == NonConstBB);
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(&I))
- InV = BinaryOperator::create(BO->getOpcode(),
+ InV = BinaryOperator::Create(BO->getOpcode(),
PN->getIncomingValue(i), C, "phitmp",
NonConstBB->getTerminator());
else if (CmpInst *CI = dyn_cast<CmpInst>(&I))
- InV = CmpInst::create(CI->getOpcode(),
+ InV = CmpInst::Create(CI->getOpcode(),
CI->getPredicate(),
PN->getIncomingValue(i), C, "phitmp",
NonConstBB->getTerminator());
@@ -2319,7 +2319,7 @@
InV = ConstantExpr::getCast(CI->getOpcode(), InC, RetTy);
} else {
assert(PN->getIncomingBlock(i) == NonConstBB);
- InV = CastInst::create(CI->getOpcode(), PN->getIncomingValue(i),
+ InV = CastInst::Create(CI->getOpcode(), PN->getIncomingValue(i),
I.getType(), "phitmp",
NonConstBB->getTerminator());
AddToWorkList(cast<Instruction>(InV));
@@ -2396,7 +2396,7 @@
const APInt& Val = CI->getValue();
uint32_t BitWidth = Val.getBitWidth();
if (Val == APInt::getSignBit(BitWidth))
- return BinaryOperator::createXor(LHS, RHS);
+ return BinaryOperator::CreateXor(LHS, RHS);
// See if SimplifyDemandedBits can simplify this. This handles stuff like
// (X & 254)+1 -> (X&254)|1
@@ -2480,35 +2480,35 @@
if (Value *LHSV = dyn_castNegVal(LHS)) {
if (LHS->getType()->isIntOrIntVector()) {
if (Value *RHSV = dyn_castNegVal(RHS)) {
- Instruction *NewAdd = BinaryOperator::createAdd(LHSV, RHSV, "sum");
+ Instruction *NewAdd = BinaryOperator::CreateAdd(LHSV, RHSV, "sum");
InsertNewInstBefore(NewAdd, I);
- return BinaryOperator::createNeg(NewAdd);
+ return BinaryOperator::CreateNeg(NewAdd);
}
}
- return BinaryOperator::createSub(RHS, LHSV);
+ return BinaryOperator::CreateSub(RHS, LHSV);
}
// A + -B --> A - B
if (!isa<Constant>(RHS))
if (Value *V = dyn_castNegVal(RHS))
- return BinaryOperator::createSub(LHS, V);
+ return BinaryOperator::CreateSub(LHS, V);
ConstantInt *C2;
if (Value *X = dyn_castFoldableMul(LHS, C2)) {
if (X == RHS) // X*C + X --> X * (C+1)
- return BinaryOperator::createMul(RHS, AddOne(C2));
+ return BinaryOperator::CreateMul(RHS, AddOne(C2));
// X*C1 + X*C2 --> X * (C1+C2)
ConstantInt *C1;
if (X == dyn_castFoldableMul(RHS, C1))
- return BinaryOperator::createMul(X, Add(C1, C2));
+ return BinaryOperator::CreateMul(X, Add(C1, C2));
}
// X + X*C --> X * (C+1)
if (dyn_castFoldableMul(RHS, C2) == LHS)
- return BinaryOperator::createMul(LHS, AddOne(C2));
+ return BinaryOperator::CreateMul(LHS, AddOne(C2));
// X + ~X --> -1 since ~X = -X-1
if (dyn_castNotVal(LHS) == RHS || dyn_castNotVal(RHS) == LHS)
@@ -2537,9 +2537,9 @@
}
if (W == Y) {
- Value *NewAdd = InsertNewInstBefore(BinaryOperator::createAdd(X, Z,
+ Value *NewAdd = InsertNewInstBefore(BinaryOperator::CreateAdd(X, Z,
LHS->getName()), I);
- return BinaryOperator::createMul(W, NewAdd);
+ return BinaryOperator::CreateMul(W, NewAdd);
}
}
}
@@ -2547,7 +2547,7 @@
if (ConstantInt *CRHS = dyn_cast<ConstantInt>(RHS)) {
Value *X = 0;
if (match(LHS, m_Not(m_Value(X)))) // ~X + C --> (C-1) - X
- return BinaryOperator::createSub(SubOne(CRHS), X);
+ return BinaryOperator::CreateSub(SubOne(CRHS), X);
// (X & FF00) + xx00 -> (X+xx00) & FF00
if (LHS->hasOneUse() && match(LHS, m_And(m_Value(X), m_ConstantInt(C2)))) {
@@ -2565,9 +2565,9 @@
if (AddRHSHighBits == AddRHSHighBitsAnd) {
// Okay, the xform is safe. Insert the new add pronto.
- Value *NewAdd = InsertNewInstBefore(BinaryOperator::createAdd(X, CRHS,
+ Value *NewAdd = InsertNewInstBefore(BinaryOperator::CreateAdd(X, CRHS,
LHS->getName()), I);
- return BinaryOperator::createAnd(NewAdd, C2);
+ return BinaryOperator::CreateAnd(NewAdd, C2);
}
}
}
@@ -2647,7 +2647,7 @@
// If this is a 'B = x-(-A)', change to B = x+A...
if (Value *V = dyn_castNegVal(Op1))
- return BinaryOperator::createAdd(Op0, V);
+ return BinaryOperator::CreateAdd(Op0, V);
if (isa<UndefValue>(Op0))
return ReplaceInstUsesWith(I, Op0); // undef - X -> undef
@@ -2657,12 +2657,12 @@
if (ConstantInt *C = dyn_cast<ConstantInt>(Op0)) {
// Replace (-1 - A) with (~A)...
if (C->isAllOnesValue())
- return BinaryOperator::createNot(Op1);
+ return BinaryOperator::CreateNot(Op1);
// C - ~X == X + (1+C)
Value *X = 0;
if (match(Op1, m_Not(m_Value(X))))
- return BinaryOperator::createAdd(X, AddOne(C));
+ return BinaryOperator::CreateAdd(X, AddOne(C));
// -(X >>u 31) -> (X >>s 31)
// -(X >>s 31) -> (X >>u 31)
@@ -2674,7 +2674,7 @@
if (CU->getLimitedValue(SI->getType()->getPrimitiveSizeInBits()) ==
SI->getType()->getPrimitiveSizeInBits()-1) {
// Ok, the transformation is safe. Insert AShr.
- return BinaryOperator::create(Instruction::AShr,
+ return BinaryOperator::Create(Instruction::AShr,
SI->getOperand(0), CU, SI->getName());
}
}
@@ -2685,7 +2685,7 @@
if (CU->getLimitedValue(SI->getType()->getPrimitiveSizeInBits()) ==
SI->getType()->getPrimitiveSizeInBits()-1) {
// Ok, the transformation is safe. Insert LShr.
- return BinaryOperator::createLShr(
+ return BinaryOperator::CreateLShr(
SI->getOperand(0), CU, SI->getName());
}
}
@@ -2707,13 +2707,13 @@
if (Op1I->getOpcode() == Instruction::Add &&
!Op0->getType()->isFPOrFPVector()) {
if (Op1I->getOperand(0) == Op0) // X-(X+Y) == -Y
- return BinaryOperator::createNeg(Op1I->getOperand(1), I.getName());
+ return BinaryOperator::CreateNeg(Op1I->getOperand(1), I.getName());
else if (Op1I->getOperand(1) == Op0) // X-(Y+X) == -Y
- return BinaryOperator::createNeg(Op1I->getOperand(0), I.getName());
+ return BinaryOperator::CreateNeg(Op1I->getOperand(0), I.getName());
else if (ConstantInt *CI1 = dyn_cast<ConstantInt>(I.getOperand(0))) {
if (ConstantInt *CI2 = dyn_cast<ConstantInt>(Op1I->getOperand(1)))
// C1-(X+C2) --> (C1-C2)-X
- return BinaryOperator::createSub(Subtract(CI1, CI2),
+ return BinaryOperator::CreateSub(Subtract(CI1, CI2),
Op1I->getOperand(0));
}
}
@@ -2730,7 +2730,7 @@
Op1I->setOperand(1, IIOp0);
// Create the new top level add instruction...
- return BinaryOperator::createAdd(Op0, Op1);
+ return BinaryOperator::CreateAdd(Op0, Op1);
}
// Replace (A - (A & B)) with (A & ~B) if this is the only use of (A&B)...
@@ -2740,8 +2740,8 @@
Value *OtherOp = Op1I->getOperand(Op1I->getOperand(0) == Op0);
Value *NewNot =
- InsertNewInstBefore(BinaryOperator::createNot(OtherOp, "B.not"), I);
- return BinaryOperator::createAnd(Op0, NewNot);
+ InsertNewInstBefore(BinaryOperator::CreateNot(OtherOp, "B.not"), I);
+ return BinaryOperator::CreateAnd(Op0, NewNot);
}
// 0 - (X sdiv C) -> (X sdiv -C)
@@ -2749,14 +2749,14 @@
if (ConstantInt *CSI = dyn_cast<ConstantInt>(Op0))
if (CSI->isZero())
if (Constant *DivRHS = dyn_cast<Constant>(Op1I->getOperand(1)))
- return BinaryOperator::createSDiv(Op1I->getOperand(0),
+ return BinaryOperator::CreateSDiv(Op1I->getOperand(0),
ConstantExpr::getNeg(DivRHS));
// X - X*C --> X * (1-C)
ConstantInt *C2 = 0;
if (dyn_castFoldableMul(Op1I, C2) == Op0) {
Constant *CP1 = Subtract(ConstantInt::get(I.getType(), 1), C2);
- return BinaryOperator::createMul(Op0, CP1);
+ return BinaryOperator::CreateMul(Op0, CP1);
}
// X - ((X / Y) * Y) --> X % Y
@@ -2765,9 +2765,9 @@
if (Op0 == I->getOperand(0) &&
Op1I->getOperand(1) == I->getOperand(1)) {
if (I->getOpcode() == Instruction::SDiv)
- return BinaryOperator::createSRem(Op0, Op1I->getOperand(1));
+ return BinaryOperator::CreateSRem(Op0, Op1I->getOperand(1));
if (I->getOpcode() == Instruction::UDiv)
- return BinaryOperator::createURem(Op0, Op1I->getOperand(1));
+ return BinaryOperator::CreateURem(Op0, Op1I->getOperand(1));
}
}
}
@@ -2781,18 +2781,18 @@
return ReplaceInstUsesWith(I, Op0I->getOperand(0));
} else if (Op0I->getOpcode() == Instruction::Sub) {
if (Op0I->getOperand(0) == Op1) // (X-Y)-X == -Y
- return BinaryOperator::createNeg(Op0I->getOperand(1), I.getName());
+ return BinaryOperator::CreateNeg(Op0I->getOperand(1), I.getName());
}
}
ConstantInt *C1;
if (Value *X = dyn_castFoldableMul(Op0, C1)) {
if (X == Op1) // X*C - X --> X * (C-1)
- return BinaryOperator::createMul(Op1, SubOne(C1));
+ return BinaryOperator::CreateMul(Op1, SubOne(C1));
ConstantInt *C2; // X*C1 - X*C2 -> X * (C1-C2)
if (X == dyn_castFoldableMul(Op1, C2))
- return BinaryOperator::createMul(X, Subtract(C1, C2));
+ return BinaryOperator::CreateMul(X, Subtract(C1, C2));
}
return 0;
}
@@ -2843,7 +2843,7 @@
if (BinaryOperator *SI = dyn_cast<BinaryOperator>(Op0))
if (SI->getOpcode() == Instruction::Shl)
if (Constant *ShOp = dyn_cast<Constant>(SI->getOperand(1)))
- return BinaryOperator::createMul(SI->getOperand(0),
+ return BinaryOperator::CreateMul(SI->getOperand(0),
ConstantExpr::getShl(CI, ShOp));
if (CI->isZero())
@@ -2851,11 +2851,11 @@
if (CI->equalsInt(1)) // X * 1 == X
return ReplaceInstUsesWith(I, Op0);
if (CI->isAllOnesValue()) // X * -1 == 0 - X
- return BinaryOperator::createNeg(Op0, I.getName());
+ return BinaryOperator::CreateNeg(Op0, I.getName());
const APInt& Val = cast<ConstantInt>(CI)->getValue();
if (Val.isPowerOf2()) { // Replace X*(2^C) with X << C
- return BinaryOperator::createShl(Op0,
+ return BinaryOperator::CreateShl(Op0,
ConstantInt::get(Op0->getType(), Val.logBase2()));
}
} else if (ConstantFP *Op1F = dyn_cast<ConstantFP>(Op1)) {
@@ -2874,12 +2874,12 @@
if (Op0I->getOpcode() == Instruction::Add && Op0I->hasOneUse() &&
isa<ConstantInt>(Op0I->getOperand(1))) {
// Canonicalize (X+C1)*C2 -> X*C2+C1*C2.
- Instruction *Add = BinaryOperator::createMul(Op0I->getOperand(0),
+ Instruction *Add = BinaryOperator::CreateMul(Op0I->getOperand(0),
Op1, "tmp");
InsertNewInstBefore(Add, I);
Value *C1C2 = ConstantExpr::getMul(Op1,
cast<Constant>(Op0I->getOperand(1)));
- return BinaryOperator::createAdd(Add, C1C2);
+ return BinaryOperator::CreateAdd(Add, C1C2);
}
@@ -2895,7 +2895,7 @@
if (Value *Op0v = dyn_castNegVal(Op0)) // -X * -Y = X*Y
if (Value *Op1v = dyn_castNegVal(I.getOperand(1)))
- return BinaryOperator::createMul(Op0v, Op1v);
+ return BinaryOperator::CreateMul(Op0v, Op1v);
// If one of the operands of the multiply is a cast from a boolean value, then
// we know the bool is either zero or one, so this is a 'masking' multiply.
@@ -2925,7 +2925,7 @@
SCOpTy->getPrimitiveSizeInBits()-1);
Value *V =
InsertNewInstBefore(
- BinaryOperator::create(Instruction::AShr, SCIOp0, Amt,
+ BinaryOperator::Create(Instruction::AShr, SCIOp0, Amt,
BoolCast->getOperand(0)->getName()+
".mask"), I);
@@ -2941,7 +2941,7 @@
}
Value *OtherOp = Op0 == BoolCast ? I.getOperand(1) : Op0;
- return BinaryOperator::createAnd(V, OtherOp);
+ return BinaryOperator::CreateAnd(V, OtherOp);
}
}
}
@@ -3027,7 +3027,7 @@
if (MultiplyOverflows(RHS, LHSRHS, I.getOpcode()==Instruction::SDiv))
return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
else
- return BinaryOperator::create(I.getOpcode(), LHS->getOperand(0),
+ return BinaryOperator::Create(I.getOpcode(), LHS->getOperand(0),
Multiply(RHS, LHSRHS));
}
@@ -3061,7 +3061,7 @@
// if so, convert to a right shift.
if (ConstantInt *C = dyn_cast<ConstantInt>(Op1)) {
if (C->getValue().isPowerOf2()) // 0 not included in isPowerOf2
- return BinaryOperator::createLShr(Op0,
+ return BinaryOperator::CreateLShr(Op0,
ConstantInt::get(Op0->getType(), C->getValue().logBase2()));
}
@@ -3075,9 +3075,9 @@
const Type *NTy = N->getType();
if (uint32_t C2 = C1.logBase2()) {
Constant *C2V = ConstantInt::get(NTy, C2);
- N = InsertNewInstBefore(BinaryOperator::createAdd(N, C2V, "tmp"), I);
+ N = InsertNewInstBefore(BinaryOperator::CreateAdd(N, C2V, "tmp"), I);
}
- return BinaryOperator::createLShr(Op0, N);
+ return BinaryOperator::CreateLShr(Op0, N);
}
}
}
@@ -3093,13 +3093,13 @@
uint32_t TSA = TVA.logBase2(), FSA = FVA.logBase2();
// Construct the "on true" case of the select
Constant *TC = ConstantInt::get(Op0->getType(), TSA);
- Instruction *TSI = BinaryOperator::createLShr(
+ Instruction *TSI = BinaryOperator::CreateLShr(
Op0, TC, SI->getName()+".t");
TSI = InsertNewInstBefore(TSI, I);
// Construct the "on false" case of the select
Constant *FC = ConstantInt::get(Op0->getType(), FSA);
- Instruction *FSI = BinaryOperator::createLShr(
+ Instruction *FSI = BinaryOperator::CreateLShr(
Op0, FC, SI->getName()+".f");
FSI = InsertNewInstBefore(FSI, I);
@@ -3120,11 +3120,11 @@
if (ConstantInt *RHS = dyn_cast<ConstantInt>(Op1)) {
// sdiv X, -1 == -X
if (RHS->isAllOnesValue())
- return BinaryOperator::createNeg(Op0);
+ return BinaryOperator::CreateNeg(Op0);
// -X/C -> X/-C
if (Value *LHSNeg = dyn_castNegVal(Op0))
- return BinaryOperator::createSDiv(LHSNeg, ConstantExpr::getNeg(RHS));
+ return BinaryOperator::CreateSDiv(LHSNeg, ConstantExpr::getNeg(RHS));
}
// If the sign bits of both operands are zero (i.e. we can prove they are
@@ -3133,7 +3133,7 @@
APInt Mask(APInt::getSignBit(I.getType()->getPrimitiveSizeInBits()));
if (MaskedValueIsZero(Op1, Mask) && MaskedValueIsZero(Op0, Mask)) {
// X sdiv Y -> X udiv Y, iff X and Y don't have sign bit set
- return BinaryOperator::createUDiv(Op0, Op1, I.getName());
+ return BinaryOperator::CreateUDiv(Op0, Op1, I.getName());
}
}
@@ -3250,7 +3250,7 @@
// if so, convert to a bitwise and.
if (ConstantInt *C = dyn_cast<ConstantInt>(RHS))
if (C->getValue().isPowerOf2())
- return BinaryOperator::createAnd(Op0, SubOne(C));
+ return BinaryOperator::CreateAnd(Op0, SubOne(C));
}
if (Instruction *RHSI = dyn_cast<Instruction>(I.getOperand(1))) {
@@ -3259,9 +3259,9 @@
isa<ConstantInt>(RHSI->getOperand(0))) {
if (cast<ConstantInt>(RHSI->getOperand(0))->getValue().isPowerOf2()) {
Constant *N1 = ConstantInt::getAllOnesValue(I.getType());
- Value *Add = InsertNewInstBefore(BinaryOperator::createAdd(RHSI, N1,
+ Value *Add = InsertNewInstBefore(BinaryOperator::CreateAdd(RHSI, N1,
"tmp"), I);
- return BinaryOperator::createAnd(Op0, Add);
+ return BinaryOperator::CreateAnd(Op0, Add);
}
}
}
@@ -3275,9 +3275,9 @@
if ((STO->getValue().isPowerOf2()) &&
(SFO->getValue().isPowerOf2())) {
Value *TrueAnd = InsertNewInstBefore(
- BinaryOperator::createAnd(Op0, SubOne(STO), SI->getName()+".t"), I);
+ BinaryOperator::CreateAnd(Op0, SubOne(STO), SI->getName()+".t"), I);
Value *FalseAnd = InsertNewInstBefore(
- BinaryOperator::createAnd(Op0, SubOne(SFO), SI->getName()+".f"), I);
+ BinaryOperator::CreateAnd(Op0, SubOne(SFO), SI->getName()+".f"), I);
return SelectInst::Create(SI->getOperand(0), TrueAnd, FalseAnd);
}
}
@@ -3308,7 +3308,7 @@
APInt Mask(APInt::getSignBit(I.getType()->getPrimitiveSizeInBits()));
if (MaskedValueIsZero(Op1, Mask) && MaskedValueIsZero(Op0, Mask)) {
// X srem Y -> X urem Y, iff X and Y don't have sign bit set
- return BinaryOperator::createURem(Op0, Op1, I.getName());
+ return BinaryOperator::CreateURem(Op0, Op1, I.getName());
}
}
@@ -3496,10 +3496,10 @@
case Instruction::Xor:
if (Op->hasOneUse()) {
// (X ^ C1) & C2 --> (X & C2) ^ (C1&C2)
- Instruction *And = BinaryOperator::createAnd(X, AndRHS);
+ Instruction *And = BinaryOperator::CreateAnd(X, AndRHS);
InsertNewInstBefore(And, TheAnd);
And->takeName(Op);
- return BinaryOperator::createXor(And, Together);
+ return BinaryOperator::CreateXor(And, Together);
}
break;
case Instruction::Or:
@@ -3508,10 +3508,10 @@
if (Op->hasOneUse() && Together != OpRHS) {
// (X | C1) & C2 --> (X | (C1&C2)) & C2
- Instruction *Or = BinaryOperator::createOr(X, Together);
+ Instruction *Or = BinaryOperator::CreateOr(X, Together);
InsertNewInstBefore(Or, TheAnd);
Or->takeName(Op);
- return BinaryOperator::createAnd(Or, AndRHS);
+ return BinaryOperator::CreateAnd(Or, AndRHS);
}
break;
case Instruction::Add:
@@ -3539,10 +3539,10 @@
return &TheAnd;
} else {
// Pull the XOR out of the AND.
- Instruction *NewAnd = BinaryOperator::createAnd(X, AndRHS);
+ Instruction *NewAnd = BinaryOperator::CreateAnd(X, AndRHS);
InsertNewInstBefore(NewAnd, TheAnd);
NewAnd->takeName(Op);
- return BinaryOperator::createXor(NewAnd, AndRHS);
+ return BinaryOperator::CreateXor(NewAnd, AndRHS);
}
}
}
@@ -3601,9 +3601,9 @@
// Make the argument unsigned.
Value *ShVal = Op->getOperand(0);
ShVal = InsertNewInstBefore(
- BinaryOperator::createLShr(ShVal, OpRHS,
+ BinaryOperator::CreateLShr(ShVal, OpRHS,
Op->getName()), TheAnd);
- return BinaryOperator::createAnd(ShVal, AndRHS, TheAnd.getName());
+ return BinaryOperator::CreateAnd(ShVal, AndRHS, TheAnd.getName());
}
}
break;
@@ -3637,7 +3637,7 @@
// Emit V-Lo <u Hi-Lo
Constant *NegLo = ConstantExpr::getNeg(Lo);
- Instruction *Add = BinaryOperator::createAdd(V, NegLo, V->getName()+".off");
+ Instruction *Add = BinaryOperator::CreateAdd(V, NegLo, V->getName()+".off");
InsertNewInstBefore(Add, IB);
Constant *UpperBound = ConstantExpr::getAdd(NegLo, Hi);
return new ICmpInst(ICmpInst::ICMP_ULT, Add, UpperBound);
@@ -3657,7 +3657,7 @@
// Emit V-Lo >u Hi-1-Lo
// Note that Hi has already had one subtracted from it, above.
ConstantInt *NegLo = cast<ConstantInt>(ConstantExpr::getNeg(Lo));
- Instruction *Add = BinaryOperator::createAdd(V, NegLo, V->getName()+".off");
+ Instruction *Add = BinaryOperator::CreateAdd(V, NegLo, V->getName()+".off");
InsertNewInstBefore(Add, IB);
Constant *LowerBound = ConstantExpr::getAdd(NegLo, Hi);
return new ICmpInst(ICmpInst::ICMP_UGT, Add, LowerBound);
@@ -3732,9 +3732,9 @@
Instruction *New;
if (isSub)
- New = BinaryOperator::createSub(LHSI->getOperand(0), RHS, "fold");
+ New = BinaryOperator::CreateSub(LHSI->getOperand(0), RHS, "fold");
else
- New = BinaryOperator::createAdd(LHSI->getOperand(0), RHS, "fold");
+ New = BinaryOperator::CreateAdd(LHSI->getOperand(0), RHS, "fold");
return InsertNewInstBefore(New, I);
}
@@ -3782,19 +3782,19 @@
if (Op0I->hasOneUse()) {
if (MaskedValueIsZero(Op0LHS, NotAndRHS)) {
// Not masking anything out for the LHS, move to RHS.
- Instruction *NewRHS = BinaryOperator::createAnd(Op0RHS, AndRHS,
+ Instruction *NewRHS = BinaryOperator::CreateAnd(Op0RHS, AndRHS,
Op0RHS->getName()+".masked");
InsertNewInstBefore(NewRHS, I);
- return BinaryOperator::create(
+ return BinaryOperator::Create(
cast<BinaryOperator>(Op0I)->getOpcode(), Op0LHS, NewRHS);
}
if (!isa<Constant>(Op0RHS) &&
MaskedValueIsZero(Op0RHS, NotAndRHS)) {
// Not masking anything out for the RHS, move to LHS.
- Instruction *NewLHS = BinaryOperator::createAnd(Op0LHS, AndRHS,
+ Instruction *NewLHS = BinaryOperator::CreateAnd(Op0LHS, AndRHS,
Op0LHS->getName()+".masked");
InsertNewInstBefore(NewLHS, I);
- return BinaryOperator::create(
+ return BinaryOperator::Create(
cast<BinaryOperator>(Op0I)->getOpcode(), NewLHS, Op0RHS);
}
}
@@ -3805,9 +3805,9 @@
// ((A | N) + B) & AndRHS -> (A + B) & AndRHS iff N&AndRHS == 0
// ((A ^ N) + B) & AndRHS -> (A + B) & AndRHS iff N&AndRHS == 0
if (Value *V = FoldLogicalPlusAnd(Op0LHS, Op0RHS, AndRHS, false, I))
- return BinaryOperator::createAnd(V, AndRHS);
+ return BinaryOperator::CreateAnd(V, AndRHS);
if (Value *V = FoldLogicalPlusAnd(Op0RHS, Op0LHS, AndRHS, false, I))
- return BinaryOperator::createAnd(V, AndRHS); // Add commutes
+ return BinaryOperator::CreateAnd(V, AndRHS); // Add commutes
break;
case Instruction::Sub:
@@ -3815,7 +3815,7 @@
// ((A | N) - B) & AndRHS -> (A - B) & AndRHS iff N&AndRHS == 0
// ((A ^ N) - B) & AndRHS -> (A - B) & AndRHS iff N&AndRHS == 0
if (Value *V = FoldLogicalPlusAnd(Op0LHS, Op0RHS, AndRHS, true, I))
- return BinaryOperator::createAnd(V, AndRHS);
+ return BinaryOperator::CreateAnd(V, AndRHS);
break;
}
@@ -3835,14 +3835,14 @@
// into : and (cast X to T), trunc_or_bitcast(C1)&C2
// This will fold the two constants together, which may allow
// other simplifications.
- Instruction *NewCast = CastInst::createTruncOrBitCast(
+ Instruction *NewCast = CastInst::CreateTruncOrBitCast(
CastOp->getOperand(0), I.getType(),
CastOp->getName()+".shrunk");
NewCast = InsertNewInstBefore(NewCast, I);
// trunc_or_bitcast(C1)&C2
Constant *C3 = ConstantExpr::getTruncOrBitCast(AndCI,I.getType());
C3 = ConstantExpr::getAnd(C3, AndRHS);
- return BinaryOperator::createAnd(NewCast, C3);
+ return BinaryOperator::CreateAnd(NewCast, C3);
} else if (CastOp->getOpcode() == Instruction::Or) {
// Change: and (cast (or X, C1) to T), C2
// into : trunc(C1)&C2 iff trunc(C1)&C2 == C2
@@ -3871,10 +3871,10 @@
// (~A & ~B) == (~(A | B)) - De Morgan's Law
if (Op0NotVal && Op1NotVal && isOnlyUse(Op0) && isOnlyUse(Op1)) {
- Instruction *Or = BinaryOperator::createOr(Op0NotVal, Op1NotVal,
+ Instruction *Or = BinaryOperator::CreateOr(Op0NotVal, Op1NotVal,
I.getName()+".demorgan");
InsertNewInstBefore(Or, I);
- return BinaryOperator::createNot(Or);
+ return BinaryOperator::CreateNot(Or);
}
{
@@ -3886,7 +3886,7 @@
// (A|B) & ~(A&B) -> A^B
if (match(Op1, m_Not(m_And(m_Value(C), m_Value(D))))) {
if ((A == C && B == D) || (A == D && B == C))
- return BinaryOperator::createXor(A, B);
+ return BinaryOperator::CreateXor(A, B);
}
}
@@ -3897,7 +3897,7 @@
// ~(A&B) & (A|B) -> A^B
if (match(Op0, m_Not(m_And(m_Value(C), m_Value(D))))) {
if ((A == C && B == D) || (A == D && B == C))
- return BinaryOperator::createXor(A, B);
+ return BinaryOperator::CreateXor(A, B);
}
}
@@ -3919,9 +3919,9 @@
std::swap(A, B);
}
if (A == Op0) { // A&(A^B) -> A & ~B
- Instruction *NotB = BinaryOperator::createNot(B, "tmp");
+ Instruction *NotB = BinaryOperator::CreateNot(B, "tmp");
InsertNewInstBefore(NotB, I);
- return BinaryOperator::createAnd(A, NotB);
+ return BinaryOperator::CreateAnd(A, NotB);
}
}
}
@@ -4004,7 +4004,7 @@
case ICmpInst::ICMP_NE:
if (LHSCst == SubOne(RHSCst)){// (X != 13 & X != 14) -> X-13 >u 1
Constant *AddCST = ConstantExpr::getNeg(LHSCst);
- Instruction *Add = BinaryOperator::createAdd(LHSVal, AddCST,
+ Instruction *Add = BinaryOperator::CreateAdd(LHSVal, AddCST,
LHSVal->getName()+".off");
InsertNewInstBefore(Add, I);
return new ICmpInst(ICmpInst::ICMP_UGT, Add,
@@ -4097,11 +4097,11 @@
I.getType(), TD) &&
ValueRequiresCast(Op1C->getOpcode(), Op1C->getOperand(0),
I.getType(), TD)) {
- Instruction *NewOp = BinaryOperator::createAnd(Op0C->getOperand(0),
+ Instruction *NewOp = BinaryOperator::CreateAnd(Op0C->getOperand(0),
Op1C->getOperand(0),
I.getName());
InsertNewInstBefore(NewOp, I);
- return CastInst::create(Op0C->getOpcode(), NewOp, I.getType());
+ return CastInst::Create(Op0C->getOpcode(), NewOp, I.getType());
}
}
@@ -4112,10 +4112,10 @@
SI0->getOperand(1) == SI1->getOperand(1) &&
(SI0->hasOneUse() || SI1->hasOneUse())) {
Instruction *NewOp =
- InsertNewInstBefore(BinaryOperator::createAnd(SI0->getOperand(0),
+ InsertNewInstBefore(BinaryOperator::CreateAnd(SI0->getOperand(0),
SI1->getOperand(0),
SI0->getName()), I);
- return BinaryOperator::create(SI1->getOpcode(), NewOp,
+ return BinaryOperator::Create(SI1->getOpcode(), NewOp,
SI1->getOperand(1));
}
}
@@ -4287,19 +4287,19 @@
ConstantInt *C1 = 0; Value *X = 0;
// (X & C1) | C2 --> (X | C2) & (C1|C2)
if (match(Op0, m_And(m_Value(X), m_ConstantInt(C1))) && isOnlyUse(Op0)) {
- Instruction *Or = BinaryOperator::createOr(X, RHS);
+ Instruction *Or = BinaryOperator::CreateOr(X, RHS);
InsertNewInstBefore(Or, I);
Or->takeName(Op0);
- return BinaryOperator::createAnd(Or,
+ return BinaryOperator::CreateAnd(Or,
ConstantInt::get(RHS->getValue() | C1->getValue()));
}
// (X ^ C1) | C2 --> (X | C2) ^ (C1&~C2)
if (match(Op0, m_Xor(m_Value(X), m_ConstantInt(C1))) && isOnlyUse(Op0)) {
- Instruction *Or = BinaryOperator::createOr(X, RHS);
+ Instruction *Or = BinaryOperator::CreateOr(X, RHS);
InsertNewInstBefore(Or, I);
Or->takeName(Op0);
- return BinaryOperator::createXor(Or,
+ return BinaryOperator::CreateXor(Or,
ConstantInt::get(C1->getValue() & ~RHS->getValue()));
}
@@ -4335,19 +4335,19 @@
// (X^C)|Y -> (X|Y)^C iff Y&C == 0
if (Op0->hasOneUse() && match(Op0, m_Xor(m_Value(A), m_ConstantInt(C1))) &&
MaskedValueIsZero(Op1, C1->getValue())) {
- Instruction *NOr = BinaryOperator::createOr(A, Op1);
+ Instruction *NOr = BinaryOperator::CreateOr(A, Op1);
InsertNewInstBefore(NOr, I);
NOr->takeName(Op0);
- return BinaryOperator::createXor(NOr, C1);
+ return BinaryOperator::CreateXor(NOr, C1);
}
// Y|(X^C) -> (X|Y)^C iff Y&C == 0
if (Op1->hasOneUse() && match(Op1, m_Xor(m_Value(A), m_ConstantInt(C1))) &&
MaskedValueIsZero(Op0, C1->getValue())) {
- Instruction *NOr = BinaryOperator::createOr(A, Op0);
+ Instruction *NOr = BinaryOperator::CreateOr(A, Op0);
InsertNewInstBefore(NOr, I);
NOr->takeName(Op0);
- return BinaryOperator::createXor(NOr, C1);
+ return BinaryOperator::CreateXor(NOr, C1);
}
// (A & C)|(B & D)
@@ -4397,8 +4397,8 @@
if (V1) {
Value *Or =
- InsertNewInstBefore(BinaryOperator::createOr(V2, V3, "tmp"), I);
- return BinaryOperator::createAnd(V1, Or);
+ InsertNewInstBefore(BinaryOperator::CreateOr(V2, V3, "tmp"), I);
+ return BinaryOperator::CreateAnd(V1, Or);
}
}
}
@@ -4410,10 +4410,10 @@
SI0->getOperand(1) == SI1->getOperand(1) &&
(SI0->hasOneUse() || SI1->hasOneUse())) {
Instruction *NewOp =
- InsertNewInstBefore(BinaryOperator::createOr(SI0->getOperand(0),
+ InsertNewInstBefore(BinaryOperator::CreateOr(SI0->getOperand(0),
SI1->getOperand(0),
SI0->getName()), I);
- return BinaryOperator::create(SI1->getOpcode(), NewOp,
+ return BinaryOperator::Create(SI1->getOpcode(), NewOp,
SI1->getOperand(1));
}
}
@@ -4431,9 +4431,9 @@
// (~A | ~B) == (~(A & B)) - De Morgan's Law
if (A && isOnlyUse(Op0) && isOnlyUse(Op1)) {
- Value *And = InsertNewInstBefore(BinaryOperator::createAnd(A, B,
+ Value *And = InsertNewInstBefore(BinaryOperator::CreateAnd(A, B,
I.getName()+".demorgan"), I);
- return BinaryOperator::createNot(And);
+ return BinaryOperator::CreateNot(And);
}
}
@@ -4485,7 +4485,7 @@
case ICmpInst::ICMP_EQ:
if (LHSCst == SubOne(RHSCst)) {// (X == 13 | X == 14) -> X-13 <u 2
Constant *AddCST = ConstantExpr::getNeg(LHSCst);
- Instruction *Add = BinaryOperator::createAdd(LHSVal, AddCST,
+ Instruction *Add = BinaryOperator::CreateAdd(LHSVal, AddCST,
LHSVal->getName()+".off");
InsertNewInstBefore(Add, I);
AddCST = Subtract(AddOne(RHSCst), LHSCst);
@@ -4604,11 +4604,11 @@
I.getType(), TD) &&
ValueRequiresCast(Op1C->getOpcode(), Op1C->getOperand(0),
I.getType(), TD)) {
- Instruction *NewOp = BinaryOperator::createOr(Op0C->getOperand(0),
+ Instruction *NewOp = BinaryOperator::CreateOr(Op0C->getOperand(0),
Op1C->getOperand(0),
I.getName());
InsertNewInstBefore(NewOp, I);
- return CastInst::create(Op0C->getOpcode(), NewOp, I.getType());
+ return CastInst::Create(Op0C->getOpcode(), NewOp, I.getType());
}
}
}
@@ -4693,13 +4693,13 @@
if (dyn_castNotVal(Op0I->getOperand(1))) Op0I->swapOperands();
if (Value *Op0NotVal = dyn_castNotVal(Op0I->getOperand(0))) {
Instruction *NotY =
- BinaryOperator::createNot(Op0I->getOperand(1),
+ BinaryOperator::CreateNot(Op0I->getOperand(1),
Op0I->getOperand(1)->getName()+".not");
InsertNewInstBefore(NotY, I);
if (Op0I->getOpcode() == Instruction::And)
- return BinaryOperator::createOr(Op0NotVal, NotY);
+ return BinaryOperator::CreateOr(Op0NotVal, NotY);
else
- return BinaryOperator::createAnd(Op0NotVal, NotY);
+ return BinaryOperator::CreateAnd(Op0NotVal, NotY);
}
}
}
@@ -4725,7 +4725,7 @@
Constant *NegOp0I0C = ConstantExpr::getNeg(Op0I0C);
Constant *ConstantRHS = ConstantExpr::getSub(NegOp0I0C,
ConstantInt::get(I.getType(), 1));
- return BinaryOperator::createAdd(Op0I->getOperand(1), ConstantRHS);
+ return BinaryOperator::CreateAdd(Op0I->getOperand(1), ConstantRHS);
}
if (ConstantInt *Op0CI = dyn_cast<ConstantInt>(Op0I->getOperand(1))) {
@@ -4733,14 +4733,14 @@
// ~(X-c) --> (-c-1)-X
if (RHS->isAllOnesValue()) {
Constant *NegOp0CI = ConstantExpr::getNeg(Op0CI);
- return BinaryOperator::createSub(
+ return BinaryOperator::CreateSub(
ConstantExpr::getSub(NegOp0CI,
ConstantInt::get(I.getType(), 1)),
Op0I->getOperand(0));
} else if (RHS->getValue().isSignBit()) {
// (X + C) ^ signbit -> (X + C + signbit)
Constant *C = ConstantInt::get(RHS->getValue() + Op0CI->getValue());
- return BinaryOperator::createAdd(Op0I->getOperand(0), C);
+ return BinaryOperator::CreateAdd(Op0I->getOperand(0), C);
}
} else if (Op0I->getOpcode() == Instruction::Or) {
@@ -4816,8 +4816,8 @@
std::swap(A, B);
if (B == Op1) { // (A|B)^B == A & ~B
Instruction *NotB =
- InsertNewInstBefore(BinaryOperator::createNot(Op1, "tmp"), I);
- return BinaryOperator::createAnd(A, NotB);
+ InsertNewInstBefore(BinaryOperator::CreateNot(Op1, "tmp"), I);
+ return BinaryOperator::CreateAnd(A, NotB);
}
} else if (match(Op0I, m_Xor(m_Value(A), m_Value(B)))) {
if (Op1 == A) // (A^B)^A == B
@@ -4830,8 +4830,8 @@
if (B == Op1 && // (B&A)^A == ~B & A
!isa<ConstantInt>(Op1)) { // Canonical form is (B&C)^C
Instruction *N =
- InsertNewInstBefore(BinaryOperator::createNot(A, "tmp"), I);
- return BinaryOperator::createAnd(N, Op1);
+ InsertNewInstBefore(BinaryOperator::CreateNot(A, "tmp"), I);
+ return BinaryOperator::CreateAnd(N, Op1);
}
}
}
@@ -4842,10 +4842,10 @@
Op0I->getOperand(1) == Op1I->getOperand(1) &&
(Op1I->hasOneUse() || Op1I->hasOneUse())) {
Instruction *NewOp =
- InsertNewInstBefore(BinaryOperator::createXor(Op0I->getOperand(0),
+ InsertNewInstBefore(BinaryOperator::CreateXor(Op0I->getOperand(0),
Op1I->getOperand(0),
Op0I->getName()), I);
- return BinaryOperator::create(Op1I->getOpcode(), NewOp,
+ return BinaryOperator::Create(Op1I->getOpcode(), NewOp,
Op1I->getOperand(1));
}
@@ -4855,13 +4855,13 @@
if (match(Op0I, m_And(m_Value(A), m_Value(B))) &&
match(Op1I, m_Or(m_Value(C), m_Value(D)))) {
if ((A == C && B == D) || (A == D && B == C))
- return BinaryOperator::createXor(A, B);
+ return BinaryOperator::CreateXor(A, B);
}
// (A | B)^(A & B) -> A ^ B
if (match(Op0I, m_Or(m_Value(A), m_Value(B))) &&
match(Op1I, m_And(m_Value(C), m_Value(D)))) {
if ((A == C && B == D) || (A == D && B == C))
- return BinaryOperator::createXor(A, B);
+ return BinaryOperator::CreateXor(A, B);
}
// (A & B)^(C & D)
@@ -4881,8 +4881,8 @@
if (X) {
Instruction *NewOp =
- InsertNewInstBefore(BinaryOperator::createXor(Y, Z, Op0->getName()), I);
- return BinaryOperator::createAnd(NewOp, X);
+ InsertNewInstBefore(BinaryOperator::CreateXor(Y, Z, Op0->getName()), I);
+ return BinaryOperator::CreateAnd(NewOp, X);
}
}
}
@@ -4903,11 +4903,11 @@
I.getType(), TD) &&
ValueRequiresCast(Op1C->getOpcode(), Op1C->getOperand(0),
I.getType(), TD)) {
- Instruction *NewOp = BinaryOperator::createXor(Op0C->getOperand(0),
+ Instruction *NewOp = BinaryOperator::CreateXor(Op0C->getOperand(0),
Op1C->getOperand(0),
I.getName());
InsertNewInstBefore(NewOp, I);
- return CastInst::create(Op0C->getOpcode(), NewOp, I.getType());
+ return CastInst::Create(Op0C->getOpcode(), NewOp, I.getType());
}
}
}
@@ -4956,7 +4956,7 @@
Result = ConstantInt::get(RC->getValue() + APInt(IntPtrWidth, Size));
else
Result = IC.InsertNewInstBefore(
- BinaryOperator::createAdd(Result,
+ BinaryOperator::CreateAdd(Result,
ConstantInt::get(IntPtrTy, Size),
GEP->getName()+".offs"), I);
continue;
@@ -4970,7 +4970,7 @@
else {
// Emit an add instruction.
Result = IC.InsertNewInstBefore(
- BinaryOperator::createAdd(Result, Scale,
+ BinaryOperator::CreateAdd(Result, Scale,
GEP->getName()+".offs"), I);
}
continue;
@@ -4988,7 +4988,7 @@
if (Constant *OpC = dyn_cast<Constant>(Op))
Op = ConstantExpr::getMul(OpC, Scale);
else // We'll let instcombine(mul) convert this to a shl if possible.
- Op = IC.InsertNewInstBefore(BinaryOperator::createMul(Op, Scale,
+ Op = IC.InsertNewInstBefore(BinaryOperator::CreateMul(Op, Scale,
GEP->getName()+".idx"), I);
}
@@ -4997,7 +4997,7 @@
Result = ConstantExpr::getAdd(cast<Constant>(Op),
cast<Constant>(Result));
else
- Result = IC.InsertNewInstBefore(BinaryOperator::createAdd(Op, Result,
+ Result = IC.InsertNewInstBefore(BinaryOperator::CreateAdd(Op, Result,
GEP->getName()+".offs"), I);
}
return Result;
@@ -5102,11 +5102,11 @@
// Okay, we can do this evaluation. Start by converting the index to intptr.
const Type *IntPtrTy = TD.getIntPtrType();
if (VariableIdx->getType() != IntPtrTy)
- VariableIdx = CastInst::createIntegerCast(VariableIdx, IntPtrTy,
+ VariableIdx = CastInst::CreateIntegerCast(VariableIdx, IntPtrTy,
true /*SExt*/,
VariableIdx->getNameStart(), &I);
Constant *OffsetVal = ConstantInt::get(IntPtrTy, NewOffs);
- return BinaryOperator::createAdd(VariableIdx, OffsetVal, "offset", &I);
+ return BinaryOperator::CreateAdd(VariableIdx, OffsetVal, "offset", &I);
}
@@ -5336,12 +5336,12 @@
switch (I.getPredicate()) {
default: assert(0 && "Invalid icmp instruction!");
case ICmpInst::ICMP_EQ: { // icmp eq bool %A, %B -> ~(A^B)
- Instruction *Xor = BinaryOperator::createXor(Op0, Op1, I.getName()+"tmp");
+ Instruction *Xor = BinaryOperator::CreateXor(Op0, Op1, I.getName()+"tmp");
InsertNewInstBefore(Xor, I);
- return BinaryOperator::createNot(Xor);
+ return BinaryOperator::CreateNot(Xor);
}
case ICmpInst::ICMP_NE: // icmp eq bool %A, %B -> A^B
- return BinaryOperator::createXor(Op0, Op1);
+ return BinaryOperator::CreateXor(Op0, Op1);
case ICmpInst::ICMP_UGT:
case ICmpInst::ICMP_SGT:
@@ -5349,9 +5349,9 @@
// FALL THROUGH
case ICmpInst::ICMP_ULT:
case ICmpInst::ICMP_SLT: { // icmp lt bool A, B -> ~X & Y
- Instruction *Not = BinaryOperator::createNot(Op0, I.getName()+"tmp");
+ Instruction *Not = BinaryOperator::CreateNot(Op0, I.getName()+"tmp");
InsertNewInstBefore(Not, I);
- return BinaryOperator::createAnd(Not, Op1);
+ return BinaryOperator::CreateAnd(Not, Op1);
}
case ICmpInst::ICMP_UGE:
case ICmpInst::ICMP_SGE:
@@ -5359,9 +5359,9 @@
// FALL THROUGH
case ICmpInst::ICMP_ULE:
case ICmpInst::ICMP_SLE: { // icmp le bool %A, %B -> ~A | B
- Instruction *Not = BinaryOperator::createNot(Op0, I.getName()+"tmp");
+ Instruction *Not = BinaryOperator::CreateNot(Op0, I.getName()+"tmp");
InsertNewInstBefore(Not, I);
- return BinaryOperator::createOr(Not, Op1);
+ return BinaryOperator::CreateOr(Not, Op1);
}
}
}
@@ -5693,7 +5693,7 @@
if (ConstantInt *C2 = dyn_cast<ConstantInt>(D))
if (Op1->hasOneUse()) {
Constant *NC = ConstantInt::get(C1->getValue() ^ C2->getValue());
- Instruction *Xor = BinaryOperator::createXor(C, NC, "tmp");
+ Instruction *Xor = BinaryOperator::CreateXor(C, NC, "tmp");
return new ICmpInst(I.getPredicate(), A,
InsertNewInstBefore(Xor, I));
}
@@ -5741,8 +5741,8 @@
}
if (X) { // Build (X^Y) & Z
- Op1 = InsertNewInstBefore(BinaryOperator::createXor(X, Y, "tmp"), I);
- Op1 = InsertNewInstBefore(BinaryOperator::createAnd(Op1, Z, "tmp"), I);
+ Op1 = InsertNewInstBefore(BinaryOperator::CreateXor(X, Y, "tmp"), I);
+ Op1 = InsertNewInstBefore(BinaryOperator::CreateAnd(Op1, Z, "tmp"), I);
I.setOperand(0, Op1);
I.setOperand(1, Constant::getNullValue(Op1->getType()));
return &I;
@@ -5956,7 +5956,7 @@
APInt NewCI = RHSV;
NewCI.zext(BitWidth);
Instruction *NewAnd =
- BinaryOperator::createAnd(Cast->getOperand(0),
+ BinaryOperator::CreateAnd(Cast->getOperand(0),
ConstantInt::get(NewCST),LHSI->getName());
InsertNewInstBefore(NewAnd, ICI);
return new ICmpInst(ICI.getPredicate(), NewAnd,
@@ -6036,18 +6036,18 @@
// Compute C << Y.
Value *NS;
if (Shift->getOpcode() == Instruction::LShr) {
- NS = BinaryOperator::createShl(AndCST,
+ NS = BinaryOperator::CreateShl(AndCST,
Shift->getOperand(1), "tmp");
} else {
// Insert a logical shift.
- NS = BinaryOperator::createLShr(AndCST,
+ NS = BinaryOperator::CreateLShr(AndCST,
Shift->getOperand(1), "tmp");
}
InsertNewInstBefore(cast<Instruction>(NS), ICI);
// Compute X & (C << Y).
Instruction *NewAnd =
- BinaryOperator::createAnd(Shift->getOperand(0), NS, LHSI->getName());
+ BinaryOperator::CreateAnd(Shift->getOperand(0), NS, LHSI->getName());
InsertNewInstBefore(NewAnd, ICI);
ICI.setOperand(0, NewAnd);
@@ -6086,7 +6086,7 @@
ConstantInt::get(APInt::getLowBitsSet(TypeBits, TypeBits-ShAmtVal));
Instruction *AndI =
- BinaryOperator::createAnd(LHSI->getOperand(0),
+ BinaryOperator::CreateAnd(LHSI->getOperand(0),
Mask, LHSI->getName()+".mask");
Value *And = InsertNewInstBefore(AndI, ICI);
return new ICmpInst(ICI.getPredicate(), And,
@@ -6102,7 +6102,7 @@
Constant *Mask = ConstantInt::get(APInt(TypeBits, 1) <<
(TypeBits-ShAmt->getZExtValue()-1));
Instruction *AndI =
- BinaryOperator::createAnd(LHSI->getOperand(0),
+ BinaryOperator::CreateAnd(LHSI->getOperand(0),
Mask, LHSI->getName()+".mask");
Value *And = InsertNewInstBefore(AndI, ICI);
@@ -6157,7 +6157,7 @@
Constant *Mask = ConstantInt::get(Val);
Instruction *AndI =
- BinaryOperator::createAnd(LHSI->getOperand(0),
+ BinaryOperator::CreateAnd(LHSI->getOperand(0),
Mask, LHSI->getName()+".mask");
Value *And = InsertNewInstBefore(AndI, ICI);
return new ICmpInst(ICI.getPredicate(), And,
@@ -6226,7 +6226,7 @@
const APInt &V = cast<ConstantInt>(BO->getOperand(1))->getValue();
if (V.sgt(APInt(V.getBitWidth(), 1)) && V.isPowerOf2()) {
Instruction *NewRem =
- BinaryOperator::createURem(BO->getOperand(0), BO->getOperand(1),
+ BinaryOperator::CreateURem(BO->getOperand(0), BO->getOperand(1),
BO->getName());
InsertNewInstBefore(NewRem, ICI);
return new ICmpInst(ICI.getPredicate(), NewRem,
@@ -6250,7 +6250,7 @@
else if (Value *NegVal = dyn_castNegVal(BOp0))
return new ICmpInst(ICI.getPredicate(), NegVal, BOp1);
else if (BO->hasOneUse()) {
- Instruction *Neg = BinaryOperator::createNeg(BOp1);
+ Instruction *Neg = BinaryOperator::CreateNeg(BOp1);
InsertNewInstBefore(Neg, ICI);
Neg->takeName(BO);
return new ICmpInst(ICI.getPredicate(), BOp0, Neg);
@@ -6487,7 +6487,7 @@
if (Constant *CI = dyn_cast<Constant>(Result))
return ReplaceInstUsesWith(ICI, ConstantExpr::getNot(CI));
else
- return BinaryOperator::createNot(Result);
+ return BinaryOperator::CreateNot(Result);
}
}
@@ -6513,7 +6513,7 @@
// See if we can turn a signed shr into an unsigned shr.
if (MaskedValueIsZero(Op0,
APInt::getSignBit(I.getType()->getPrimitiveSizeInBits())))
- return BinaryOperator::createLShr(Op0, I.getOperand(1));
+ return BinaryOperator::CreateLShr(Op0, I.getOperand(1));
return 0;
}
@@ -6581,7 +6581,7 @@
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(Op0))
if (BO->getOpcode() == Instruction::Mul && isLeftShift)
if (Constant *BOOp = dyn_cast<Constant>(BO->getOperand(1)))
- return BinaryOperator::createMul(BO->getOperand(0),
+ return BinaryOperator::CreateMul(BO->getOperand(0),
ConstantExpr::getShl(BOOp, Op1));
// Try to fold constant and into select arguments.
@@ -6604,7 +6604,7 @@
isa<ConstantInt>(TrOp->getOperand(1))) {
// Okay, we'll do this xform. Make the shift of shift.
Constant *ShAmt = ConstantExpr::getZExt(Op1, TrOp->getType());
- Instruction *NSh = BinaryOperator::create(I.getOpcode(), TrOp, ShAmt,
+ Instruction *NSh = BinaryOperator::Create(I.getOpcode(), TrOp, ShAmt,
I.getName());
InsertNewInstBefore(NSh, I); // (shift2 (shift1 & 0x00FF), c2)
@@ -6627,7 +6627,7 @@
MaskV = MaskV.lshr(Op1->getZExtValue());
}
- Instruction *And = BinaryOperator::createAnd(NSh, ConstantInt::get(MaskV),
+ Instruction *And = BinaryOperator::CreateAnd(NSh, ConstantInt::get(MaskV),
TI->getName());
InsertNewInstBefore(And, I); // shift1 & 0x00FF
@@ -6652,16 +6652,16 @@
if (isLeftShift && Op0BO->getOperand(1)->hasOneUse() &&
match(Op0BO->getOperand(1),
m_Shr(m_Value(V1), m_ConstantInt(CC))) && CC == Op1) {
- Instruction *YS = BinaryOperator::createShl(
+ Instruction *YS = BinaryOperator::CreateShl(
Op0BO->getOperand(0), Op1,
Op0BO->getName());
InsertNewInstBefore(YS, I); // (Y << C)
Instruction *X =
- BinaryOperator::create(Op0BO->getOpcode(), YS, V1,
+ BinaryOperator::Create(Op0BO->getOpcode(), YS, V1,
Op0BO->getOperand(1)->getName());
InsertNewInstBefore(X, I); // (X + (Y << C))
uint32_t Op1Val = Op1->getLimitedValue(TypeBits);
- return BinaryOperator::createAnd(X, ConstantInt::get(
+ return BinaryOperator::CreateAnd(X, ConstantInt::get(
APInt::getHighBitsSet(TypeBits, TypeBits-Op1Val)));
}
@@ -6672,16 +6672,16 @@
m_And(m_Shr(m_Value(V1), m_Value(V2)),m_ConstantInt(CC))) &&
cast<BinaryOperator>(Op0BOOp1)->getOperand(0)->hasOneUse() &&
V2 == Op1) {
- Instruction *YS = BinaryOperator::createShl(
+ Instruction *YS = BinaryOperator::CreateShl(
Op0BO->getOperand(0), Op1,
Op0BO->getName());
InsertNewInstBefore(YS, I); // (Y << C)
Instruction *XM =
- BinaryOperator::createAnd(V1, ConstantExpr::getShl(CC, Op1),
+ BinaryOperator::CreateAnd(V1, ConstantExpr::getShl(CC, Op1),
V1->getName()+".mask");
InsertNewInstBefore(XM, I); // X & (CC << C)
- return BinaryOperator::create(Op0BO->getOpcode(), YS, XM);
+ return BinaryOperator::Create(Op0BO->getOpcode(), YS, XM);
}
}
@@ -6691,16 +6691,16 @@
if (isLeftShift && Op0BO->getOperand(0)->hasOneUse() &&
match(Op0BO->getOperand(0),
m_Shr(m_Value(V1), m_ConstantInt(CC))) && CC == Op1) {
- Instruction *YS = BinaryOperator::createShl(
+ Instruction *YS = BinaryOperator::CreateShl(
Op0BO->getOperand(1), Op1,
Op0BO->getName());
InsertNewInstBefore(YS, I); // (Y << C)
Instruction *X =
- BinaryOperator::create(Op0BO->getOpcode(), V1, YS,
+ BinaryOperator::Create(Op0BO->getOpcode(), V1, YS,
Op0BO->getOperand(0)->getName());
InsertNewInstBefore(X, I); // (X + (Y << C))
uint32_t Op1Val = Op1->getLimitedValue(TypeBits);
- return BinaryOperator::createAnd(X, ConstantInt::get(
+ return BinaryOperator::CreateAnd(X, ConstantInt::get(
APInt::getHighBitsSet(TypeBits, TypeBits-Op1Val)));
}
@@ -6711,16 +6711,16 @@
m_ConstantInt(CC))) && V2 == Op1 &&
cast<BinaryOperator>(Op0BO->getOperand(0))
->getOperand(0)->hasOneUse()) {
- Instruction *YS = BinaryOperator::createShl(
+ Instruction *YS = BinaryOperator::CreateShl(
Op0BO->getOperand(1), Op1,
Op0BO->getName());
InsertNewInstBefore(YS, I); // (Y << C)
Instruction *XM =
- BinaryOperator::createAnd(V1, ConstantExpr::getShl(CC, Op1),
+ BinaryOperator::CreateAnd(V1, ConstantExpr::getShl(CC, Op1),
V1->getName()+".mask");
InsertNewInstBefore(XM, I); // X & (CC << C)
- return BinaryOperator::create(Op0BO->getOpcode(), XM, YS);
+ return BinaryOperator::Create(Op0BO->getOpcode(), XM, YS);
}
break;
@@ -6761,11 +6761,11 @@
Constant *NewRHS = ConstantExpr::get(I.getOpcode(), Op0C, Op1);
Instruction *NewShift =
- BinaryOperator::create(I.getOpcode(), Op0BO->getOperand(0), Op1);
+ BinaryOperator::Create(I.getOpcode(), Op0BO->getOperand(0), Op1);
InsertNewInstBefore(NewShift, I);
NewShift->takeName(Op0BO);
- return BinaryOperator::create(Op0BO->getOpcode(), NewShift,
+ return BinaryOperator::Create(Op0BO->getOpcode(), NewShift,
NewRHS);
}
}
@@ -6793,21 +6793,21 @@
// Check for (X << c1) << c2 and (X >> c1) >> c2
if (I.getOpcode() == ShiftOp->getOpcode()) {
- return BinaryOperator::create(I.getOpcode(), X,
+ return BinaryOperator::Create(I.getOpcode(), X,
ConstantInt::get(Ty, AmtSum));
} else if (ShiftOp->getOpcode() == Instruction::LShr &&
I.getOpcode() == Instruction::AShr) {
// ((X >>u C1) >>s C2) -> (X >>u (C1+C2)) since C1 != 0.
- return BinaryOperator::createLShr(X, ConstantInt::get(Ty, AmtSum));
+ return BinaryOperator::CreateLShr(X, ConstantInt::get(Ty, AmtSum));
} else if (ShiftOp->getOpcode() == Instruction::AShr &&
I.getOpcode() == Instruction::LShr) {
// ((X >>s C1) >>u C2) -> ((X >>s (C1+C2)) & mask) since C1 != 0.
Instruction *Shift =
- BinaryOperator::createAShr(X, ConstantInt::get(Ty, AmtSum));
+ BinaryOperator::CreateAShr(X, ConstantInt::get(Ty, AmtSum));
InsertNewInstBefore(Shift, I);
APInt Mask(APInt::getLowBitsSet(TypeBits, TypeBits - ShiftAmt2));
- return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask));
+ return BinaryOperator::CreateAnd(Shift, ConstantInt::get(Mask));
}
// Okay, if we get here, one shift must be left, and the other shift must be
@@ -6816,12 +6816,12 @@
// If we have ((X >>? C) << C), turn this into X & (-1 << C).
if (I.getOpcode() == Instruction::Shl) {
APInt Mask(APInt::getHighBitsSet(TypeBits, TypeBits - ShiftAmt1));
- return BinaryOperator::createAnd(X, ConstantInt::get(Mask));
+ return BinaryOperator::CreateAnd(X, ConstantInt::get(Mask));
}
// If we have ((X << C) >>u C), turn this into X & (-1 >>u C).
if (I.getOpcode() == Instruction::LShr) {
APInt Mask(APInt::getLowBitsSet(TypeBits, TypeBits - ShiftAmt1));
- return BinaryOperator::createAnd(X, ConstantInt::get(Mask));
+ return BinaryOperator::CreateAnd(X, ConstantInt::get(Mask));
}
// We can simplify ((X << C) >>s C) into a trunc + sext.
// NOTE: we could do this for any C, but that would make 'unusual' integer
@@ -6853,22 +6853,22 @@
assert(ShiftOp->getOpcode() == Instruction::LShr ||
ShiftOp->getOpcode() == Instruction::AShr);
Instruction *Shift =
- BinaryOperator::createShl(X, ConstantInt::get(Ty, ShiftDiff));
+ BinaryOperator::CreateShl(X, ConstantInt::get(Ty, ShiftDiff));
InsertNewInstBefore(Shift, I);
APInt Mask(APInt::getHighBitsSet(TypeBits, TypeBits - ShiftAmt2));
- return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask));
+ return BinaryOperator::CreateAnd(Shift, ConstantInt::get(Mask));
}
// (X << C1) >>u C2 --> X >>u (C2-C1) & (-1 >> C2)
if (I.getOpcode() == Instruction::LShr) {
assert(ShiftOp->getOpcode() == Instruction::Shl);
Instruction *Shift =
- BinaryOperator::createLShr(X, ConstantInt::get(Ty, ShiftDiff));
+ BinaryOperator::CreateLShr(X, ConstantInt::get(Ty, ShiftDiff));
InsertNewInstBefore(Shift, I);
APInt Mask(APInt::getLowBitsSet(TypeBits, TypeBits - ShiftAmt2));
- return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask));
+ return BinaryOperator::CreateAnd(Shift, ConstantInt::get(Mask));
}
// We can't handle (X << C1) >>s C2, it shifts arbitrary bits in.
@@ -6881,23 +6881,23 @@
assert(ShiftOp->getOpcode() == Instruction::LShr ||
ShiftOp->getOpcode() == Instruction::AShr);
Instruction *Shift =
- BinaryOperator::create(ShiftOp->getOpcode(), X,
+ BinaryOperator::Create(ShiftOp->getOpcode(), X,
ConstantInt::get(Ty, ShiftDiff));
InsertNewInstBefore(Shift, I);
APInt Mask(APInt::getHighBitsSet(TypeBits, TypeBits - ShiftAmt2));
- return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask));
+ return BinaryOperator::CreateAnd(Shift, ConstantInt::get(Mask));
}
// (X << C1) >>u C2 --> X << (C1-C2) & (-1 >> C2)
if (I.getOpcode() == Instruction::LShr) {
assert(ShiftOp->getOpcode() == Instruction::Shl);
Instruction *Shift =
- BinaryOperator::createShl(X, ConstantInt::get(Ty, ShiftDiff));
+ BinaryOperator::CreateShl(X, ConstantInt::get(Ty, ShiftDiff));
InsertNewInstBefore(Shift, I);
APInt Mask(APInt::getLowBitsSet(TypeBits, TypeBits - ShiftAmt2));
- return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask));
+ return BinaryOperator::CreateAnd(Shift, ConstantInt::get(Mask));
}
// We can't handle (X << C1) >>a C2, it shifts arbitrary bits in.
@@ -7012,14 +7012,14 @@
Amt = Multiply(cast<ConstantInt>(NumElements), cast<ConstantInt>(Amt));
// otherwise multiply the amount and the number of elements
else if (Scale != 1) {
- Instruction *Tmp = BinaryOperator::createMul(Amt, NumElements, "tmp");
+ Instruction *Tmp = BinaryOperator::CreateMul(Amt, NumElements, "tmp");
Amt = InsertNewInstBefore(Tmp, AI);
}
}
if (int Offset = (AllocElTySize*ArrayOffset)/CastElTySize) {
Value *Off = ConstantInt::get(Type::Int32Ty, Offset, true);
- Instruction *Tmp = BinaryOperator::createAdd(Amt, Off, "tmp");
+ Instruction *Tmp = BinaryOperator::CreateAdd(Amt, Off, "tmp");
Amt = InsertNewInstBefore(Tmp, AI);
}
@@ -7171,7 +7171,7 @@
case Instruction::Shl: {
Value *LHS = EvaluateInDifferentType(I->getOperand(0), Ty, isSigned);
Value *RHS = EvaluateInDifferentType(I->getOperand(1), Ty, isSigned);
- Res = BinaryOperator::create((Instruction::BinaryOps)I->getOpcode(),
+ Res = BinaryOperator::Create((Instruction::BinaryOps)I->getOpcode(),
LHS, RHS, I->getName());
break;
}
@@ -7185,7 +7185,7 @@
return I->getOperand(0);
// Otherwise, must be the same type of case, so just reinsert a new one.
- Res = CastInst::create(cast<CastInst>(I)->getOpcode(), I->getOperand(0),
+ Res = CastInst::Create(cast<CastInst>(I)->getOpcode(), I->getOperand(0),
Ty, I->getName());
break;
default:
@@ -7208,7 +7208,7 @@
isEliminableCastPair(CSrc, CI.getOpcode(), CI.getType(), TD)) {
// The first cast (CSrc) is eliminable so we need to fix up or replace
// the second cast (CI). CSrc will then have a good chance of being dead.
- return CastInst::create(opc, CSrc->getOperand(0), CI.getType());
+ return CastInst::Create(opc, CSrc->getOperand(0), CI.getType());
}
}
@@ -7403,11 +7403,11 @@
assert(SrcBitSize < DestBitSize && "Not a zext?");
Constant *C = ConstantInt::get(APInt::getLowBitsSet(DestBitSize,
SrcBitSize));
- return BinaryOperator::createAnd(Res, C);
+ return BinaryOperator::CreateAnd(Res, C);
}
case Instruction::SExt:
// We need to emit a cast to truncate, then a cast to sext.
- return CastInst::create(Instruction::SExt,
+ return CastInst::Create(Instruction::SExt,
InsertCastBefore(Instruction::Trunc, Res, Src->getType(),
CI), DestTy);
}
@@ -7434,7 +7434,7 @@
Instruction::CastOps opcode = CI.getOpcode();
Value *Op0c = InsertOperandCastBefore(opcode, Op0, DestTy, SrcI);
Value *Op1c = InsertOperandCastBefore(opcode, Op1, DestTy, SrcI);
- return BinaryOperator::create(
+ return BinaryOperator::Create(
cast<BinaryOperator>(SrcI)->getOpcode(), Op0c, Op1c);
}
}
@@ -7445,7 +7445,7 @@
Op1 == ConstantInt::getTrue() &&
(!Op0->hasOneUse() || !isa<CmpInst>(Op0))) {
Value *New = InsertOperandCastBefore(Instruction::ZExt, Op0, DestTy, &CI);
- return BinaryOperator::createXor(New, ConstantInt::get(CI.getType(), 1));
+ return BinaryOperator::CreateXor(New, ConstantInt::get(CI.getType(), 1));
}
break;
case Instruction::SDiv:
@@ -7463,7 +7463,7 @@
Op0, DestTy, SrcI);
Value *Op1c = InsertOperandCastBefore(Instruction::BitCast,
Op1, DestTy, SrcI);
- return BinaryOperator::create(
+ return BinaryOperator::Create(
cast<BinaryOperator>(SrcI)->getOpcode(), Op0c, Op1c);
}
}
@@ -7481,7 +7481,7 @@
Instruction::BitCast : Instruction::Trunc);
Value *Op0c = InsertOperandCastBefore(opcode, Op0, DestTy, SrcI);
Value *Op1c = InsertOperandCastBefore(opcode, Op1, DestTy, SrcI);
- return BinaryOperator::createShl(Op0c, Op1c);
+ return BinaryOperator::CreateShl(Op0c, Op1c);
}
break;
case Instruction::AShr:
@@ -7493,7 +7493,7 @@
uint32_t ShiftAmt = cast<ConstantInt>(Op1)->getLimitedValue(SrcBitSize);
if (SrcBitSize > ShiftAmt && SrcBitSize-ShiftAmt >= DestBitSize) {
// Insert the new logical shift right.
- return BinaryOperator::createLShr(Op0, Op1);
+ return BinaryOperator::CreateLShr(Op0, Op1);
}
}
break;
@@ -7531,7 +7531,7 @@
Value *V1 = InsertCastBefore(Instruction::Trunc, SrcIOp0, Ty, CI);
Value *V2 = InsertCastBefore(Instruction::Trunc, SrcI->getOperand(1),
Ty, CI);
- return BinaryOperator::createLShr(V1, V2);
+ return BinaryOperator::CreateLShr(V1, V2);
}
} else { // This is a variable shr.
@@ -7542,9 +7542,9 @@
Value *One = ConstantInt::get(SrcI->getType(), 1);
Value *V = InsertNewInstBefore(
- BinaryOperator::createShl(One, SrcI->getOperand(1),
+ BinaryOperator::CreateShl(One, SrcI->getOperand(1),
"tmp"), CI);
- V = InsertNewInstBefore(BinaryOperator::createAnd(V,
+ V = InsertNewInstBefore(BinaryOperator::CreateAnd(V,
SrcI->getOperand(0),
"tmp"), CI);
Value *Zero = Constant::getNullValue(V->getType());
@@ -7577,16 +7577,16 @@
Value *In = ICI->getOperand(0);
Value *Sh = ConstantInt::get(In->getType(),
In->getType()->getPrimitiveSizeInBits()-1);
- In = InsertNewInstBefore(BinaryOperator::createLShr(In, Sh,
+ In = InsertNewInstBefore(BinaryOperator::CreateLShr(In, Sh,
In->getName()+".lobit"),
CI);
if (In->getType() != CI.getType())
- In = CastInst::createIntegerCast(In, CI.getType(),
+ In = CastInst::CreateIntegerCast(In, CI.getType(),
false/*ZExt*/, "tmp", &CI);
if (ICI->getPredicate() == ICmpInst::ICMP_SGT) {
Constant *One = ConstantInt::get(In->getType(), 1);
- In = InsertNewInstBefore(BinaryOperator::createXor(In, One,
+ In = InsertNewInstBefore(BinaryOperator::CreateXor(In, One,
In->getName()+".not"),
CI);
}
@@ -7631,21 +7631,21 @@
if (ShiftAmt) {
// Perform a logical shr by shiftamt.
// Insert the shift to put the result in the low bit.
- In = InsertNewInstBefore(BinaryOperator::createLShr(In,
+ In = InsertNewInstBefore(BinaryOperator::CreateLShr(In,
ConstantInt::get(In->getType(), ShiftAmt),
In->getName()+".lobit"), CI);
}
if ((Op1CV != 0) == isNE) { // Toggle the low bit.
Constant *One = ConstantInt::get(In->getType(), 1);
- In = BinaryOperator::createXor(In, One, "tmp");
+ In = BinaryOperator::CreateXor(In, One, "tmp");
InsertNewInstBefore(cast<Instruction>(In), CI);
}
if (CI.getType() == In->getType())
return ReplaceInstUsesWith(CI, In);
else
- return CastInst::createIntegerCast(In, CI.getType(), false/*ZExt*/);
+ return CastInst::CreateIntegerCast(In, CI.getType(), false/*ZExt*/);
}
}
}
@@ -7677,12 +7677,12 @@
APInt AndValue(APInt::getLowBitsSet(SrcSize, MidSize));
Constant *AndConst = ConstantInt::get(AndValue);
Instruction *And =
- BinaryOperator::createAnd(CSrc->getOperand(0), AndConst);
+ BinaryOperator::CreateAnd(CSrc->getOperand(0), AndConst);
// Unfortunately, if the type changed, we need to cast it back.
if (And->getType() != CI.getType()) {
And->setName(CSrc->getName()+".mask");
InsertNewInstBefore(And, CI);
- And = CastInst::createIntegerCast(And, CI.getType(), false/*ZExt*/);
+ And = CastInst::CreateIntegerCast(And, CI.getType(), false/*ZExt*/);
}
return And;
}
@@ -7703,7 +7703,7 @@
transformZExtICmp(RHS, CI, false))) {
Value *LCast = InsertCastBefore(Instruction::ZExt, LHS, CI.getType(), CI);
Value *RCast = InsertCastBefore(Instruction::ZExt, RHS, CI.getType(), CI);
- return BinaryOperator::create(Instruction::Or, LCast, RCast);
+ return BinaryOperator::Create(Instruction::Or, LCast, RCast);
}
}
@@ -7732,15 +7732,15 @@
Value *In = ICI->getOperand(0);
Value *Sh = ConstantInt::get(In->getType(),
In->getType()->getPrimitiveSizeInBits()-1);
- In = InsertNewInstBefore(BinaryOperator::createAShr(In, Sh,
+ In = InsertNewInstBefore(BinaryOperator::CreateAShr(In, Sh,
In->getName()+".lobit"),
CI);
if (In->getType() != CI.getType())
- In = CastInst::createIntegerCast(In, CI.getType(),
+ In = CastInst::CreateIntegerCast(In, CI.getType(),
true/*SExt*/, "tmp", &CI);
if (ICI->getPredicate() == ICmpInst::ICMP_SGT)
- In = InsertNewInstBefore(BinaryOperator::createNot(In,
+ In = InsertNewInstBefore(BinaryOperator::CreateNot(In,
In->getName()+".not"), CI);
return ReplaceInstUsesWith(CI, In);
@@ -7817,7 +7817,7 @@
CI.getType(), CI);
RHSTrunc = InsertCastBefore(Instruction::FPExt, RHSTrunc,
CI.getType(), CI);
- return BinaryOperator::create(OpI->getOpcode(), LHSTrunc, RHSTrunc);
+ return BinaryOperator::Create(OpI->getOpcode(), LHSTrunc, RHSTrunc);
}
}
break;
@@ -8060,7 +8060,7 @@
SelectInst *NewSI = SelectInst::Create(SI.getCondition(), TI->getOperand(0),
FI->getOperand(0), SI.getName()+".v");
InsertNewInstBefore(NewSI, SI);
- return CastInst::create(Instruction::CastOps(TI->getOpcode()), NewSI,
+ return CastInst::Create(Instruction::CastOps(TI->getOpcode()), NewSI,
TI->getType());
}
@@ -8104,9 +8104,9 @@
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(TI)) {
if (MatchIsOpZero)
- return BinaryOperator::create(BO->getOpcode(), MatchOp, NewSI);
+ return BinaryOperator::Create(BO->getOpcode(), MatchOp, NewSI);
else
- return BinaryOperator::create(BO->getOpcode(), NewSI, MatchOp);
+ return BinaryOperator::Create(BO->getOpcode(), NewSI, MatchOp);
}
assert(0 && "Shouldn't get here");
return 0;
@@ -8141,33 +8141,33 @@
if (ConstantInt *C = dyn_cast<ConstantInt>(TrueVal)) {
if (C->getZExtValue()) {
// Change: A = select B, true, C --> A = or B, C
- return BinaryOperator::createOr(CondVal, FalseVal);
+ return BinaryOperator::CreateOr(CondVal, FalseVal);
} else {
// Change: A = select B, false, C --> A = and !B, C
Value *NotCond =
- InsertNewInstBefore(BinaryOperator::createNot(CondVal,
+ InsertNewInstBefore(BinaryOperator::CreateNot(CondVal,
"not."+CondVal->getName()), SI);
- return BinaryOperator::createAnd(NotCond, FalseVal);
+ return BinaryOperator::CreateAnd(NotCond, FalseVal);
}
} else if (ConstantInt *C = dyn_cast<ConstantInt>(FalseVal)) {
if (C->getZExtValue() == false) {
// Change: A = select B, C, false --> A = and B, C
- return BinaryOperator::createAnd(CondVal, TrueVal);
+ return BinaryOperator::CreateAnd(CondVal, TrueVal);
} else {
// Change: A = select B, C, true --> A = or !B, C
Value *NotCond =
- InsertNewInstBefore(BinaryOperator::createNot(CondVal,
+ InsertNewInstBefore(BinaryOperator::CreateNot(CondVal,
"not."+CondVal->getName()), SI);
- return BinaryOperator::createOr(NotCond, TrueVal);
+ return BinaryOperator::CreateOr(NotCond, TrueVal);
}
}
// select a, b, a -> a&b
// select a, a, b -> a|b
if (CondVal == TrueVal)
- return BinaryOperator::createOr(CondVal, FalseVal);
+ return BinaryOperator::CreateOr(CondVal, FalseVal);
else if (CondVal == FalseVal)
- return BinaryOperator::createAnd(CondVal, TrueVal);
+ return BinaryOperator::CreateAnd(CondVal, TrueVal);
}
// Selecting between two integer constants?
@@ -8175,13 +8175,13 @@
if (ConstantInt *FalseValC = dyn_cast<ConstantInt>(FalseVal)) {
// select C, 1, 0 -> zext C to int
if (FalseValC->isZero() && TrueValC->getValue() == 1) {
- return CastInst::create(Instruction::ZExt, CondVal, SI.getType());
+ return CastInst::Create(Instruction::ZExt, CondVal, SI.getType());
} else if (TrueValC->isZero() && FalseValC->getValue() == 1) {
// select C, 0, 1 -> zext !C to int
Value *NotCond =
- InsertNewInstBefore(BinaryOperator::createNot(CondVal,
+ InsertNewInstBefore(BinaryOperator::CreateNot(CondVal,
"not."+CondVal->getName()), SI);
- return CastInst::create(Instruction::ZExt, NotCond, SI.getType());
+ return CastInst::Create(Instruction::ZExt, NotCond, SI.getType());
}
// FIXME: Turn select 0/-1 and -1/0 into sext from condition!
@@ -8197,7 +8197,7 @@
Value *X = IC->getOperand(0);
uint32_t Bits = X->getType()->getPrimitiveSizeInBits();
Constant *ShAmt = ConstantInt::get(X->getType(), Bits-1);
- Instruction *SRA = BinaryOperator::create(Instruction::AShr, X,
+ Instruction *SRA = BinaryOperator::Create(Instruction::AShr, X,
ShAmt, "ones");
InsertNewInstBefore(SRA, SI);
@@ -8210,7 +8210,7 @@
opc = Instruction::SExt;
else if (SRASize > SISize)
opc = Instruction::Trunc;
- return CastInst::create(opc, SRA, SI.getType());
+ return CastInst::Create(opc, SRA, SI.getType());
}
}
@@ -8235,7 +8235,7 @@
ShouldNotVal ^= IC->getPredicate() == ICmpInst::ICMP_NE;
Value *V = ICA;
if (ShouldNotVal)
- V = InsertNewInstBefore(BinaryOperator::create(
+ V = InsertNewInstBefore(BinaryOperator::Create(
Instruction::Xor, V, ICA->getOperand(1)), SI);
return ReplaceInstUsesWith(SI, V);
}
@@ -8340,7 +8340,7 @@
NegVal = ConstantExpr::getNeg(C);
} else {
NegVal = InsertNewInstBefore(
- BinaryOperator::createNeg(SubOp->getOperand(1), "tmp"), SI);
+ BinaryOperator::CreateNeg(SubOp->getOperand(1), "tmp"), SI);
}
Value *NewTrueOp = OtherAddOp;
@@ -8352,7 +8352,7 @@
NewFalseOp, SI.getName() + ".p");
NewSel = InsertNewInstBefore(NewSel, SI);
- return BinaryOperator::createAdd(SubOp->getOperand(0), NewSel);
+ return BinaryOperator::CreateAdd(SubOp->getOperand(0), NewSel);
}
}
}
@@ -8380,7 +8380,7 @@
InsertNewInstBefore(NewSel, SI);
NewSel->takeName(TVI);
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(TVI))
- return BinaryOperator::create(BO->getOpcode(), FalseVal, NewSel);
+ return BinaryOperator::Create(BO->getOpcode(), FalseVal, NewSel);
else {
assert(0 && "Unknown instruction!!");
}
@@ -8406,7 +8406,7 @@
InsertNewInstBefore(NewSel, SI);
NewSel->takeName(FVI);
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(FVI))
- return BinaryOperator::create(BO->getOpcode(), TrueVal, NewSel);
+ return BinaryOperator::Create(BO->getOpcode(), TrueVal, NewSel);
else
assert(0 && "Unknown instruction!!");
}
@@ -8764,7 +8764,7 @@
i, "tmp");
InsertNewInstBefore(cast<Instruction>(Result), CI);
}
- return CastInst::create(Instruction::BitCast, Result, CI.getType());
+ return CastInst::Create(Instruction::BitCast, Result, CI.getType());
}
}
break;
@@ -9045,7 +9045,7 @@
} else {
Instruction::CastOps opcode = CastInst::getCastOpcode(*AI,
false, ParamTy, false);
- CastInst *NewCast = CastInst::create(opcode, *AI, ParamTy, "tmp");
+ CastInst *NewCast = CastInst::Create(opcode, *AI, ParamTy, "tmp");
Args.push_back(InsertNewInstBefore(NewCast, *Caller));
}
@@ -9072,7 +9072,7 @@
// Must promote to pass through va_arg area!
Instruction::CastOps opcode = CastInst::getCastOpcode(*AI, false,
PTy, false);
- Instruction *Cast = CastInst::create(opcode, *AI, PTy, "tmp");
+ Instruction *Cast = CastInst::Create(opcode, *AI, PTy, "tmp");
InsertNewInstBefore(Cast, *Caller);
Args.push_back(Cast);
} else {
@@ -9114,7 +9114,7 @@
if (NV->getType() != Type::VoidTy) {
Instruction::CastOps opcode = CastInst::getCastOpcode(NC, false,
OldRetTy, false);
- NV = NC = CastInst::create(opcode, NC, OldRetTy, "tmp");
+ NV = NC = CastInst::Create(opcode, NC, OldRetTy, "tmp");
// If this is an invoke instruction, we should insert it after the first
// non-phi, instruction in the normal successor block.
@@ -9366,9 +9366,9 @@
}
if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(FirstInst))
- return BinaryOperator::create(BinOp->getOpcode(), LHSVal, RHSVal);
+ return BinaryOperator::Create(BinOp->getOpcode(), LHSVal, RHSVal);
else if (CmpInst *CIOp = dyn_cast<CmpInst>(FirstInst))
- return CmpInst::create(CIOp->getOpcode(), CIOp->getPredicate(), LHSVal,
+ return CmpInst::Create(CIOp->getOpcode(), CIOp->getPredicate(), LHSVal,
RHSVal);
else {
assert(isa<GetElementPtrInst>(FirstInst));
@@ -9511,11 +9511,11 @@
// Insert and return the new operation.
if (CastInst* FirstCI = dyn_cast<CastInst>(FirstInst))
- return CastInst::create(FirstCI->getOpcode(), PhiVal, PN.getType());
+ return CastInst::Create(FirstCI->getOpcode(), PhiVal, PN.getType());
if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(FirstInst))
- return BinaryOperator::create(BinOp->getOpcode(), PhiVal, ConstantOp);
+ return BinaryOperator::Create(BinOp->getOpcode(), PhiVal, ConstantOp);
if (CmpInst *CIOp = dyn_cast<CmpInst>(FirstInst))
- return CmpInst::create(CIOp->getOpcode(), CIOp->getPredicate(),
+ return CmpInst::Create(CIOp->getOpcode(), CIOp->getPredicate(),
PhiVal, ConstantOp);
assert(isa<LoadInst>(FirstInst) && "Unknown operation");
@@ -9810,7 +9810,7 @@
if (isa<Constant>(SO1) && isa<Constant>(GO1))
Sum = ConstantExpr::getAdd(cast<Constant>(SO1), cast<Constant>(GO1));
else {
- Sum = BinaryOperator::createAdd(SO1, GO1, PtrOp->getName()+".sum");
+ Sum = BinaryOperator::CreateAdd(SO1, GO1, PtrOp->getName()+".sum");
InsertNewInstBefore(cast<Instruction>(Sum), GEP);
}
}
@@ -9941,7 +9941,7 @@
if (Scale->getZExtValue() != 1) {
Constant *C = ConstantExpr::getIntegerCast(Scale, NewIdx->getType(),
false /*ZExt*/);
- Instruction *Sc = BinaryOperator::createMul(NewIdx, C, "idxscale");
+ Instruction *Sc = BinaryOperator::CreateMul(NewIdx, C, "idxscale");
NewIdx = InsertNewInstBefore(Sc, GEP);
}
@@ -10375,7 +10375,7 @@
NewCast = ConstantExpr::getCast(opcode, C, CastDstTy);
else
NewCast = IC.InsertNewInstBefore(
- CastInst::create(opcode, SIOp0, CastDstTy, SIOp0->getName()+".c"),
+ CastInst::Create(opcode, SIOp0, CastDstTy, SIOp0->getName()+".c"),
SI);
return new StoreInst(NewCast, CastOp);
}
@@ -10864,7 +10864,7 @@
EI.getName()+".rhs");
InsertNewInstBefore(newEI0, EI);
InsertNewInstBefore(newEI1, EI);
- return BinaryOperator::create(BO->getOpcode(), newEI0, newEI1);
+ return BinaryOperator::Create(BO->getOpcode(), newEI0, newEI1);
}
} else if (isa<LoadInst>(I)) {
unsigned AS =
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/LoopIndexSplit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/LoopIndexSplit.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/LoopIndexSplit.cpp Thu May 15 08:08:16 2008
@@ -581,7 +581,7 @@
ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
SD.SplitValue, ExitValue, "lisplit",
Terminator);
- Instruction *NSplitCond = BinaryOperator::createAnd(C1, C2, "lisplit",
+ Instruction *NSplitCond = BinaryOperator::CreateAnd(C1, C2, "lisplit",
Terminator);
SD.SplitCondition->replaceAllUsesWith(NSplitCond);
SD.SplitCondition->eraseFromParent();
@@ -769,7 +769,7 @@
//
if (ExitCondition->getPredicate() == ICmpInst::ICMP_SLT
|| ExitCondition->getPredicate() == ICmpInst::ICMP_ULT) {
- Value *A = BinaryOperator::createAdd(NV, ConstantInt::get(Ty, 1, Sign),
+ Value *A = BinaryOperator::CreateAdd(NV, ConstantInt::get(Ty, 1, Sign),
"lsplit.add", PHTerminator);
Value *C = new ICmpInst(Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
A, UB,"lsplit,c", PHTerminator);
@@ -821,7 +821,7 @@
//
else if (ExitCondition->getPredicate() == ICmpInst::ICMP_SLE
|| ExitCondition->getPredicate() == ICmpInst::ICMP_ULE) {
- Value *S = BinaryOperator::createSub(NV, ConstantInt::get(Ty, 1, Sign),
+ Value *S = BinaryOperator::CreateSub(NV, ConstantInt::get(Ty, 1, Sign),
"lsplit.add", PHTerminator);
Value *C = new ICmpInst(Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
S, UB, "lsplit.c", PHTerminator);
@@ -857,7 +857,7 @@
// LOOP_BODY
//
{
- Value *A = BinaryOperator::createAdd(NV, ConstantInt::get(Ty, 1, Sign),
+ Value *A = BinaryOperator::CreateAdd(NV, ConstantInt::get(Ty, 1, Sign),
"lsplit.add", PHTerminator);
Value *C = new ICmpInst(Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT,
A, StartValue, "lsplit.c", PHTerminator);
@@ -1213,7 +1213,7 @@
// A;
// for (i = max(LB, BSV); i < UB; ++i)
// B;
- BSV = BinaryOperator::createAdd(SD.SplitValue,
+ BSV = BinaryOperator::CreateAdd(SD.SplitValue,
ConstantInt::get(Ty, 1, Sign),
"lsplit.add", PHTerminator);
AEV = BSV;
@@ -1244,7 +1244,7 @@
// B;
// for (i = max(LB, BSV); i < UB; ++i)
// A;
- BSV = BinaryOperator::createAdd(SD.SplitValue,
+ BSV = BinaryOperator::CreateAdd(SD.SplitValue,
ConstantInt::get(Ty, 1, Sign),
"lsplit.add", PHTerminator);
AEV = BSV;
@@ -1272,7 +1272,7 @@
// A;
// for (i = max(LB, BSV); i <= UB; ++i)
// B;
- AEV = BinaryOperator::createSub(SD.SplitValue,
+ AEV = BinaryOperator::CreateSub(SD.SplitValue,
ConstantInt::get(Ty, 1, Sign),
"lsplit.sub", PHTerminator);
break;
@@ -1288,7 +1288,7 @@
// A;
// for (i = max(LB, BSV); i <= UB; ++i)
// B;
- BSV = BinaryOperator::createAdd(SD.SplitValue,
+ BSV = BinaryOperator::CreateAdd(SD.SplitValue,
ConstantInt::get(Ty, 1, Sign),
"lsplit.add", PHTerminator);
break;
@@ -1304,7 +1304,7 @@
// B;
// for (i = max(LB, BSV); i <= UB; ++i)
// A;
- BSV = BinaryOperator::createAdd(SD.SplitValue,
+ BSV = BinaryOperator::CreateAdd(SD.SplitValue,
ConstantInt::get(Ty, 1, Sign),
"lsplit.add", PHTerminator);
break;
@@ -1321,7 +1321,7 @@
// B;
// for (i = max(LB, BSV); i <= UB; ++i)
// A;
- AEV = BinaryOperator::createSub(SD.SplitValue,
+ AEV = BinaryOperator::CreateSub(SD.SplitValue,
ConstantInt::get(Ty, 1, Sign),
"lsplit.sub", PHTerminator);
break;
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/MemCpyOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/MemCpyOptimizer.cpp Thu May 15 08:08:16 2008
@@ -583,7 +583,7 @@
for (unsigned i = 0; i < CS.arg_size(); ++i)
if (CS.getArgument(i) == cpySrc) {
if (cpySrc->getType() != cpyDest->getType())
- cpyDest = CastInst::createPointerCast(cpyDest, cpySrc->getType(),
+ cpyDest = CastInst::CreatePointerCast(cpyDest, cpySrc->getType(),
cpyDest->getName(), C);
CS.setArgument(i, cpyDest);
}
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/Reassociate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/Reassociate.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/Reassociate.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/Reassociate.cpp Thu May 15 08:08:16 2008
@@ -194,7 +194,7 @@
static Instruction *LowerNegateToMultiply(Instruction *Neg) {
Constant *Cst = ConstantInt::getAllOnesValue(Neg->getType());
- Instruction *Res = BinaryOperator::createMul(Neg->getOperand(1), Cst, "",Neg);
+ Instruction *Res = BinaryOperator::CreateMul(Neg->getOperand(1), Cst, "",Neg);
Res->takeName(Neg);
Neg->replaceAllUsesWith(Res);
Neg->eraseFromParent();
@@ -389,7 +389,7 @@
// Insert a 'neg' instruction that subtracts the value from zero to get the
// negation.
//
- return BinaryOperator::createNeg(V, V->getName() + ".neg", BI);
+ return BinaryOperator::CreateNeg(V, V->getName() + ".neg", BI);
}
/// ShouldBreakUpSubtract - Return true if we should break up this subtract of
@@ -427,7 +427,7 @@
//
Value *NegVal = NegateValue(Sub->getOperand(1), Sub);
Instruction *New =
- BinaryOperator::createAdd(Sub->getOperand(0), NegVal, "", Sub);
+ BinaryOperator::CreateAdd(Sub->getOperand(0), NegVal, "", Sub);
New->takeName(Sub);
// Everyone now refers to the add instruction.
@@ -451,7 +451,7 @@
Constant *MulCst = ConstantInt::get(Shl->getType(), 1);
MulCst = ConstantExpr::getShl(MulCst, cast<Constant>(Shl->getOperand(1)));
- Instruction *Mul = BinaryOperator::createMul(Shl->getOperand(0), MulCst,
+ Instruction *Mul = BinaryOperator::CreateMul(Shl->getOperand(0), MulCst,
"", Shl);
Mul->takeName(Shl);
Shl->replaceAllUsesWith(Mul);
@@ -485,7 +485,7 @@
Value *V1 = Ops.back();
Ops.pop_back();
Value *V2 = EmitAddTreeOfValues(I, Ops);
- return BinaryOperator::createAdd(V2, V1, "tmp", I);
+ return BinaryOperator::CreateAdd(V2, V1, "tmp", I);
}
/// RemoveFactorFromExpression - If V is an expression tree that is a
@@ -714,7 +714,7 @@
// this, we could otherwise run into situations where removing a factor
// from an expression will drop a use of maxocc, and this can cause
// RemoveFactorFromExpression on successive values to behave differently.
- Instruction *DummyInst = BinaryOperator::createAdd(MaxOccVal, MaxOccVal);
+ Instruction *DummyInst = BinaryOperator::CreateAdd(MaxOccVal, MaxOccVal);
std::vector<Value*> NewMulOps;
for (unsigned i = 0, e = Ops.size(); i != e; ++i) {
if (Value *V = RemoveFactorFromExpression(Ops[i].Op, MaxOccVal)) {
@@ -729,7 +729,7 @@
unsigned NumAddedValues = NewMulOps.size();
Value *V = EmitAddTreeOfValues(I, NewMulOps);
- Value *V2 = BinaryOperator::createMul(V, MaxOccVal, "tmp", I);
+ Value *V2 = BinaryOperator::CreateMul(V, MaxOccVal, "tmp", I);
// Now that we have inserted V and its sole use, optimize it. This allows
// us to handle cases that require multiple factoring steps, such as this:
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/Reg2Mem.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/Reg2Mem.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/Reg2Mem.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/Reg2Mem.cpp Thu May 15 08:08:16 2008
@@ -67,7 +67,7 @@
while (isa<AllocaInst>(I)) ++I;
CastInst *AllocaInsertionPoint =
- CastInst::create(Instruction::BitCast,
+ CastInst::Create(Instruction::BitCast,
Constant::getNullValue(Type::Int32Ty), Type::Int32Ty,
"reg2mem alloca point", I);
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/ScalarReplAggregates.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Scalar/ScalarReplAggregates.cpp Thu May 15 08:08:16 2008
@@ -1204,11 +1204,11 @@
// We do this to support (f.e.) loads off the end of a structure where
// only some bits are used.
if (ShAmt > 0 && (unsigned)ShAmt < NTy->getBitWidth())
- NV = BinaryOperator::createLShr(NV,
+ NV = BinaryOperator::CreateLShr(NV,
ConstantInt::get(NV->getType(),ShAmt),
LI->getName(), LI);
else if (ShAmt < 0 && (unsigned)-ShAmt < NTy->getBitWidth())
- NV = BinaryOperator::createShl(NV,
+ NV = BinaryOperator::CreateShl(NV,
ConstantInt::get(NV->getType(),-ShAmt),
LI->getName(), LI);
@@ -1308,12 +1308,12 @@
// only some bits in the structure are set.
APInt Mask(APInt::getLowBitsSet(DestWidth, SrcWidth));
if (ShAmt > 0 && (unsigned)ShAmt < DestWidth) {
- SV = BinaryOperator::createShl(SV,
+ SV = BinaryOperator::CreateShl(SV,
ConstantInt::get(SV->getType(), ShAmt),
SV->getName(), SI);
Mask <<= ShAmt;
} else if (ShAmt < 0 && (unsigned)-ShAmt < DestWidth) {
- SV = BinaryOperator::createLShr(SV,
+ SV = BinaryOperator::CreateLShr(SV,
ConstantInt::get(SV->getType(),-ShAmt),
SV->getName(), SI);
Mask = Mask.lshr(ShAmt);
@@ -1323,9 +1323,9 @@
// in the new bits.
if (SrcWidth != DestWidth) {
assert(DestWidth > SrcWidth);
- Old = BinaryOperator::createAnd(Old, ConstantInt::get(~Mask),
+ Old = BinaryOperator::CreateAnd(Old, ConstantInt::get(~Mask),
Old->getName()+".mask", SI);
- SV = BinaryOperator::createOr(Old, SV, SV->getName()+".ins", SI);
+ SV = BinaryOperator::CreateOr(Old, SV, SV->getName()+".ins", SI);
}
}
return SV;
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LowerAllocations.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LowerAllocations.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LowerAllocations.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LowerAllocations.cpp Thu May 15 08:08:16 2008
@@ -131,11 +131,11 @@
} else {
Value *Scale = MI->getOperand(0);
if (Scale->getType() != IntPtrTy)
- Scale = CastInst::createIntegerCast(Scale, IntPtrTy, false /*ZExt*/,
+ Scale = CastInst::CreateIntegerCast(Scale, IntPtrTy, false /*ZExt*/,
"", I);
// Multiply it by the array size if necessary...
- MallocArg = BinaryOperator::create(Instruction::Mul, Scale,
+ MallocArg = BinaryOperator::Create(Instruction::Mul, Scale,
MallocArg, "", I);
}
}
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LowerSwitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LowerSwitch.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LowerSwitch.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Utils/LowerSwitch.cpp Thu May 15 08:08:16 2008
@@ -202,7 +202,7 @@
} else {
// Emit V-Lo <=u Hi-Lo
Constant* NegLo = ConstantExpr::getNeg(Leaf.Low);
- Instruction* Add = BinaryOperator::createAdd(Val, NegLo,
+ Instruction* Add = BinaryOperator::CreateAdd(Val, NegLo,
Val->getName()+".off",
NewLeaf);
Constant *UpperBound = ConstantExpr::getAdd(NegLo, Leaf.High);
Modified: llvm/branches/ggreif/use-diet/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Transforms/Utils/SimplifyCFG.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Transforms/Utils/SimplifyCFG.cpp Thu May 15 08:08:16 2008
@@ -1513,7 +1513,7 @@
// Invert the predecessors condition test (xor it with true),
// which allows us to write this code once.
Value *NewCond =
- BinaryOperator::createNot(PBI->getCondition(),
+ BinaryOperator::CreateNot(PBI->getCondition(),
PBI->getCondition()->getName()+".not", PBI);
PBI->setCondition(NewCond);
BasicBlock *OldTrue = PBI->getSuccessor(0);
@@ -1534,7 +1534,7 @@
PBI->getSuccessor(0) == TrueDest ?
Instruction::Or : Instruction::And;
Value *NewCond =
- BinaryOperator::create(Opcode, PBI->getCondition(),
+ BinaryOperator::Create(Opcode, PBI->getCondition(),
New, "bothcond", PBI);
PBI->setCondition(NewCond);
if (PBI->getSuccessor(0) == BB) {
@@ -1656,17 +1656,17 @@
// Make sure we get to CommonDest on True&True directions.
Value *PBICond = PBI->getCondition();
if (PBIOp)
- PBICond = BinaryOperator::createNot(PBICond,
+ PBICond = BinaryOperator::CreateNot(PBICond,
PBICond->getName()+".not",
PBI);
Value *BICond = BI->getCondition();
if (BIOp)
- BICond = BinaryOperator::createNot(BICond,
+ BICond = BinaryOperator::CreateNot(BICond,
BICond->getName()+".not",
PBI);
// Merge the conditions.
Value *Cond =
- BinaryOperator::createOr(PBICond, BICond, "brmerge", PBI);
+ BinaryOperator::CreateOr(PBICond, BICond, "brmerge", PBI);
// Modify PBI to branch on the new condition to the new dests.
PBI->setCondition(Cond);
Modified: llvm/branches/ggreif/use-diet/lib/VMCore/AutoUpgrade.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/AutoUpgrade.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/VMCore/AutoUpgrade.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/VMCore/AutoUpgrade.cpp Thu May 15 08:08:16 2008
@@ -272,7 +272,7 @@
bool DestSExt = F->getParamAttrs().paramHasAttr(0, ParamAttr::SExt);
// Construct an appropriate cast from the new return type to the old.
- CastInst *RetCast = CastInst::create(
+ CastInst *RetCast = CastInst::Create(
CastInst::getCastOpcode(NewCI, SrcSExt,
F->getReturnType(),
DestSExt),
Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp?rev=51147&r1=51146&r2=51147&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp Thu May 15 08:08:16 2008
@@ -1445,7 +1445,7 @@
#endif
}
-BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
+BinaryOperator *BinaryOperator::Create(BinaryOps Op, Value *S1, Value *S2,
const std::string &Name,
Instruction *InsertBefore) {
assert(S1->getType() == S2->getType() &&
@@ -1453,15 +1453,15 @@
return new BinaryOperator(Op, S1, S2, S1->getType(), Name, InsertBefore);
}
-BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
+BinaryOperator *BinaryOperator::Create(BinaryOps Op, Value *S1, Value *S2,
const std::string &Name,
BasicBlock *InsertAtEnd) {
- BinaryOperator *Res = create(Op, S1, S2, Name);
+ BinaryOperator *Res = Create(Op, S1, S2, Name);
InsertAtEnd->getInstList().push_back(Res);
return Res;
}
-BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name,
+BinaryOperator *BinaryOperator::CreateNeg(Value *Op, const std::string &Name,
Instruction *InsertBefore) {
Value *zero = ConstantExpr::getZeroValueForNegationExpr(Op->getType());
return new BinaryOperator(Instruction::Sub,
@@ -1469,7 +1469,7 @@
Op->getType(), Name, InsertBefore);
}
-BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name,
+BinaryOperator *BinaryOperator::CreateNeg(Value *Op, const std::string &Name,
BasicBlock *InsertAtEnd) {
Value *zero = ConstantExpr::getZeroValueForNegationExpr(Op->getType());
return new BinaryOperator(Instruction::Sub,
@@ -1477,7 +1477,7 @@
Op->getType(), Name, InsertAtEnd);
}
-BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name,
+BinaryOperator *BinaryOperator::CreateNot(Value *Op, const std::string &Name,
Instruction *InsertBefore) {
Constant *C;
if (const VectorType *PTy = dyn_cast<VectorType>(Op->getType())) {
@@ -1491,7 +1491,7 @@
Op->getType(), Name, InsertBefore);
}
-BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name,
+BinaryOperator *BinaryOperator::CreateNot(Value *Op, const std::string &Name,
BasicBlock *InsertAtEnd) {
Constant *AllOnes;
if (const VectorType *PTy = dyn_cast<VectorType>(Op->getType())) {
@@ -1796,7 +1796,7 @@
return 0;
}
-CastInst *CastInst::create(Instruction::CastOps op, Value *S, const Type *Ty,
+CastInst *CastInst::Create(Instruction::CastOps op, Value *S, const Type *Ty,
const std::string &Name, Instruction *InsertBefore) {
// Construct and return the appropriate CastInst subclass
switch (op) {
@@ -1818,7 +1818,7 @@
return 0;
}
-CastInst *CastInst::create(Instruction::CastOps op, Value *S, const Type *Ty,
+CastInst *CastInst::Create(Instruction::CastOps op, Value *S, const Type *Ty,
const std::string &Name, BasicBlock *InsertAtEnd) {
// Construct and return the appropriate CastInst subclass
switch (op) {
@@ -1840,55 +1840,55 @@
return 0;
}
-CastInst *CastInst::createZExtOrBitCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreateZExtOrBitCast(Value *S, const Type *Ty,
const std::string &Name,
Instruction *InsertBefore) {
if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertBefore);
- return create(Instruction::ZExt, S, Ty, Name, InsertBefore);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
+ return Create(Instruction::ZExt, S, Ty, Name, InsertBefore);
}
-CastInst *CastInst::createZExtOrBitCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreateZExtOrBitCast(Value *S, const Type *Ty,
const std::string &Name,
BasicBlock *InsertAtEnd) {
if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
- return create(Instruction::ZExt, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::ZExt, S, Ty, Name, InsertAtEnd);
}
-CastInst *CastInst::createSExtOrBitCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreateSExtOrBitCast(Value *S, const Type *Ty,
const std::string &Name,
Instruction *InsertBefore) {
if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertBefore);
- return create(Instruction::SExt, S, Ty, Name, InsertBefore);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
+ return Create(Instruction::SExt, S, Ty, Name, InsertBefore);
}
-CastInst *CastInst::createSExtOrBitCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreateSExtOrBitCast(Value *S, const Type *Ty,
const std::string &Name,
BasicBlock *InsertAtEnd) {
if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
- return create(Instruction::SExt, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::SExt, S, Ty, Name, InsertAtEnd);
}
-CastInst *CastInst::createTruncOrBitCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreateTruncOrBitCast(Value *S, const Type *Ty,
const std::string &Name,
Instruction *InsertBefore) {
if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertBefore);
- return create(Instruction::Trunc, S, Ty, Name, InsertBefore);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
+ return Create(Instruction::Trunc, S, Ty, Name, InsertBefore);
}
-CastInst *CastInst::createTruncOrBitCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreateTruncOrBitCast(Value *S, const Type *Ty,
const std::string &Name,
BasicBlock *InsertAtEnd) {
if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits())
- return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
- return create(Instruction::Trunc, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::Trunc, S, Ty, Name, InsertAtEnd);
}
-CastInst *CastInst::createPointerCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreatePointerCast(Value *S, const Type *Ty,
const std::string &Name,
BasicBlock *InsertAtEnd) {
assert(isa<PointerType>(S->getType()) && "Invalid cast");
@@ -1896,12 +1896,12 @@
"Invalid cast");
if (Ty->isInteger())
- return create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd);
- return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
}
/// @brief Create a BitCast or a PtrToInt cast instruction
-CastInst *CastInst::createPointerCast(Value *S, const Type *Ty,
+CastInst *CastInst::CreatePointerCast(Value *S, const Type *Ty,
const std::string &Name,
Instruction *InsertBefore) {
assert(isa<PointerType>(S->getType()) && "Invalid cast");
@@ -1909,11 +1909,11 @@
"Invalid cast");
if (Ty->isInteger())
- return create(Instruction::PtrToInt, S, Ty, Name, InsertBefore);
- return create(Instruction::BitCast, S, Ty, Name, InsertBefore);
+ return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore);
+ return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
}
-CastInst *CastInst::createIntegerCast(Value *C, const Type *Ty,
+CastInst *CastInst::CreateIntegerCast(Value *C, const Type *Ty,
bool isSigned, const std::string &Name,
Instruction *InsertBefore) {
assert(C->getType()->isInteger() && Ty->isInteger() && "Invalid cast");
@@ -1923,10 +1923,10 @@
(SrcBits == DstBits ? Instruction::BitCast :
(SrcBits > DstBits ? Instruction::Trunc :
(isSigned ? Instruction::SExt : Instruction::ZExt)));
- return create(opcode, C, Ty, Name, InsertBefore);
+ return Create(opcode, C, Ty, Name, InsertBefore);
}
-CastInst *CastInst::createIntegerCast(Value *C, const Type *Ty,
+CastInst *CastInst::CreateIntegerCast(Value *C, const Type *Ty,
bool isSigned, const std::string &Name,
BasicBlock *InsertAtEnd) {
assert(C->getType()->isInteger() && Ty->isInteger() && "Invalid cast");
@@ -1936,10 +1936,10 @@
(SrcBits == DstBits ? Instruction::BitCast :
(SrcBits > DstBits ? Instruction::Trunc :
(isSigned ? Instruction::SExt : Instruction::ZExt)));
- return create(opcode, C, Ty, Name, InsertAtEnd);
+ return Create(opcode, C, Ty, Name, InsertAtEnd);
}
-CastInst *CastInst::createFPCast(Value *C, const Type *Ty,
+CastInst *CastInst::CreateFPCast(Value *C, const Type *Ty,
const std::string &Name,
Instruction *InsertBefore) {
assert(C->getType()->isFloatingPoint() && Ty->isFloatingPoint() &&
@@ -1949,10 +1949,10 @@
Instruction::CastOps opcode =
(SrcBits == DstBits ? Instruction::BitCast :
(SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt));
- return create(opcode, C, Ty, Name, InsertBefore);
+ return Create(opcode, C, Ty, Name, InsertBefore);
}
-CastInst *CastInst::createFPCast(Value *C, const Type *Ty,
+CastInst *CastInst::CreateFPCast(Value *C, const Type *Ty,
const std::string &Name,
BasicBlock *InsertAtEnd) {
assert(C->getType()->isFloatingPoint() && Ty->isFloatingPoint() &&
@@ -1962,7 +1962,7 @@
Instruction::CastOps opcode =
(SrcBits == DstBits ? Instruction::BitCast :
(SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt));
- return create(opcode, C, Ty, Name, InsertAtEnd);
+ return Create(opcode, C, Ty, Name, InsertAtEnd);
}
// Check whether it is valid to call getCastOpcode for these types.
@@ -2362,7 +2362,7 @@
}
CmpInst *
-CmpInst::create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2,
+CmpInst::Create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2,
const std::string &Name, Instruction *InsertBefore) {
if (Op == Instruction::ICmp) {
return new ICmpInst(CmpInst::Predicate(predicate), S1, S2, Name,
@@ -2381,7 +2381,7 @@
}
CmpInst *
-CmpInst::create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2,
+CmpInst::Create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2,
const std::string &Name, BasicBlock *InsertAtEnd) {
if (Op == Instruction::ICmp) {
return new ICmpInst(CmpInst::Predicate(predicate), S1, S2, Name,
@@ -2775,7 +2775,7 @@
}
BinaryOperator *BinaryOperator::clone() const {
- return create(getOpcode(), Op<0>(), Op<1>());
+ return Create(getOpcode(), Op<0>(), Op<1>());
}
FCmpInst* FCmpInst::clone() const {
More information about the llvm-commits
mailing list