-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[Mips] When emit instruction, ignore JUMP_TABLE_DEBUG_INFO #139830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -269,6 +269,10 @@ void MipsAsmPrinter::emitInstruction(const MachineInstr *MI) { | |||
continue; | |||
} | |||
|
|||
// This instruction is only used to note jump table debug info, we | |||
// did not need to emit it. | |||
if (I->getOpcode() == TargetOpcode::JUMP_TABLE_DEBUG_INFO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it emit some debug info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I would add it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied.
2268229
to
ca5ea1b
Compare
@@ -269,6 +269,17 @@ void MipsAsmPrinter::emitInstruction(const MachineInstr *MI) { | |||
continue; | |||
} | |||
|
|||
// This instruction is only used to note jump table debug info, we | |||
// did not need to emit it. | |||
if (I->getOpcode() == TargetOpcode::JUMP_TABLE_DEBUG_INFO) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean emit a comment line into the asm output with some useful information.
This pseudo instruction is already skipped by the generic code in
The reason it got to MipsAsmPrinter is because it was bundled with
I don't think it is intentional. |
I think a better fix would be to add
|
@@ -0,0 +1,119 @@ | |||
; RUN: llc -mtriple=mipsel-windows-gnu < %s | FileCheck %s -check-prefix=MIPSEL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use an existing jumptable*.ll test and add the windows-gnu triple there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing file named jumptable_labels.ll
, I thought this file mainly focused on testing labels
, so I choose to add a new file.
Since you think this is OK, I will add a -mtriple=mips-windows-gnu there.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, applied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mips is under-maintained and I find many tests need refactoring. It's great to think about whether tests can be enhanced before adding a new one:) https://maskray.me/blog/2021-08-08-toolchain-testing#the-test-checks-too-little#i-dont-know-an-existing-test-can-be-enhanced
Good idea, thanks! |
ff7287b
to
873188e
Compare
57618e7
to
e021e15
Compare
When -triple is windows, SelectionDAGLegalize process Legalizing br_jt, would generate ISD::JUMP_TABLE_DEBUG_INFO. Then Mips process emitInstruction, would think JUMP_TABLE_DEBUG_INFO is a pseudo instruction and generate an error `Pseudo opcode found in emitInstruction()`. This instruction `TargetOpcode::JUMP_TABLE_DEBUG_INFO` is only used to note jump table debug info, so we can ignore it when Mips emit instruction. Fix llvm#134916.
e021e15
to
f96fcca
Compare
@wzssyqa @s-barannikov Ping. |
When -triple is windows, SelectionDAGLegalize process Legalizing br_jt, would generate ISD::JUMP_TABLE_DEBUG_INFO.
Then Mips process emitInstruction, would think JUMP_TABLE_DEBUG_INFO is a pseudo instruction and generate an error
Pseudo opcode found in emitInstruction()
.This instruction
TargetOpcode::JUMP_TABLE_DEBUG_INFO
is only used to note jump table debug info, so we can ignore it when Mips emit instruction.Fix #134916.