From a2e505ede0021c16dc03e7d7c287aefd1a325bf0 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Mon, 10 Apr 2017 23:08:35 +0000 Subject: [PATCH] [NewGVN] Surround with parens to clarify allegedly ambiguous precedence. This Placates GCC7 with -Werror. Also, clang-format the assertions while I'm here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299895 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/NewGVN.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/Transforms/Scalar/NewGVN.cpp b/lib/Transforms/Scalar/NewGVN.cpp index e13ca93c237..1e6692482bd 100644 --- a/lib/Transforms/Scalar/NewGVN.cpp +++ b/lib/Transforms/Scalar/NewGVN.cpp @@ -1683,8 +1683,8 @@ const MemoryAccess *NewGVN::getNextMemoryLeader(CongruenceClass *CC) const { // TODO: If this ends up to slow, we can maintain a next memory leader like we // do for regular leaders. // Make sure there will be a leader to find - assert(CC->getStoreCount() > 0 || - !CC->memory_empty() && "Can't get next leader if there is none"); + assert((CC->getStoreCount() > 0 || !CC->memory_empty()) && + "Can't get next leader if there is none"); if (CC->getStoreCount() > 0) { if (auto *NL = dyn_cast_or_null(CC->getNextLeader().first)) return MSSA->getMemoryAccess(NL); @@ -1738,10 +1738,10 @@ void NewGVN::moveMemoryToNewCongruenceClass(Instruction *I, CongruenceClass *NewClass) { // If the leader is I, and we had a represenative MemoryAccess, it should // be the MemoryAccess of OldClass. - assert(!InstMA || !OldClass->getMemoryLeader() || - OldClass->getLeader() != I || - OldClass->getMemoryLeader() == InstMA && - "Representative MemoryAccess mismatch"); + assert((!InstMA || !OldClass->getMemoryLeader() || + OldClass->getLeader() != I || + OldClass->getMemoryLeader() == InstMA) && + "Representative MemoryAccess mismatch"); // First, see what happens to the new class if (!NewClass->getMemoryLeader()) { // Should be a new class, or a store becoming a leader of a new class. @@ -1941,11 +1941,11 @@ void NewGVN::performCongruenceFinding(Instruction *I, const Expression *E) { } else { EClass = lookupResult.first->second; if (isa(E)) - assert(isa(EClass->getLeader()) || - (EClass->getStoredValue() && - isa(EClass->getStoredValue())) && - "Any class with a constant expression should have a " - "constant leader"); + assert((isa(EClass->getLeader()) || + (EClass->getStoredValue() && + isa(EClass->getStoredValue()))) && + "Any class with a constant expression should have a " + "constant leader"); assert(EClass && "Somehow don't have an eclass"); @@ -2350,11 +2350,10 @@ void NewGVN::verifyMemoryCongruency() const { if (CC == TOPClass || CC->isDead()) continue; if (CC->getStoreCount() != 0) { - assert(CC->getStoredValue() || - !isa(CC->getLeader()) && - "Any class with a store as a " - "leader should have a " - "representative stored value\n"); + assert((CC->getStoredValue() || !isa(CC->getLeader())) && + "Any class with a store as a " + "leader should have a " + "representative stored value\n"); assert(CC->getMemoryLeader() && "Any congruence class with a store should " "have a representative access\n"); -- 2.50.1