about summary refs log tree commit diff homepage
path: root/lib/Module
AgeCommit message (Collapse)Author
2019-04-02Add FreeBSD OS triple in RaiseAsmGleb Popov
2019-03-21drop support for LLVM <= 3.7Julian Büning
2019-03-21remove copy of ScalarizerPass for LLVM 3.4Julian Büning
2019-03-21remove obsolete LegacyLLVMPassManagerTyJulian Büning
2019-03-21remove obsolete macro KLEE_LLVM_GEP_TYPEJulian Büning
2019-03-19Add support to assign debug instructions to optimised codeMartin Nowack
2019-03-19Use debugging information from newer LLVM versionsMartin Nowack
2019-03-19separate between instructions and functionsMartin Nowack
2019-03-19Refactor InstructionInfoTableMartin Nowack
Better debug information
2019-03-18Disable optimisation for functions that contain KLEE callsMartin Nowack
Compilers are allowed to hoist function calls and do GVE. This is currently done even without `--optimization` enabled. This is unfortunate in the context of KLEE function calls that might depend on specific code position without direct control flow dependencies. In such cases, function calls can be hoisted. To circumvent this, disallow to optimise functions that contain such calls by default. This might reduce optimisation for some functions containing such function calls but still allows it for all others. This patch adds an additional pass, that detects all functions starting with a prefix `klee_` and disable optimisations for functions containing such calls. This is enabled by default but can be disabled by `--klee-call-optimisation=false`.
2019-03-17run VerifierPass after optimization and instrumentationJulian Büning
2019-03-15Moved the options in Optimize.cpp to the module categoryCristian Cadar
2019-03-15Created a new module-related option category and moved the options in ↵Cristian Cadar
KModule.cpp in there
2019-03-12Removed unneeded and confusing disable-opt option, reformatted Optimize() ↵Cristian Cadar
function and updated some .ll tests to use --optimize=false instead of --disable-opt
2019-03-11Add support for LLVM 8.0Martin Nowack
2019-03-05workaround for LLVM PR39177Julian Büning
provides a workaround for LLVM bug PR39177, which affects LLVM versions 3.9 - 7.0.0: https://bugs.llvm.org/show_bug.cgi?id=39177 This commit is intended to be reverted once support for LLVM versions <= 7 is dropped from KLEE.
2018-10-26llvm7: handle new header filesJiri Slaby
createLowerSwitchPass moved in llvm commit 49ca55e3813c to Utils.h. createInstructionCombiningPass moved in llvm commitb5b7fce64c1d to InstCombine.h. So add the includes where needed. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm7: WriteBitcodeToFile takes Module &Jiri Slaby
Since llvm commit 06d6207c1c63, WriteBitcodeToFile accepts Module &, not Module *. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm6: handle headers renamingJiri Slaby
Some headers were moved from llvm/Target/ to llvm/CodeGen/. Handle that. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: Intrinsic::objectsize has three argumentsJiri Slaby
Modify the IntrinsicCleaner accordingly. We do not do anything with the third argument as we do not handle the first argument in any way. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: handle new file_magic's locationJiri Slaby
llvm 5, moved file_magic to BinaryFormat in commit 19ca2b0f9daed883c21730285d7f04424e5f5f88, so adapt to that. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-26llvm5: handle getOrInsertFunction terminatorJiri Slaby
llvm 5 does not terminate getOrInsertFunction parameters with NULL, take care of that. Since commit 9d54400bba7eb04bca80fce97fa170452d19eaf1. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-10-24ShiftChecker: Instrument shift instructions only onceMartin Nowack
As the shift checker could be executed multiple times, we need to avoid that shift instructions are instrumented multiple times as well. Mark the instrumented instruction using metadata and avoid it in successive runs.
2018-10-24ShiftChecker: Avoid unneeded checksMartin Nowack
Do not instrument shift operations with constant shift operations that are smaller than the type size.
2018-10-24ShiftCheck: Use llvm::Builder instead of Inst::Create*Martin Nowack
Use llvm::Builder instead of Inst::Create* to create instruction. This handles metadata automatically and does instruction folding if possible. Updated to C++11 and clang-formatted.
2018-10-24DivCheck do not instrument multiple timesMartin Nowack
DivChecker can be executed multiple times due to the new linking process. Avoid instrumenting div instructions multiple times by annotating checked instructions with marker. Only unmarked div instructions will be instrumented.
2018-10-24DivCheck Skip unneeded checksMartin Nowack
Do not instrument divisions which do have a constant non-zero value.
2018-10-24Use llvm::Builder for DivCheck instrumentationMartin Nowack
Use llvm::Builder instead of raw `*Inst::create()` functions. Builder automatically manages metadata (e.g. debug, TBAA, ..) such that we don't have to take care of this automatically. Updated code to C++11 and clang-formated it.
2018-10-24Introduce KLEEIRMetaData to manipulate LLVM-IR metadataMartin Nowack
Simplify the handling of metadata attached to LLVM IR that is specific to KLEE.
2018-10-24Added lowering passRafael Zaehl
2018-10-04kleeModule: always link irreader (required since llvm 3.3)Julian Büning
2018-10-04remove obsolete dependency of kleeModule on kleeCoreJulian Büning
2018-09-18llvm4: errorOr and similarJiri Slaby
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-09-18llvm4: handle different header namesJiri Slaby
LLVM 4 renamed and splitted some headers. Take this into account in includes. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-09-14llvm: make KLEE compile against LLVM 3.9Jiri Slaby
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-09-10Unify the error message if that function has not been found.Martin Nowack
2018-09-10Fix generation of global constructors and destructorsMartin Nowack
Validate if the user-selected entry function exists. Do not assume it is `main`.
2018-08-03Replace remaining *Inst::Create() calls with llvm::BuilderMartin Nowack
Replace the remaining occurrences of `Inst::Create()` with `llvm::Builder` to manage metadata automatically and to fold instructions. C++11 it and clang-format
2018-07-28remove last comma from -debug-print-escaping-functionsJulian Büning
2018-07-28add declarations to escapingFunctionsJulian Büning
2018-07-23ModuleUtil: improve and test valueIsOnlyCalledJulian Büning
* handle BlockAddress (which is not a valid function pointer) * there is no instruction with opcode 0 * add test for functionality
2018-07-23fix: LLVM 3.5, begin_user() instead of begin_use()Julian Büning
With version 3.5, LLVM introduced a subtle semantic change in the API of `Value`. With that change, `use_begin()` is renamed to `user_begin()`. Additionally, a new method `use_begin()` with a different meaning was introduced. Now, `use_begin()` actually iterates over `Use`s, whereas before, dereferencing it would give a `User *`. For further details, please refer to https://reviews.llvm.org/rL203364. Due to the reintroduction of `use_begin()`, existing code may still compile, although the semantics have changed. In the code changed with this patch, all `dyn_cast`s for `Use` fail and the else branch is always taken.
2018-07-12llvm38: no more implicit iteratorsRichard Trembecký
LLVM commit eac309550f25 removed implicit iterator conversions. So we have to get the iterators explicitly now. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-07-12llvm38: archive child iterator changesJiri Slaby
After LLVM commit 25569fdcdab0, archive iterator returns object::Archive::Child instead of child_iterator, adapt to that. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-07-12llvm38: adapt to new Linker::linkModulesJiri Slaby
LLVM commit d912be98f8eb changed the prototype of linkModules to accept std::unique_ptr. Adapt to that. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-07-12llvm38: handle optimization passes changesJiri Slaby
createFunctionAttrsPass was split to createPostOrderFunctionAttrsPass and createReversePostOrderFunctionAttrsPass in LLVM commit e96fb9ab15d4. createGlobalsModRefPass was changed to createGlobalsAAWrapperPass in LLVM commit 9146833fa313. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-07-04Reorder linking and optimizationsMartin Nowack
Link intrinsic library before executing optimizations. This makes sure that any optimization run by KLEE on the module is executed for the intrinsic library as well. Support .ll files as input for KLEE as well.
2018-05-24llvm: make KLEE compile against LLVM 3.7Richard Trembecký
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-05-24llvm37: handle GetElementPtrInst::Create's new parameterJiri Slaby
LLVM 3.7 added a PointeeType parameter to GetElementPtrInst::Create. Let's handle that by a macro called KLEE_LLVM_GEP_TYPE, defined in Version.h. Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
2018-05-22clang-format on lib/Module/{IntrinsicCleaner.cpp,Passes.h}Julian Büning