From 25e21a09b3f6e9ce747555e61e7d1fbaa161056f Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 11 Dec 2019 10:59:45 -0800 Subject: [PATCH] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=Off builds after D65958 and D70450 --- llvm/lib/Analysis/LoopInfo.cpp | 3 +-- llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp index e67e1ae..9a9063b 100644 --- a/llvm/lib/Analysis/LoopInfo.cpp +++ b/llvm/lib/Analysis/LoopInfo.cpp @@ -366,8 +366,7 @@ BranchInst *Loop::getLoopGuardBranch() const { return nullptr; BasicBlock *Preheader = getLoopPreheader(); - BasicBlock *Latch = getLoopLatch(); - assert(Preheader && Latch && + assert(Preheader && getLoopLatch() && "Expecting a loop with valid preheader and latch"); // Loop should be in rotate form. diff --git a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp index 1bf882b..296115c 100644 --- a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp +++ b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp @@ -906,6 +906,7 @@ AArch64LoadStoreOpt::mergePairedInsns(MachineBasicBlock::iterator I, }; forAllMIsUntilDef(*I, RegToRename, TRI, LdStLimit, UpdateMIs); +#if !defined(NDEBUG) // Make sure the register used for renaming is not used between the paired // instructions. That would trash the content before the new paired // instruction. @@ -919,6 +920,7 @@ AArch64LoadStoreOpt::mergePairedInsns(MachineBasicBlock::iterator I, }) && "Rename register used between paired instruction, trashing the " "content"); +#endif } // Insert our new paired instruction after whichever of the paired -- 2.7.4