diff options
Diffstat (limited to 'contrib/llvm-project/llvm/tools/llvm-stress/llvm-stress.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/tools/llvm-stress/llvm-stress.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/contrib/llvm-project/llvm/tools/llvm-stress/llvm-stress.cpp b/contrib/llvm-project/llvm/tools/llvm-stress/llvm-stress.cpp index 639506c7d488..d1cf1607b94b 100644 --- a/contrib/llvm-project/llvm/tools/llvm-stress/llvm-stress.cpp +++ b/contrib/llvm-project/llvm/tools/llvm-stress/llvm-stress.cpp @@ -222,7 +222,7 @@ protected: } else if (Tp->isFloatingPointTy()) { if (getRandom() & 1) return ConstantFP::getAllOnesValue(Tp); - return ConstantFP::getNullValue(Tp); + return ConstantFP::getZero(Tp); } return UndefValue::get(Tp); } @@ -244,7 +244,7 @@ protected: } else if (Tp->isFloatingPointTy()) { if (getRandom() & 1) return ConstantFP::getAllOnesValue(Tp); - return ConstantFP::getNullValue(Tp); + return ConstantFP::getZero(Tp); } else if (auto *VTp = dyn_cast<FixedVectorType>(Tp)) { std::vector<Constant*> TempValues; TempValues.reserve(VTp->getNumElements()); @@ -341,9 +341,7 @@ struct LoadModifier: public Modifier { void Act() override { // Try to use predefined pointers. If non-exist, use undef pointer value; Value *Ptr = getRandomPointerValue(); - Type *Ty = Ptr->getType()->isOpaquePointerTy() - ? pickType() - : Ptr->getType()->getNonOpaquePointerElementType(); + Type *Ty = pickType(); Value *V = new LoadInst(Ty, Ptr, "L", BB->getTerminator()); PT->push_back(V); } @@ -356,9 +354,7 @@ struct StoreModifier: public Modifier { void Act() override { // Try to use predefined pointers. If non-exist, use undef pointer value; Value *Ptr = getRandomPointerValue(); - Type *ValTy = Ptr->getType()->isOpaquePointerTy() - ? pickType() - : Ptr->getType()->getNonOpaquePointerElementType(); + Type *ValTy = pickType(); // Do not store vectors of i1s because they are unsupported // by the codegen. @@ -442,7 +438,7 @@ struct ConstModifier: public Modifier { APFloat RandomFloat(Ty->getFltSemantics(), RandomInt); if (getRandom() & 1) - return PT->push_back(ConstantFP::getNullValue(Ty)); + return PT->push_back(ConstantFP::getZero(Ty)); return PT->push_back(ConstantFP::get(Ty->getContext(), RandomFloat)); } |