[llvm] r226491 - IR: Simplify handleChangedOperand() fast path, NFC

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Jan 19 11:28:28 PST 2015


Author: dexonsmith
Date: Mon Jan 19 13:28:28 2015
New Revision: 226491

URL: http://llvm.org/viewvc/llvm-project?rev=226491&view=rev
Log:
IR: Simplify handleChangedOperand() fast path, NFC

Use `isUniqued()` instead of `isStoredDistinctInContext()`, and remove
an assertion that won't be valid once temporaries are merged back in.

Modified:
    llvm/trunk/lib/IR/Metadata.cpp

Modified: llvm/trunk/lib/IR/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Metadata.cpp?rev=226491&r1=226490&r2=226491&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Metadata.cpp (original)
+++ llvm/trunk/lib/IR/Metadata.cpp Mon Jan 19 13:28:28 2015
@@ -524,9 +524,7 @@ void UniquableMDNode::handleChangedOpera
   unsigned Op = static_cast<MDOperand *>(Ref) - op_begin();
   assert(Op < getNumOperands() && "Expected valid operand");
 
-  if (isStoredDistinctInContext()) {
-    assert(isResolved() && "Expected distinct node to be resolved");
-
+  if (!isUniqued()) {
     // This node is not uniqued.  Just set the operand and be done with it.
     setOperand(Op, New);
     return;





More information about the llvm-commits mailing list