OSDN Git Service

[NewGVN] Simplify findConditionEquivalence(). NFCI.
authorDavide Italiano <davide@freebsd.org>
Mon, 19 Jun 2017 16:46:15 +0000 (16:46 +0000)
committerDavide Italiano <davide@freebsd.org>
Mon, 19 Jun 2017 16:46:15 +0000 (16:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305707 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/NewGVN.cpp

index c3a593e..1d74e20 100644 (file)
@@ -2329,9 +2329,7 @@ void NewGVN::updateReachableEdge(BasicBlock *From, BasicBlock *To) {
 // see if we know some constant value for it already.
 Value *NewGVN::findConditionEquivalence(Value *Cond) const {
   auto Result = lookupOperandLeader(Cond);
-  if (isa<Constant>(Result))
-    return Result;
-  return nullptr;
+  return isa<Constant>(Result) ? Result : nullptr;
 }
 
 // Process the outgoing edges of a block for reachability.