Simplify the implementation of getUnderlyingObjectsForInstr, without intending to...
authorNick Lewycky <nicholas@mxc.ca>
Thu, 20 Feb 2014 05:06:26 +0000 (05:06 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Thu, 20 Feb 2014 05:06:26 +0000 (05:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201754 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ScheduleDAGInstrs.cpp

index f0de7982b12b25abe045a2df23abf9467823025c..376b6f2208314ac115de6a656cd43019e7c143aa 100644 (file)
@@ -148,31 +148,30 @@ static void getUnderlyingObjectsForInstr(const MachineInstr *MI,
   if (!V)
     return;
 
+  if (const PseudoSourceValue *PSV = dyn_cast<PseudoSourceValue>(V)) {
+    // For now, ignore PseudoSourceValues which may alias LLVM IR values
+    // because the code that uses this function has no way to cope with
+    // such aliases.
+    if (!PSV->isAliased(MFI))
+      Objects.push_back(UnderlyingObjectsVector::value_type(V, false));
+    return;
+  }
+
   SmallVector<Value *, 4> Objs;
   getUnderlyingObjects(V, Objs);
 
   for (SmallVectorImpl<Value *>::iterator I = Objs.begin(), IE = Objs.end();
          I != IE; ++I) {
-    bool MayAlias = true;
     V = *I;
 
-    if (const PseudoSourceValue *PSV = dyn_cast<PseudoSourceValue>(V)) {
-      // For now, ignore PseudoSourceValues which may alias LLVM IR values
-      // because the code that uses this function has no way to cope with
-      // such aliases.
-
-      if (PSV->isAliased(MFI)) {
-        Objects.clear();
-        return;
-      }
+    assert(!isa<PseudoSourceValue>(V) && "Underlying value is a stack slot!");
 
-      MayAlias = PSV->mayAlias(MFI);
-    } else if (!isIdentifiedObject(V)) {
+    if (!isIdentifiedObject(V)) {
       Objects.clear();
       return;
     }
 
-    Objects.push_back(UnderlyingObjectsVector::value_type(V, MayAlias));
+    Objects.push_back(UnderlyingObjectsVector::value_type(V, true));
   }
 }