[llvm] r315223 - [InstCombine] fix formatting; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 9 10:54:46 PDT 2017
Author: spatel
Date: Mon Oct 9 10:54:46 2017
New Revision: 315223
URL: http://llvm.org/viewvc/llvm-project?rev=315223&view=rev
Log:
[InstCombine] fix formatting; NFC
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp?rev=315223&r1=315222&r2=315223&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineVectorOps.cpp Mon Oct 9 10:54:46 2017
@@ -986,15 +986,13 @@ InstCombiner::EvaluateInDifferentElement
// Mask.size() does not need to be equal to the number of vector elements.
assert(V->getType()->isVectorTy() && "can't reorder non-vector elements");
- if (isa<UndefValue>(V)) {
- return UndefValue::get(VectorType::get(V->getType()->getScalarType(),
- Mask.size()));
- }
- if (isa<ConstantAggregateZero>(V)) {
- return ConstantAggregateZero::get(
- VectorType::get(V->getType()->getScalarType(),
- Mask.size()));
- }
+ Type *EltTy = V->getType()->getScalarType();
+ if (isa<UndefValue>(V))
+ return UndefValue::get(VectorType::get(EltTy, Mask.size()));
+
+ if (isa<ConstantAggregateZero>(V))
+ return ConstantAggregateZero::get(VectorType::get(EltTy, Mask.size()));
+
if (Constant *C = dyn_cast<Constant>(V)) {
SmallVector<Constant *, 16> MaskValues;
for (int i = 0, e = Mask.size(); i != e; ++i) {
More information about the llvm-commits
mailing list