OSDN Git Service

[IR] Add Type::isIntOrIntVectorTy(unsigned) similar to the existing isIntegerTy(unsig...
[android-x86/external-llvm.git] / lib / Transforms / InstCombine / InstCombineSelect.cpp
index 7510067..4eebe82 100644 (file)
@@ -1021,7 +1021,7 @@ Instruction *InstCombiner::foldSelectExtConst(SelectInst &Sel) {
   // TODO: Handle larger types? That requires adjusting FoldOpIntoSelect too.
   Value *X = ExtInst->getOperand(0);
   Type *SmallType = X->getType();
-  if (!SmallType->getScalarType()->isIntegerTy(1))
+  if (!SmallType->isIntOrIntVectorTy(1))
     return nullptr;
 
   Constant *C;
@@ -1181,7 +1181,7 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) {
     return &SI;
   }
 
-  if (SelType->getScalarType()->isIntegerTy(1) &&
+  if (SelType->isIntOrIntVectorTy(1) &&
       TrueVal->getType() == CondVal->getType()) {
     if (match(TrueVal, m_One())) {
       // Change: A = select B, true, C --> A = or B, C