Simplify code, don't or a bool with an uint64_t.
[oota-llvm.git] / lib / CodeGen / Analysis.cpp
index 1a8968dd28442be81408c5d4c73abd337cbd4ad2..1f3f5a5f3836469c8fce37d65106b05257bedb4b 100644 (file)
@@ -318,7 +318,7 @@ bool llvm::isInTailCallPosition(ImmutableCallSite CS, Attributes CalleeRetAttr,
     return false;
 
   // It's not safe to eliminate the sign / zero extension of the return value.
-  if ((CallerRetAttr & Attribute::ZExt) || (CallerRetAttr & Attribute::SExt))
+  if (CallerRetAttr.hasZExtAttr() || CallerRetAttr.hasSExtAttr())
     return false;
 
   // Otherwise, make sure the unmodified return value of I is the return value.
@@ -332,7 +332,9 @@ bool llvm::isInTailCallPosition(ImmutableCallSite CS, Attributes CalleeRetAttr,
   // see if each is transparent.
   for (unsigned i = 0, e =cast<StructType>(RetVal->getType())->getNumElements();
        i != e; ++i) {
-    const Value *InScalar = getNoopInput(FindInsertedValue(RetVal, i), TLI);
+    const Value *InScalar = FindInsertedValue(RetVal, i);
+    if (InScalar == 0) return false;
+    InScalar = getNoopInput(InScalar, TLI);
     
     // If the scalar value being inserted is an extractvalue of the right index
     // from the call, then everything is good.
@@ -356,7 +358,7 @@ bool llvm::isInTailCallPosition(SelectionDAG &DAG, SDNode *Node,
     return false;
 
   // It's not safe to eliminate the sign / zero extension of the return value.
-  if ((CallerRetAttr & Attribute::ZExt) || (CallerRetAttr & Attribute::SExt))
+  if (CallerRetAttr.hasZExtAttr() || CallerRetAttr.hasSExtAttr())
     return false;
 
   // Check if the only use is a function return node.