This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Preserve debug frame base information through register coloring
ClosedPublic

Authored by dschuff on Jan 28 2020, 2:18 PM.

Details

Summary

2 fixes:

  • Register coloring can re-assign virtual registers. When the frame base register is colored, update the DwarfFrameBase accordingly
  • When the frame base register is stackified, do not attempt to encode DW_AT_frame_base as a local

In the future we will presumably want to handle this case better but for now we can emit worse debug info rather than crashing.

Diff Detail

Event Timeline

dschuff created this revision.Jan 28 2020, 2:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 28 2020, 2:18 PM

Unit tests: fail. 62274 tests passed, 1 failed and 827 were skipped.

failed: Clang.CodeGenOpenCL/amdgpu-features.cl

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

dschuff updated this revision to Diff 241021.Jan 28 2020, 4:28 PM
  • * When stackifying the frame base, unset frameBaseVreg
dschuff retitled this revision from [WIP] Preserve debug frame base information through register coloring to [WebAssembly] Preserve debug frame base information through register coloring.Jan 28 2020, 4:31 PM
dschuff edited the summary of this revision. (Show Details)
dschuff added reviewers: azakai, aardappel.
kripken accepted this revision.Jan 28 2020, 4:43 PM
kripken added a subscriber: kripken.

Makes sense to me, nice. Also verified no crashes on wasm0 and wasm3 on the emscripten test suite.

This revision is now accepted and ready to land.Jan 28 2020, 4:43 PM
dschuff updated this revision to Diff 241022.Jan 28 2020, 4:44 PM
  • clang-format

Unit tests: fail. 62275 tests passed, 1 failed and 827 were skipped.

failed: Clang.CodeGenOpenCL/amdgpu-features.cl

clang-tidy: pass.

clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

I'll go ahead and land this to reduce the number of cases where we crash; but I'd be interested in hearing if @yurydelendik has found any cases that were asserting before that this fixes, or if any of the wasm subscribers have other opinions.

Unit tests: fail. 62275 tests passed, 1 failed and 827 were skipped.

failed: Clang.CodeGenOpenCL/amdgpu-features.cl

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

This revision was automatically updated to reflect the committed changes.

I'll go ahead and land this to reduce the number of cases where we crash; but I'd be interested in hearing if @yurydelendik has found any cases that were asserting before that this fixes, or if any of the wasm subscribers have other opinions.

Disabling frame base register in some hard cases is the right approach. I did not see any such crashes/cases yet.