[llvm] r295237 - [InstCombine] improve formatting; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 15 13:31:34 PST 2017
Author: spatel
Date: Wed Feb 15 15:31:34 2017
New Revision: 295237
URL: http://llvm.org/viewvc/llvm-project?rev=295237&view=rev
Log:
[InstCombine] improve formatting; NFC
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp?rev=295237&r1=295236&r2=295237&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp Wed Feb 15 15:31:34 2017
@@ -1062,12 +1062,9 @@ Instruction *InstCombiner::visitAdd(Bina
match(LHS, m_ZExt(m_NUWAdd(m_Value(X), m_APInt(C)))) &&
Val->sge(-C->sext(Val->getBitWidth()))) {
// (add (zext (add nuw X, C)), Val) -> (zext (add nuw X, C+Val))
- return CastInst::Create(
- Instruction::ZExt,
- Builder->CreateNUWAdd(
- X, Constant::getIntegerValue(X->getType(),
- *C + Val->trunc(C->getBitWidth()))),
- I.getType());
+ Constant *NewC =
+ ConstantInt::get(X->getType(), *C + Val->trunc(C->getBitWidth()));
+ return new ZExtInst(Builder->CreateNUWAdd(X, NewC), I.getType());
}
}
More information about the llvm-commits
mailing list