It's not necessary to use an '%l' modifier when referencing a label.
Treat block addresses and MBB references as if the modifier is used
anyway. This prevents us from generating references to ficticious
labels.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 42908 Build 43512: arc lint + arc unit
Event Timeline
Thanks for the fix. Two minor fixes requested, then should be good to land.
llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp | ||
---|---|---|
470 | Would you mind hoisting the expression MI->getOperand(OpNo) into a local variable defined above near the definition of OpNo? It would DRY up this code. | |
llvm/test/CodeGen/X86/callbr-asm.ll | ||
135 | do we require dso_local now? (opt -verify <file> says we don't). Would you mind dropping it? |
llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp | ||
---|---|---|
470 | The compiler should do this already, because MI is const and getOperand has no side-effects. I think that's who no one has bothered to do it before. |
llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp | ||
---|---|---|
470 | Technically, here !MI->getOperand(OpNo).isBlockAddress() && !MI->getOperand(OpNo).isMBB() is tautalogically false (due to the earlier checks), so you'd only need to check for l. Maybe a comment like // %l should have been handled by the above conditions already., too would be nice. | |
470 | No doubt, but it's annoying to continually type out the full expression, hence the request to DRY up the code. Please make that change. |
llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp | ||
---|---|---|
437 | I feel like the check that OpNo >= MI->getNumOperands() should probably guard any calls to MI->getOperand(OpNo) (or that we should check the output of MI->getOperand(OpNo) for validity. Otherwise, getOperand will assert. This would allow you to hoist the two OpNo >= MI->getNumOperands() guards below. |
llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp | ||
---|---|---|
437 | This is one of the reasons why I didn't want to hoist the change out. It's more trouble than it's worth and in the end isn't that useful. I'm changing it back. |
I feel like the check that OpNo >= MI->getNumOperands() should probably guard any calls to MI->getOperand(OpNo) (or that we should check the output of MI->getOperand(OpNo) for validity. Otherwise, getOperand will assert. This would allow you to hoist the two OpNo >= MI->getNumOperands() guards below.