Add a speculative execution pass
authorJingyue Wu <jingyue@google.com>
Fri, 15 May 2015 17:54:48 +0000 (17:54 +0000)
committerJingyue Wu <jingyue@google.com>
Fri, 15 May 2015 17:54:48 +0000 (17:54 +0000)
commit85e632de299fc2915907cff1863ebbee02aa9823
treede08d78a17de8a7d0d5fb970da097bb807d47eba
parentc683eb2d37b78133c058db7ad770b3fde61b37fe
Add a speculative execution pass

Summary:
This is a pass for speculative execution of instructions for simple if-then (triangle) control flow. It's aimed at GPUs, but could perhaps be used in other contexts. Enabling this pass gives us a 1.0% geomean improvement on Google benchmark suites, with one benchmark improving 33%.

Credit goes to Jingyue Wu for writing an earlier version of this pass.

Patched by Bjarke Roune.

Test Plan:
This patch adds a set of tests in test/Transforms/SpeculativeExecution/spec.ll
The pass is controlled by a flag which defaults to having the pass not run.

Reviewers: eliben, dberlin, meheff, jingyue, hfinkel

Reviewed By: jingyue, hfinkel

Subscribers: majnemer, jholewinski, llvm-commits

Differential Revision: http://reviews.llvm.org/D9360

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237459 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/BasicBlock.h
include/llvm/InitializePasses.h
include/llvm/LinkAllPasses.h
include/llvm/Transforms/Scalar.h
lib/IR/BasicBlock.cpp
lib/Transforms/IPO/PassManagerBuilder.cpp
lib/Transforms/Scalar/CMakeLists.txt
lib/Transforms/Scalar/Scalar.cpp
lib/Transforms/Scalar/SpeculativeExecution.cpp [new file with mode: 0644]
test/Transforms/SpeculativeExecution/spec.ll [new file with mode: 0644]