summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-01-30 17:38:55 +0000
committerSanjay Patel <spatel@rotateright.com>2017-01-30 17:38:55 +0000
commit062c14af5c49f7f55de1d671c106a7cd8598704c (patch)
treecee4a0386560f983ab32318d644316838eb85b41 /llvm/lib
parent77732d5033d6efab4a321c904e1eb4a12e7b2ecf (diff)
downloadbcm5719-llvm-062c14af5c49f7f55de1d671c106a7cd8598704c.tar.gz
bcm5719-llvm-062c14af5c49f7f55de1d671c106a7cd8598704c.zip
[InstCombine] use auto with obvious type; NFC
llvm-svn: 293508
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
index 5c86c3e28db..fb90814b6ec 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
@@ -678,7 +678,7 @@ Instruction *InstCombiner::visitShl(BinaryOperator &I) {
// The inexact version is deferred to DAGCombine, so we don't hide shl
// behind a bit mask.
Constant *ShiftDiffCst = ConstantInt::get(Ty, *ShAmtAPInt - *ShrAmt);
- auto *NewShl = BinaryOperator::Create(Instruction::Shl, X, ShiftDiffCst);
+ auto *NewShl = BinaryOperator::CreateShl(X, ShiftDiffCst);
NewShl->setHasNoUnsignedWrap(I.hasNoUnsignedWrap());
NewShl->setHasNoSignedWrap(I.hasNoSignedWrap());
return NewShl;
@@ -751,7 +751,7 @@ Instruction *InstCombiner::visitLShr(BinaryOperator &I) {
Constant *ShiftDiff = ConstantInt::get(Ty, ShAmt - ShlAmt);
if (cast<BinaryOperator>(Op0)->hasNoUnsignedWrap()) {
// (X <<nuw C1) >>u C2 --> X >>u (C2 - C1)
- BinaryOperator *NewLShr = BinaryOperator::CreateLShr(X, ShiftDiff);
+ auto *NewLShr = BinaryOperator::CreateLShr(X, ShiftDiff);
NewLShr->setIsExact(I.isExact());
return NewLShr;
}
@@ -804,7 +804,7 @@ Instruction *InstCombiner::visitAShr(BinaryOperator &I) {
ShlAmtAPInt->ult(*ShAmtAPInt)) {
// (X <<nsw C1) >>s C2 --> X >>s (C2 - C1)
Constant *ShiftDiff = ConstantInt::get(Ty, *ShAmtAPInt - *ShlAmtAPInt);
- BinaryOperator *NewAShr = BinaryOperator::CreateAShr(X, ShiftDiff);
+ auto *NewAShr = BinaryOperator::CreateAShr(X, ShiftDiff);
NewAShr->setIsExact(I.isExact());
return NewAShr;
}
OpenPOWER on IntegriCloud