[llvm-commits] [llvm] r119908 - in /llvm/trunk/lib: Analysis/ScalarEvolution.cpp Transforms/Scalar/MemCpyOptimizer.cpp Transforms/Scalar/ScalarReplAggregates.cpp Transforms/Utils/InlineFunction.cpp VMCore/Constants.cpp
Benjamin Kramer
benny.kra at googlemail.com
Sat Nov 20 10:43:35 PST 2010
Author: d0k
Date: Sat Nov 20 12:43:35 2010
New Revision: 119908
URL: http://llvm.org/viewvc/llvm-project?rev=119908&view=rev
Log:
Simplify code. No change in functionality.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
llvm/trunk/lib/VMCore/Constants.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=119908&r1=119907&r2=119908&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sat Nov 20 12:43:35 2010
@@ -5075,13 +5075,13 @@
trivially_true:
// Return 0 == 0.
- LHS = RHS = getConstant(Type::getInt1Ty(getContext()), 0);
+ LHS = RHS = getConstant(ConstantInt::getFalse(getContext()));
Pred = ICmpInst::ICMP_EQ;
return true;
trivially_false:
// Return 0 != 0.
- LHS = RHS = getConstant(Type::getInt1Ty(getContext()), 0);
+ LHS = RHS = getConstant(ConstantInt::getFalse(getContext()));
Pred = ICmpInst::ICMP_NE;
return true;
}
Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=119908&r1=119907&r2=119908&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Sat Nov 20 12:43:35 2010
@@ -496,7 +496,7 @@
// align
ConstantInt::get(Type::getInt32Ty(Context), Alignment),
// volatile
- ConstantInt::get(Type::getInt1Ty(Context), 0),
+ ConstantInt::getFalse(Context),
};
const Type *Tys[] = { Ops[0]->getType(), Ops[2]->getType() };
Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=119908&r1=119907&r2=119908&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Sat Nov 20 12:43:35 2010
@@ -1477,7 +1477,7 @@
EltPtr, MI->getArgOperand(1), // Dest, Value,
ConstantInt::get(MI->getArgOperand(2)->getType(), EltSize), // Size
Zero, // Align
- ConstantInt::get(Type::getInt1Ty(MI->getContext()), 0) // isVolatile
+ ConstantInt::getFalse(MI->getContext()) // isVolatile
};
const Type *Tys[] = { Ops[0]->getType(), Ops[2]->getType() };
Module *M = MI->getParent()->getParent()->getParent();
Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=119908&r1=119907&r2=119908&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Sat Nov 20 12:43:35 2010
@@ -338,7 +338,7 @@
Value *CallArgs[] = {
DestCast, SrcCast, Size,
ConstantInt::get(Type::getInt32Ty(Context), 1),
- ConstantInt::get(Type::getInt1Ty(Context), 0)
+ ConstantInt::getFalse(Context) // isVolatile
};
CallInst *TheMemCpy =
CallInst::Create(MemCpyFn, CallArgs, CallArgs+5, "", TheCall);
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=119908&r1=119907&r2=119908&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Sat Nov 20 12:43:35 2010
@@ -265,20 +265,16 @@
ConstantInt* ConstantInt::getTrue(LLVMContext &Context) {
LLVMContextImpl *pImpl = Context.pImpl;
- if (pImpl->TheTrueVal)
- return pImpl->TheTrueVal;
- else
- return (pImpl->TheTrueVal =
- ConstantInt::get(IntegerType::get(Context, 1), 1));
+ if (!pImpl->TheTrueVal)
+ pImpl->TheTrueVal = ConstantInt::get(Type::getInt1Ty(Context), 1);
+ return pImpl->TheTrueVal;
}
ConstantInt* ConstantInt::getFalse(LLVMContext &Context) {
LLVMContextImpl *pImpl = Context.pImpl;
- if (pImpl->TheFalseVal)
- return pImpl->TheFalseVal;
- else
- return (pImpl->TheFalseVal =
- ConstantInt::get(IntegerType::get(Context, 1), 0));
+ if (!pImpl->TheFalseVal)
+ pImpl->TheFalseVal = ConstantInt::get(Type::getInt1Ty(Context), 0);
+ return pImpl->TheFalseVal;
}
More information about the llvm-commits
mailing list