[llvm] r176765 - Simplify code. No functionality change.
Jakub Staszak
kubastaszak at gmail.com
Sat Mar 9 03:19:00 PST 2013
Author: kuba
Date: Sat Mar 9 05:18:59 2013
New Revision: 176765
URL: http://llvm.org/viewvc/llvm-project?rev=176765&view=rev
Log:
Simplify code. No functionality change.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp?rev=176765&r1=176764&r2=176765&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp Sat Mar 9 05:18:59 2013
@@ -22,8 +22,8 @@ using namespace PatternMatch;
/// AddOne - Add one to a ConstantInt.
-static Constant *AddOne(Constant *C) {
- return ConstantExpr::getAdd(C, ConstantInt::get(C->getType(), 1));
+static Constant *AddOne(ConstantInt *C) {
+ return ConstantInt::get(C->getContext(), C->getValue() + 1);
}
/// SubOne - Subtract one from a ConstantInt.
static Constant *SubOne(ConstantInt *C) {
More information about the llvm-commits
mailing list