diff options
Diffstat (limited to 'llvm/lib/IR/Instruction.cpp')
| -rw-r--r-- | llvm/lib/IR/Instruction.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp index a4659da7e807..4480ec799c35 100644 --- a/llvm/lib/IR/Instruction.cpp +++ b/llvm/lib/IR/Instruction.cpp @@ -166,7 +166,10 @@ void Instruction::dropPoisonGeneratingFlags() { cast<GetElementPtrInst>(this)->setIsInBounds(false); break; } - // TODO: FastMathFlags! + if (isa<FPMathOperator>(this)) { + setHasNoNaNs(false); + setHasNoInfs(false); + } assert(!hasPoisonGeneratingFlags() && "must be kept in sync"); } @@ -436,17 +439,17 @@ static bool haveSameSpecialState(const Instruction *I1, const Instruction *I2, if (const AllocaInst *AI = dyn_cast<AllocaInst>(I1)) return AI->getAllocatedType() == cast<AllocaInst>(I2)->getAllocatedType() && - (AI->getAlignment() == cast<AllocaInst>(I2)->getAlignment() || + (AI->getAlign() == cast<AllocaInst>(I2)->getAlign() || IgnoreAlignment); if (const LoadInst *LI = dyn_cast<LoadInst>(I1)) return LI->isVolatile() == cast<LoadInst>(I2)->isVolatile() && - (LI->getAlignment() == cast<LoadInst>(I2)->getAlignment() || + (LI->getAlign() == cast<LoadInst>(I2)->getAlign() || IgnoreAlignment) && LI->getOrdering() == cast<LoadInst>(I2)->getOrdering() && LI->getSyncScopeID() == cast<LoadInst>(I2)->getSyncScopeID(); if (const StoreInst *SI = dyn_cast<StoreInst>(I1)) return SI->isVolatile() == cast<StoreInst>(I2)->isVolatile() && - (SI->getAlignment() == cast<StoreInst>(I2)->getAlignment() || + (SI->getAlign() == cast<StoreInst>(I2)->getAlign() || IgnoreAlignment) && SI->getOrdering() == cast<StoreInst>(I2)->getOrdering() && SI->getSyncScopeID() == cast<StoreInst>(I2)->getSyncScopeID(); |
