I've recently changed the XCore target to implement BR_JT as a jump to a series jumps. The jump table entries are expand inline in the function so there is no longer a need to emit jump tables at the end of the function. However the emission of jump tables at the end of a function is done inside the AsmPrinter base class and there seems to be no way of disabling this. This also seems to effect code produced for ARM Thumb2. Again each jump table is emitted twice - once inline in the code and once at the end of the function. The jump tables at the end of the function are unused. What would be the preferred way of dealing with this? Should I add a variable to AsmPrinter that can be set by targets to disable this emission at the end? -- Richard Osborne | XMOS http://www.xmos.com
On 23/02/10 14:58, Richard Osborne wrote:> I've recently changed the XCore target to implement BR_JT as a jump to a > series jumps. The jump table entries are expand inline in the function > so there is no longer a need to emit jump tables at the end of the > function. However the emission of jump tables at the end of a function > is done inside the AsmPrinter base class and there seems to be no way of > disabling this. > > This also seems to effect code produced for ARM Thumb2. Again each jump > table is emitted twice - once inline in the code and once at the end of > the function. The jump tables at the end of the function are unused. > > What would be the preferred way of dealing with this? Should I add a > variable to AsmPrinter that can be set by targets to disable this > emission at the end?The attached patch adds a bool to MCAsmInfo that can be used to disable the emission of jump tables at the end of a function and updates the XCore target to set this. Is this OK to commit? -- Richard Osborne | XMOS http://www.xmos.com -------------- next part -------------- A non-text attachment was scrubbed... Name: inline_jt.patch Type: text/x-patch Size: 2017 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100301/5ad9246b/attachment.bin>
On Mar 1, 2010, at 10:52 AM, Richard Osborne wrote:> On 23/02/10 14:58, Richard Osborne wrote: >> I've recently changed the XCore target to implement BR_JT as a jump to a >> series jumps. The jump table entries are expand inline in the function >> so there is no longer a need to emit jump tables at the end of the >> function. However the emission of jump tables at the end of a function >> is done inside the AsmPrinter base class and there seems to be no way of >> disabling this. >> >> This also seems to effect code produced for ARM Thumb2. Again each jump >> table is emitted twice - once inline in the code and once at the end of >> the function. The jump tables at the end of the function are unused. >> >> What would be the preferred way of dealing with this? Should I add a >> variable to AsmPrinter that can be set by targets to disable this >> emission at the end? > The attached patch adds a bool to MCAsmInfo that can be used to disable the emission of jump tables at the end of a function and updates the XCore target to set this. Is this OK to commit?Hi Richard, This shouldn't go into MCAsmInfo, it's a "lowering" issue, not a "assembly syntax" issue. ARM also has inline jump tables, how does it work? -Chris