Teach combineMetadata how to merge 'nonnull' metadata.
[oota-llvm.git] / lib / Transforms / Utils / Local.cpp
index ecbe94a7e39a8e29177a7b6062d3b7497e4037ca..ef54eb20446b721c6856e402006ca7770a0d9743 100644 (file)
@@ -1339,6 +1339,10 @@ void llvm::combineMetadata(Instruction *K, const Instruction *J, ArrayRef<unsign
         // Only set the !invariant.load if it is present in both instructions.
         K->setMetadata(Kind, JMD);
         break;
+      case LLVMContext::MD_nonnull:
+        // Only set the !nonnull if it is present in both instructions.
+        K->setMetadata(Kind, JMD);
+        break;
     }
   }
 }