search for: jumptables

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

Did you mean: 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() {
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
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 m...
2014 Apr 04
2
[LLVMdev] [RFC] Simple control-flow integrity
On Wed, Apr 02, 2014 at 05:28:04PM -0700, Tom Roeder wrote: > On Fri, Mar 21, 2014 at 1:46 PM, Peter Collingbourne <peter at pcc.me.uk>wrote: > > > On Fri, Mar 21, 2014 at 12:54:07PM -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
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 copy...
2014 Apr 04
3
[LLVMdev] [RFC] Simple control-flow integrity
On Thu, Apr 03, 2014 at 06:54:55PM -0700, Reid Kleckner wrote: > I think it's a little scary to assume things about LLVM's x86 code > generation. I haven't really finished the codegen side of the change, but > I'm pretty sure in it's current state it will emit extra loads and stores, > even if they are unnecessary. Right, I had similar concerns. Now that I've
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
On Fri, Mar 21, 2014 at 12:54:07PM -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
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-els...
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 this...
2009 Jun 03
5
[LLVMdev] patch for llc/ARM: added mechanism to move switch tables from .text -> .data; also cleanup and documentation
...nclude "llvm/Support/Compiler.h" #include "llvm/Support/Mangler.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include <cctype> +#include <sstream> using namespace llvm; +extern cl::opt<bool> FlagOutlineJumpTables; +cl::opt<std::string> FlagJumpTableSection("jumptable-section", + cl::init(".data.jtab")); + STATISTIC(EmittedInsts, "Number of machine instrs printed"); namespace { @@ -139,6 +145,7 @@ /// EmitMachineConstantPo...
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 >...
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 this...
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 d...
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
On Thu, Mar 20, 2014 at 3:29 PM, Peter Collingbourne <peter at pcc.me.uk> wrote: > > On Mon, Mar 17, 2014 at 10:28:52AM -0700, Tom Roeder wrote: > > On Tue, Feb 25, 2014 at 5:41 PM, Eric Christopher <echristo at gmail.com>wrote: > > > > > On Mon, Feb 24, 2014 at 4:33 PM, Tom Roeder <tmroeder at google.com> wrote: > > > > > > > >
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, >> compre...
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
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,...