[llvm] 3b039c6 - Revert "[WebAssembly] Fix debug locations for ExplicitLocals pass"

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 29 13:34:27 PDT 2021


Author: Sam Clegg
Date: 2021-10-29T13:34:18-07:00
New Revision: 3b039c68f2c1d9f9a9ee0b370b88ca5647ce647f

URL: https://github.com/llvm/llvm-project/commit/3b039c68f2c1d9f9a9ee0b370b88ca5647ce647f
DIFF: https://github.com/llvm/llvm-project/commit/3b039c68f2c1d9f9a9ee0b370b88ca5647ce647f.diff

LOG: Revert "[WebAssembly] Fix debug locations for ExplicitLocals pass"

This reverts commit a66451ebbe450a5e9dc6baf0c4e9f5738df589a2.

This caused a failure when integrated with emscripten:
https://ci.chromium.org/ui/p/emscripten-releases/builders/try/linux/b8832019855439718609/overview

Added: 
    

Modified: 
    llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
    llvm/test/MC/WebAssembly/debug-localvar.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
index da8b742ce8331..a933d1a4f4215 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
@@ -379,13 +379,8 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) {
         const TargetRegisterClass *RC = MRI.getRegClass(OldReg);
         Register NewReg = MRI.createVirtualRegister(RC);
         unsigned Opc = getLocalGetOpcode(RC);
-        // Use a blank DebugLoc, because InsertPt may be discontinuous from
-        // the usage of this value, causing non-linear stepping in the
-        // debugger or function entry points where variables aren't live yet.
-        // See crbug.com/1251909, crbug.com/1249745
-        DebugLoc DL;
         InsertPt =
-            BuildMI(MBB, InsertPt, DL, TII->get(Opc), NewReg)
+            BuildMI(MBB, InsertPt, MI.getDebugLoc(), TII->get(Opc), NewReg)
                 .addImm(LocalId);
         MO.setReg(NewReg);
         MFI.stackifyVReg(MRI, NewReg);

diff  --git a/llvm/test/MC/WebAssembly/debug-localvar.ll b/llvm/test/MC/WebAssembly/debug-localvar.ll
index 1de972b28868a..0174b7342fc3b 100644
--- a/llvm/test/MC/WebAssembly/debug-localvar.ll
+++ b/llvm/test/MC/WebAssembly/debug-localvar.ll
@@ -101,8 +101,8 @@ attributes #2 = { nounwind }
 ; CHECK-NEXT:                  DW_AT_type	(0x00000073 "int")
 
 ; CHECK-LABEL:     DW_TAG_lexical_block
-; CHECK-NEXT:                  DW_AT_low_pc	(0x0000001e)
-; CHECK-NEXT:                  DW_AT_high_pc	(0x0000002f)
+; CHECK-NEXT:                  DW_AT_low_pc	(0x0000001c)
+; CHECK-NEXT:                  DW_AT_high_pc	(0x0000002d)
 
 ; CHECK-LABEL:       DW_TAG_variable
 ; CHECK-NEXT:                    DW_AT_location	(DW_OP_fbreg +4)


        


More information about the llvm-commits mailing list