diff options
| author | Craig Topper <craig.topper@intel.com> | 2017-07-09 07:04:00 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2017-07-09 07:04:00 +0000 |
| commit | 95d2347ae16335aa30139c0aa6c050ac3dce2ad7 (patch) | |
| tree | 71608010c6bade75672bf4fc719fc11779b8751a /llvm/tools/llvm-stress | |
| parent | a809f28956fabc28d29103aada5f72cf847efe91 (diff) | |
| download | bcm5719-llvm-95d2347ae16335aa30139c0aa6c050ac3dce2ad7.tar.gz bcm5719-llvm-95d2347ae16335aa30139c0aa6c050ac3dce2ad7.zip | |
[IR] Make use of Type::isPtrOrPtrVectorTy/isIntOrIntVectorTy/isFPOrFPVectorTy to shorten code. NFC
llvm-svn: 307491
Diffstat (limited to 'llvm/tools/llvm-stress')
| -rw-r--r-- | llvm/tools/llvm-stress/llvm-stress.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/llvm/tools/llvm-stress/llvm-stress.cpp b/llvm/tools/llvm-stress/llvm-stress.cpp index 3cf8b37bc2e..3945da7020b 100644 --- a/llvm/tools/llvm-stress/llvm-stress.cpp +++ b/llvm/tools/llvm-stress/llvm-stress.cpp @@ -385,10 +385,10 @@ struct ConstModifier: public Modifier { if (Ty->isVectorTy()) { switch (getRandom() % 2) { - case 0: if (Ty->getScalarType()->isIntegerTy()) + case 0: if (Ty->isIntOrIntVectorTy()) return PT->push_back(ConstantVector::getAllOnesValue(Ty)); break; - case 1: if (Ty->getScalarType()->isIntegerTy()) + case 1: if (Ty->isIntOrIntVectorTy()) return PT->push_back(ConstantVector::getNullValue(Ty)); } } @@ -531,8 +531,7 @@ struct CastModifier: public Modifier { } // Both types are integers: - if (VTy->getScalarType()->isIntegerTy() && - DestTy->getScalarType()->isIntegerTy()) { + if (VTy->isIntOrIntVectorTy() && DestTy->isIntOrIntVectorTy()) { if (VSize > DestSize) { return PT->push_back( new TruncInst(V, DestTy, "Tr", BB->getTerminator())); @@ -546,8 +545,7 @@ struct CastModifier: public Modifier { } // Fp to int. - if (VTy->getScalarType()->isFloatingPointTy() && - DestTy->getScalarType()->isIntegerTy()) { + if (VTy->isFPOrFPVectorTy() && DestTy->isIntOrIntVectorTy()) { if (getRandom() & 1) return PT->push_back( new FPToSIInst(V, DestTy, "FC", BB->getTerminator())); @@ -555,8 +553,7 @@ struct CastModifier: public Modifier { } // Int to fp. - if (VTy->getScalarType()->isIntegerTy() && - DestTy->getScalarType()->isFloatingPointTy()) { + if (VTy->isIntOrIntVectorTy() && DestTy->isFPOrFPVectorTy()) { if (getRandom() & 1) return PT->push_back( new SIToFPInst(V, DestTy, "FC", BB->getTerminator())); @@ -565,8 +562,7 @@ struct CastModifier: public Modifier { } // Both floats. - if (VTy->getScalarType()->isFloatingPointTy() && - DestTy->getScalarType()->isFloatingPointTy()) { + if (VTy->isFPOrFPVectorTy() && DestTy->isFPOrFPVectorTy()) { if (VSize > DestSize) { return PT->push_back( new FPTruncInst(V, DestTy, "Tr", BB->getTerminator())); |

