Revert "[Assignment Tracking][SROA] Follow-up for failing test"
authorOCHyams <orlando.hyams@sony.com>
Mon, 28 Nov 2022 16:04:45 +0000 (16:04 +0000)
committerOCHyams <orlando.hyams@sony.com>
Mon, 28 Nov 2022 16:07:34 +0000 (16:07 +0000)
This reverts commit 285d46ef4b60c0919c00661199c1b010996cc2c1.

Failing buildbot:
https://lab.llvm.org/buildbot/#/builders/236/builds/1205

llvm/lib/Transforms/Scalar/SROA.cpp

index 1158d78..fc56ea7 100644 (file)
@@ -141,11 +141,6 @@ static void migrateDebugInfo(AllocaInst *OldAlloca,
                              uint64_t SliceSizeInBytes, Instruction *OldInst,
                              Instruction *Inst, Value *Dest, Value *Value,
                              const DataLayout &DL) {
-  auto MarkerRange = at::getAssignmentMarkers(OldInst);
-  // Nothing to do if OldInst has no linked dbg.assign intrinsics.
-  if (MarkerRange.empty())
-    return;
-
   uint64_t RelativeOffset = bytesToBits(RelativeOffsetInBytes);
   uint64_t SliceSize = bytesToBits(SliceSizeInBytes);
 
@@ -167,7 +162,8 @@ static void migrateDebugInfo(AllocaInst *OldAlloca,
   DIBuilder DIB(*OldInst->getModule(), /*AllowUnresolved*/ false);
   uint64_t AllocaSize = *OldAlloca->getAllocationSizeInBits(DL);
   assert(OldAlloca->isStaticAlloca());
-  for (DbgAssignIntrinsic *DbgAssign : MarkerRange) {
+
+  for (DbgAssignIntrinsic *DbgAssign : at::getAssignmentMarkers(OldInst)) {
     LLVM_DEBUG(dbgs() << "      existing dbg.assign is: " << *DbgAssign
                       << "\n");
     auto *Expr = DbgAssign->getExpression();