OSDN Git Service

[EarlyCSE] Minor cosmetic NFC changes
authorSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 16 Jun 2016 21:00:57 +0000 (21:00 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 16 Jun 2016 21:00:57 +0000 (21:00 +0000)
 - Avoid implicit conversion from pointer to bool
 - Add a comment when passing in a boolean value

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272955 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/EarlyCSE.cpp

index 48253f6..0e93b0a 100644 (file)
@@ -434,7 +434,7 @@ private:
 
     bool isInvariantLoad() const {
       if (auto *LI = dyn_cast<LoadInst>(Inst))
-        return LI->getMetadata(LLVMContext::MD_invariant_load);
+        return LI->getMetadata(LLVMContext::MD_invariant_load) != nullptr;
       return false;
     }
 
@@ -763,7 +763,7 @@ bool EarlyCSE::processNode(DomTreeNode *Node) {
         AvailableLoads.insert(
             MemInst.getPointerOperand(),
             LoadValue(Inst, CurrentGeneration, MemInst.getMatchingId(),
-                      MemInst.isAtomic(), false));
+                      MemInst.isAtomic(), /*IsInvariant=*/false));
 
         // Remember that this was the last unordered store we saw for DSE. We
         // don't yet handle DSE on ordered or volatile stores since we don't