[llvm] r285008 - Merge two if conditions into one. NFCI.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 24 12:41:48 PDT 2016
Author: davide
Date: Mon Oct 24 14:41:47 2016
New Revision: 285008
URL: http://llvm.org/viewvc/llvm-project?rev=285008&view=rev
Log:
Merge two if conditions into one. NFCI.
Modified:
llvm/trunk/lib/Transforms/Utils/GlobalStatus.cpp
Modified: llvm/trunk/lib/Transforms/Utils/GlobalStatus.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/GlobalStatus.cpp?rev=285008&r1=285007&r2=285008&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/GlobalStatus.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/GlobalStatus.cpp Mon Oct 24 14:41:47 2016
@@ -20,9 +20,8 @@ using namespace llvm;
/// and release, then return AcquireRelease.
///
static AtomicOrdering strongerOrdering(AtomicOrdering X, AtomicOrdering Y) {
- if (X == AtomicOrdering::Acquire && Y == AtomicOrdering::Release)
- return AtomicOrdering::AcquireRelease;
- if (Y == AtomicOrdering::Acquire && X == AtomicOrdering::Release)
+ if ((X == AtomicOrdering::Acquire && Y == AtomicOrdering::Release) ||
+ (Y == AtomicOrdering::Acquire && X == AtomicOrdering::Release))
return AtomicOrdering::AcquireRelease;
return (AtomicOrdering)std::max((unsigned)X, (unsigned)Y);
}
More information about the llvm-commits
mailing list