[PATCH] D112487: [WebAssembly] Fix debug locations for ExplicitLocals pass

Wouter van Oortmerssen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 14:06:10 PDT 2021


aardappel added a comment.

As for the changes to `DW_AT_low/high_pc` the code generated for this test is:

  000002 func[0] <foo>:
   000003: 01 7f                      | local[0] type=i32
   000005: 23 80 80 80 80 00          | global.get 0 <env.__stack_pointer>
   00000b: 41 10                      | i32.const 16
   00000d: 6b                         | i32.sub
   00000e: 22 01                      | local.tee 1
   000010: 20 00                      | local.get 0
   000012: 36 02 0c                   | i32.store 2 12
   000015: 20 01                      | local.get 1
   000017: 41 01                      | i32.const 1
   000019: 36 02 08                   | i32.store 2 8
   00001c: 20 01                      | local.get 1
   00001e: 41 02                      | i32.const 2
   000020: 36 02 04                   | i32.store 2 4
   000023: 20 01                      | local.get 1
   000025: 20 01                      | local.get 1
   000027: 28 02 04                   | i32.load 2 4
   00002a: 36 02 0c                   | i32.store 2 12
   00002d: 20 01                      | local.get 1
   00002f: 28 02 0c                   | i32.load 2 12
   000032: 20 01                      | local.get 1
   000034: 28 02 08                   | i32.load 2 8
   000037: 6a                         | i32.add
   000038: 0b                         | end

So it would seem the new offsets include the code from 0x23 to 0x34, which is the code the uses the alloca-ed vars, not the part that initializes them. But the old values end up pointing in the middle of an instruction? Was that ever correct?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112487/new/

https://reviews.llvm.org/D112487



More information about the llvm-commits mailing list