search for: jumptable

Displaying 20 results from an estimated 105 matches for "jumptable".

2014 Oct 05
2
[LLVMdev] Question about jumptable and indirect function call.
Hi all, I'm a beginner in LLVM. I read a paper recently, and I'm trying to use LLVM jumptable in 3.5. When I compile the .bc file into .s file, I tried to use the different jumptable type: all, single, ... e.g. clang -c -emit-llvm test.c llc test.bc -jump-table-type=full -o test-full.s llc test.bc -jump-table-type=single -o test-single.s The tested C source code is like: void foo() { prin...
2019 Aug 31
3
Usage of the jumptable attribute
Hello everyone, I'm new to LLVM (which is a really great project by the way) and I hope this is the right place for my question. In the LLVM Language Reference Manual I found the "jumptable" function attribute, which seems to be exactly what I need for my project (where I want to add one level of indirection to every function call), but I have trouble figuring out, how to use it correctly. I wrote my own transformation pass (using LLVM 8.0.1) to add this attribute as well as...
2017 May 16
2
[RFC] CFI for indirect calls with ThinLTO
Hi, this is a proposal for the implementation of CFI-icall [1] with ThinLTO. Jumptables are generated in the merged module. To generate a jumptable, we need a list of functions with !type annotations, including (in non-cross-dso mode) external functions. Unfortunately, LLVM IR does not preserve unused function declarations, and we don’t want to copy the actual function bodies to the...
2014 Apr 04
2
[LLVMdev] [RFC] Simple control-flow integrity
...Mar 21, 2014 at 12:15 PM, Peter Collingbourne <peter at pcc.me.uk> > > wrote: > > > >> The way I've implemented it (see the patch I sent to llvm-commits > > > >> yesterday), it's not just metadata: the intrinsic lowers to the > > > >> jumptable entry code given above. The CFI pass then generates a > > > >> function for each jump table; the function consists solely of these > > > >> intrinsic calls. > > > > > > > > Well, the intrinsic you proposed has no effect on the caller and has &gt...
2017 May 16
2
[RFC] CFI for indirect calls with ThinLTO
...nks for sending this out. A few comments below. > > On Mon, May 15, 2017 at 5:17 PM, Evgenii Stepanov via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> >> Hi, >> >> this is a proposal for the implementation of CFI-icall [1] with ThinLTO. >> >> Jumptables are generated in the merged module. To generate a >> jumptable, we need a list of functions with !type annotations, >> including (in non-cross-dso mode) external functions. Unfortunately, >> LLVM IR does not preserve unused function declarations, and we don’t >> want to cop...
2014 Apr 04
3
[LLVMdev] [RFC] Simple control-flow integrity
...> > peter at pcc.me.uk> > > > > wrote: > > > > > >> The way I've implemented it (see the patch I sent to llvm-commits > > > > > >> yesterday), it's not just metadata: the intrinsic lowers to the > > > > > >> jumptable entry code given above. The CFI pass then generates a > > > > > >> function for each jump table; the function consists solely of > > these > > > > > >> intrinsic calls. > > > > > > > > > > > > Well, the intrinsic yo...
2017 May 24
2
[RFC] CFI for indirect calls with ThinLTO
...y 15, 2017 at 5:17 PM, Evgenii Stepanov via llvm-dev > >> <llvm-dev at lists.llvm.org> wrote: > >>> > >>> Hi, > >>> > >>> this is a proposal for the implementation of CFI-icall [1] with > ThinLTO. > >>> > >>> Jumptables are generated in the merged module. To generate a > >>> jumptable, we need a list of functions with !type annotations, > >>> including (in non-cross-dso mode) external functions. Unfortunately, > >>> LLVM IR does not preserve unused function declarations, and we...
2014 Mar 21
3
[LLVMdev] [RFC] Simple control-flow integrity
...M -0700, Tom Roeder wrote: > On Fri, Mar 21, 2014 at 12:15 PM, Peter Collingbourne <peter at pcc.me.uk> wrote: > >> The way I've implemented it (see the patch I sent to llvm-commits > >> yesterday), it's not just metadata: the intrinsic lowers to the > >> jumptable entry code given above. The CFI pass then generates a > >> function for each jump table; the function consists solely of these > >> intrinsic calls. > > > > Well, the intrinsic you proposed has no effect on the caller and has > > non-local effects on other specif...
2017 Feb 13
5
(RFC) JumpMaps: switch statement optimization
...on an out-of-tree embedded back-end. Our primary goal is code size, secondary performance. We've recently implemented an optimization that we believe others could use. It's about time to contribute back. ------------------------------------------------------- JumpMaps: a generalization of JumpTables JumpTables produce fast and small code but have a limitation - they only work if case values are easy to compute from the variable being switch()ed. To overcome this limitation we introduce a {key,value} structure - a JumpMap. Simplifying somewhat, LLVM would currently generate a sequential if-el...
2017 Feb 14
2
(RFC) JumpMaps: switch statement optimization
JumpMap lowering is nearly identical to that of JumpTables with the exception of lack of range-check basic-block. We introduce JumpMapInfo structure which follows the same flow as JumpTableInfo and is finally emitted by AsmPrinter. There are many ways a Target may want to encode jumpmaps (deltas, compression, relative vs absolute), so we plan to keep thi...
2009 Jun 03
5
[LLVMdev] patch for llc/ARM: added mechanism to move switch tables from .text -> .data; also cleanup and documentation
...ght decision when generating code for different targets. const ARMSubtarget *Subtarget; - /// ARMPCLabelIndex - Keep track the number of ARM PC labels created. - /// + /// ARMPCLabelIndex - Keep track of the number of ARM PC labels created. unsigned ARMPCLabelIndex; + /// ARMJumpTableIndex - Keep track of the number ofJump Tables + unsigned ARMJumpTableIndex; SDValue LowerMemOpCallTo(CallSDNode *TheCall, SelectionDAG &DAG, const SDValue &StackPtr, const CCValAssign &VA, Index: lib/Target/ARM/ARMConstantPoolValue.h =============...
2009 Jul 14
0
[LLVMdev] patch for llc/ARM: added mechanism to move switch tables from .text -> .data; also cleanup and documentation
On Jul 2, 2009, at 10:48 AM, robert muth wrote: > I spend over a day trying to follow your suggestion. In the end I > was not successful. Here is what Iearned: > > After setting > > ARMJITInfo::hasCustomJumpTables -> true > setOperationAction for ISD::BR_JT -> Expand > > I needed to add a "brind" definition to ARMInstrInfo.td > I picked "bx" but to do a proper job one would have to take older > architectures > into account.. > The next thing was to to set &gt...
2009 Jun 07
2
[LLVMdev] patch for llc/ARM: added mechanism to move switch tables from .text -> .data; also cleanup and documentation
On Sat, Jun 6, 2009 at 4:51 PM, Evan Cheng<evan.cheng at apple.com> wrote: > +cl::opt<std::string> FlagJumpTableSection("jumptable-section", > +                                           cl::init(".data.jtab")); > + I thought it would be nice to group all the jumptables together. But as long as it stays configurable, I am fine to change the default to ".data". > Is thi...
2009 Jun 08
2
[LLVMdev] patch for llc/ARM: added mechanism to move switch tables from .text -> .data; also cleanup and documentation
On Sun, Jun 7, 2009 at 11:53 PM, Evan Cheng <evan.cheng at apple.com> wrote: > > On Jun 7, 2009, at 6:59 AM, robert muth wrote: > >> On Sat, Jun 6, 2009 at 4:51 PM, Evan Cheng<evan.cheng at apple.com> >> wrote: >>> +cl::opt<std::string> FlagJumpTableSection("jumptable-section", >>> +                                           cl::init(".data.jtab")); >>> + >> >> I thought it would be nice to group all the jumptables together. >> But as long as it stays configurable, I am fine to change the...
2009 Jul 02
2
[LLVMdev] patch for llc/ARM: added mechanism to move switch tables from .text -> .data; also cleanup and documentation
...default behavior, but you have implemented it without using > the existing code. Did you consider implementing it using the LLVM > defaults? > I spend over a day trying to follow your suggestion. In the end I was not successful. Here is what Iearned: After setting ARMJITInfo::hasCustomJumpTables -> true setOperationAction for ISD::BR_JT -> Expand I needed to add a "brind" definition to ARMInstrInfo.td I picked "bx" but to do a proper job one would have to take older architectures into account.. The next thing was to to set setOperationAction for ISD::JumpTable...
2014 Mar 21
2
[LLVMdev] [RFC] Simple control-flow integrity
...if the CFI pass is run late. > > It also seems sort of distasteful to have a function whose sole purpose is > to hold metadata about other functions. The way I've implemented it (see the patch I sent to llvm-commits yesterday), it's not just metadata: the intrinsic lowers to the jumptable entry code given above. The CFI pass then generates a function for each jump table; the function consists solely of these intrinsic calls. > > > An alternative proposal: introduce a new function attribute named, say, > 'jumptable', which would cause the backend to emit a jump t...
2009 Jun 11
0
[LLVMdev] patch for llc/ARM: added mechanism to move switch tables from .text -> .data; also cleanup and documentation
...at 11:53 PM, Evan Cheng <evan.cheng at apple.com> > wrote: >> >> On Jun 7, 2009, at 6:59 AM, robert muth wrote: >> >>> On Sat, Jun 6, 2009 at 4:51 PM, Evan Cheng<evan.cheng at apple.com> >>> wrote: >>>> +cl::opt<std::string> FlagJumpTableSection("jumptable-section", >>>> + >>>> cl::init(".data.jtab")); >>>> + >>> >>> I thought it would be nice to group all the jumptables together. >>> But as long as it stays...
2017 Feb 14
3
(RFC) JumpMaps: switch statement optimization
...mpmap_find_i8, jumpmap_find_i16, jumpmap_find_i32, jumpmap_find_i64. > > We don't have any benchmarks for any of the in-tree targets yet. > > Witold > > > W dniu 2017-02-14 o 14:28, Witold Waligora via llvm-dev pisze: >> JumpMap lowering is nearly identical to that of JumpTables with the >> exception of lack of range-check basic-block. >> We introduce JumpMapInfo structure which follows the same flow as >> JumpTableInfo and is finally emitted by AsmPrinter. >> >> There are many ways a Target may want to encode jumpmaps (deltas, >> compr...
2005 Dec 23
2
[LLVMdev] if's to switch transformation?
hello everyone, I few days ago I had some code (for the PyPy project) that llc - march=c converted to a switch statement and gcc compiled that nicely to a jumptable in the .s file. Now I try to reproduce when directly going from a .ll to a .s file. But I now see a long list of compare and jumps instead of the jumptable. Is there a transformation that does this if->switch(ing) or is that in the part of llc that generates the c file? cheers Eric van...
2009 Jun 24
2
[LLVMdev] patch for llc/ARM: added mechanism to move switch tables from .text -> .data; also cleanup and documentation
...cheng at apple.com> > > wrote: > >> > >> On Jun 7, 2009, at 6:59 AM, robert muth wrote: > >> > >>> On Sat, Jun 6, 2009 at 4:51 PM, Evan Cheng<evan.cheng at apple.com> > >>> wrote: > >>>> +cl::opt<std::string> FlagJumpTableSection("jumptable-section", > >>>> + > >>>> cl::init(".data.jtab")); > >>>> + > >>> > >>> I thought it would be nice to group all the jumptables together. > >>> But as long as it stays configurable,...