[all-commits] [llvm/llvm-project] b3397b: [CodeGen][LLVM] Fix MachineOperand::print crash wh...

z via All-commits all-commits at lists.llvm.org
Fri Apr 11 00:27:17 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b3397bacfb85aa824e1257085500551d3026d49a
      https://github.com/llvm/llvm-project/commit/b3397bacfb85aa824e1257085500551d3026d49a
  Author: z <feqin1023 at gmail.com>
  Date:   2025-04-11 (Fri, 11 Apr 2025)

  Changed paths:
    M llvm/lib/CodeGen/MachineOperand.cpp

  Log Message:
  -----------
  [CodeGen][LLVM] Fix MachineOperand::print crash when TII is nullptr. (#135170)

This crash will caused if run this testcase:
  llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.gws.barrier-fastregalloc.ll

When build the SDNode, precisely build the SDNode for this ir:
```ir
  call void @llvm.amdgcn.ds.gws.barrier(i32 %val, i32 0)
```
If want call the dump function of the new SDNode in the gdb environment
like this:
```gdb
  p N->dump()
```
The llvm will crash.

All of these is because calling ```dump()``` will cause the
calling```MachineMemOperand::print()```
with the argument value for the```TII``` is nullptr. 
And the llvm/lib/CodeGen/MachineOperand.cpp#L1235 is a derefrence of
TII.

Signed-off-by: fanfuqiang <fuqiang.fan at mthreads.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list