[PATCH] Add a jumptable attribute + intrinsic + IR transform for jump-instruction tables

Tom Roeder tmroeder at google.com
Fri Apr 4 12:04:58 PDT 2014


Here's a patch that implements the version of jump-instruction tables that I have been discussing on llvmdev.

It adds:

- a jumptable function attribute that maps to a jumptable entry in a special section
- an intrinsic llvm.jumptable_jump that can only occur as the sole instruction in a jumptable function
- a JumpInstrTables pass that converts address-taken functions to pass through a jump-instruction table
- codegen support + X86 backend support for lowering the intrinsic to a simple jmp f at PLT instruction
- some basic tests of the functionality

http://llvm-reviews.chandlerc.com/D3292

Files:
  include/llvm/Bitcode/LLVMBitCodes.h
  include/llvm/CodeGen/ISDOpcodes.h
  include/llvm/IR/Attributes.h
  include/llvm/IR/Intrinsics.td
  include/llvm/InitializePasses.h
  include/llvm/Transforms/IPO/JumpInstrTables.h
  lib/AsmParser/LLLexer.cpp
  lib/AsmParser/LLParser.cpp
  lib/AsmParser/LLToken.h
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
  lib/IR/Attributes.cpp
  lib/IR/Verifier.cpp
  lib/LTO/LTOCodeGenerator.cpp
  lib/Target/X86/X86ISelDAGToDAG.cpp
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  lib/Target/X86/X86InstrCompiler.td
  lib/Target/X86/X86InstrInfo.cpp
  lib/Target/X86/X86InstrInfo.td
  lib/Transforms/IPO/CMakeLists.txt
  lib/Transforms/IPO/IPO.cpp
  lib/Transforms/IPO/JumpInstrTables.cpp
  test/Bitcode/attributes.ll
  test/CodeGen/X86/jumptable_jump.ll
  test/Transforms/JumpInstrTables/jump_tables.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3292.1.patch
Type: text/x-patch
Size: 42995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140404/eda6ce95/attachment.bin>


More information about the llvm-commits mailing list