[llvm] [MISched] Make `getUnderlyingObjectsForInstr()` preserve unidentified objects (PR #225085)

Nathan Corbyn via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 09:54:36 PDT 2026


================
@@ -128,49 +128,44 @@ static bool getUnderlyingObjectsForInstr(const MachineInstr *MI,
                                          const MachineFrameInfo &MFI,
                                          UnderlyingObjectsVector &Objects,
                                          const DataLayout &DL) {
-  auto AllMMOsOkay = [&]() {
-    for (const MachineMemOperand *MMO : MI->memoperands()) {
-      // TODO: Figure out whether isAtomic is really necessary (see D57601).
-      if (MMO->isVolatile() || MMO->isAtomic())
-        return false;
-
-      if (const PseudoSourceValue *PSV = MMO->getPseudoValue()) {
-        // Function that contain tail calls don't have unique PseudoSourceValue
-        // objects. Two PseudoSourceValues might refer to the same or
-        // overlapping locations. The client code calling this function assumes
-        // this is not the case. So return a conservative answer of no known
-        // object.
-        if (MFI.hasTailCall())
-          return false;
-
-        // 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))
-          return false;
+  bool AllObjectsIdentified = true;
 
-        Objects.push_back(PSV);
-      } else if (const Value *V = MMO->getValue()) {
-        SmallVector<Value *, 4> Objs;
-        if (!getUnderlyingObjectsForCodeGen(V, Objs))
-          return false;
-
-        for (Value *V : Objs) {
-          assert(isIdentifiedObject(V));
-          Objects.push_back(V);
-        }
-      } else
-        return false;
+  for (const MachineMemOperand *MMO : MI->memoperands()) {
+    // TODO: Figure out whether isAtomic is really necessary (see D57601).
+    if (MMO->isVolatile() || MMO->isAtomic()) {
+      AllObjectsIdentified = false;
+      continue;
----------------
cofibrant wrote:

Good point

https://github.com/llvm/llvm-project/pull/225085


More information about the llvm-commits mailing list