about summary refs log tree commit diff homepage
path: root/lib/Module/Passes.h
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2017-05-24 16:32:47 +0100
committerDan Liew <daniel.liew@imperial.ac.uk>2017-07-19 18:15:20 +0100
commit8e8732d482e42e363f0f4c51794ed966701371e7 (patch)
tree35ae38f61a0dbe865c931841a559b0d4553a838a /lib/Module/Passes.h
parent7c4fdd012317eb92352fc7ded53a553ed762719f (diff)
downloadklee-8e8732d482e42e363f0f4c51794ed966701371e7.tar.gz
Implement basic support for vectorized instructions.
We use LLVM's Scalarizer pass to remove most vectorized code so that the
Executor only needs to support the InsertElement and ExtractElement
instructions.

This pass was not available in LLVM 3.4 so to support that LLVM version
the pass has been back ported.

To check that the Executor is not receiving vector operand types
that it can't handle assertions have been added.

There are a few limitations to this implementation.

* The InsertElement and ExtractElement index cannot be symbolic.
* There is no support for LLVM < 3.4.
Diffstat (limited to 'lib/Module/Passes.h')
-rw-r--r--lib/Module/Passes.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Module/Passes.h b/lib/Module/Passes.h
index 4f1a1453..293766c1 100644
--- a/lib/Module/Passes.h
+++ b/lib/Module/Passes.h
@@ -180,6 +180,15 @@ private:
                      llvm::BasicBlock *defaultBlock);
 };
 
+// This is the interface to a back-ported LLVM pass.
+// Newer versions of LLVM already have this in-tree
+// and we are not supporting vector instructions for
+// LLVM 2.9. Therefore this interface is only needed for
+// LLVM 3.4.
+#if LLVM_VERSION_CODE == LLVM_VERSION(3,4)
+llvm::FunctionPass *createScalarizerPass();
+#endif
+
 }
 
 #endif