This is an archive of the discontinued LLVM Phabricator instance.

MIR Statepoint refactoring. Part 1: Basic MI level changes.
ClosedPublic

Authored by dantrushin on Jun 11 2020, 5:06 AM.

Details

Summary

Basic support for variadic-def MIR Statepoint:

  • Change TableGen STATEPOINT description to variadic out list (For self-documentation purpose; by itself it does not affect code generation in any way).
  • Update StatepointOpers helper class to handle variadic defs.
  • Update MachineVerifier to properly handle them, too.

With this change, new Statepoint instruction can be passed through
backend (excluding ISEL) without errors.

Full change set is available at D81603.

Diff Detail

Event Timeline

dantrushin created this revision.Jun 11 2020, 5:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 11 2020, 5:06 AM

LGTM with one minor stylistic question. Can be addressed in separate change if desired.

llvm/include/llvm/CodeGen/StackMaps.h
170

Since we have MI available, why add a new variable? I'd expect the accessors to just use MI->getNumDefs() directly?

reames accepted this revision.Jun 11 2020, 8:35 PM
This revision is now accepted and ready to land.Jun 11 2020, 8:35 PM
This revision was automatically updated to reflect the committed changes.

Hi, I see CodeGen/X86/statepoint-vreg.mir failing with UBSAN enabled on our internal bots:

llvm-project/llvm/lib/CodeGen/MachineVerifier.cpp:1573:33: runtime error: reference binding to null pointer of type 'const llvm::MCOperandInfo'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior llvm-project/llvm/lib/CodeGen/MachineVerifier.cpp:1573:33 in 
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.	Program arguments: build/bin/llc -o - llvm-project/llvm/test/CodeGen/X86/statepoint-vreg.mir -start-after=finalize-isel 
FileCheck error: '<stdin>' is empty.
FileCheck command line:  build/bin/FileCheck llvm-project/llvm/test/CodeGen/X86/statepoint-vreg.mir

--

Do you mind taking a look please?

Hi, I see CodeGen/X86/statepoint-vreg.mir failing with UBSAN enabled on our internal bots:

Should be fixed already.
Does your sources include e04fe9aefd4?

Hi, I see CodeGen/X86/statepoint-vreg.mir failing with UBSAN enabled on our internal bots:

Should be fixed already.
Does your sources include e04fe9aefd4?

That's what was missing. Looks fixed now, thank you!