Commit 629c54a
committed
[CodeGen][LLVM] Fix MachineOperand::print crash when TII is nullptr.
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 <[email protected]>1 parent 6d98d45 commit 629c54a
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1232 | 1232 | | |
1233 | 1233 | | |
1234 | 1234 | | |
1235 | | - | |
1236 | 1235 | | |
1237 | 1236 | | |
1238 | 1237 | | |
1239 | 1238 | | |
1240 | 1239 | | |
1241 | | - | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
1242 | 1246 | | |
1243 | 1247 | | |
1244 | 1248 | | |
| |||
0 commit comments