[llvm] [IR] Fix nested constant to instruction conversion (PR #69682)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 00:11:39 PDT 2023


================
@@ -85,9 +90,11 @@ bool convertUsersOfConstantsToInstructions(ArrayRef<Constant *> Consts) {
       if (auto *C = dyn_cast<Constant>(U.get())) {
         if (ExpandableUsers.contains(C)) {
           Changed = true;
-          Instruction *NI = expandUser(BI, C);
-          InstructionWorklist.insert(NI);
-          U.set(NI);
+          auto NewInsts = expandUser(BI, C);
+          for (auto *NI : NewInsts)
+            NI->setDebugLoc(BI->getDebugLoc());
----------------
nikic wrote:

For phi nodes this will take the debug loc from the terminator of the incoming block rather than the phi node -- is that intended?

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


More information about the llvm-commits mailing list