OSDN Git Service

allow custom OptBisect classes set to LLVMContext
authorFedor Sergeev <fedor.sergeev@azul.com>
Thu, 5 Apr 2018 10:29:37 +0000 (10:29 +0000)
committerFedor Sergeev <fedor.sergeev@azul.com>
Thu, 5 Apr 2018 10:29:37 +0000 (10:29 +0000)
commit46d5e2b451531f33dc0a683be72f944241fd034f
tree3b6b99248bf3fa5744be1c0f8c739494c98c79f8
parent90e863357da41d689f6530c46b0c822dee8370d3
allow custom OptBisect classes set to LLVMContext

This patch introduces a way to set custom OptPassGate instances to LLVMContext.
A new instance field OptBisector and a new method setOptBisect() are added
to the LLVMContext classes. These changes allow to set a custom OptBisect class
that can make its own decisions on skipping optional passes.

Another important feature of this change is ability to set different instances
of OptPassGate to different LLVMContexts. So the different contexts can be used
independently in several compiling threads of one process.

One unit test is added.

Patch by Yevgeny Rouban.

Reviewers: andrew.w.kaylor, fedor.sergeev, vsk, dberlin, Eugene.Zelenko, reames, skatkov
Reviewed By: andrew.w.kaylor, fedor.sergeev
Differential Revision: https://reviews.llvm.org/D44464

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329267 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/LLVMContext.h
lib/IR/LLVMContext.cpp
lib/IR/LLVMContextImpl.cpp
lib/IR/LLVMContextImpl.h
unittests/IR/LegacyPassManagerTest.cpp