diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/GVNHoist.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/GVNHoist.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp index e1796f6bf05a..9c4cdf2feb56 100644 --- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp +++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp @@ -890,18 +890,16 @@ private: void updateAlignment(Instruction *I, Instruction *Repl) { if (auto *ReplacementLoad = dyn_cast<LoadInst>(Repl)) { - ReplacementLoad->setAlignment(MaybeAlign(std::min( - ReplacementLoad->getAlignment(), cast<LoadInst>(I)->getAlignment()))); + ReplacementLoad->setAlignment( + std::min(ReplacementLoad->getAlign(), cast<LoadInst>(I)->getAlign())); ++NumLoadsRemoved; } else if (auto *ReplacementStore = dyn_cast<StoreInst>(Repl)) { - ReplacementStore->setAlignment( - MaybeAlign(std::min(ReplacementStore->getAlignment(), - cast<StoreInst>(I)->getAlignment()))); + ReplacementStore->setAlignment(std::min(ReplacementStore->getAlign(), + cast<StoreInst>(I)->getAlign())); ++NumStoresRemoved; } else if (auto *ReplacementAlloca = dyn_cast<AllocaInst>(Repl)) { - ReplacementAlloca->setAlignment( - MaybeAlign(std::max(ReplacementAlloca->getAlignment(), - cast<AllocaInst>(I)->getAlignment()))); + ReplacementAlloca->setAlignment(std::max( + ReplacementAlloca->getAlign(), cast<AllocaInst>(I)->getAlign())); } else if (isa<CallInst>(Repl)) { ++NumCallsRemoved; } |