1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

110 Commits

Author SHA1 Message Date
Peter Collingbourne
3ec59b51d4 Support: Clean up TSan annotations.
Remove support for Valgrind-based TSan, which hasn't been maintained for a
few years. We now use the TSan annotations only if LLVM is compiled with
-fsanitize=thread. We no longer need the weak function definitions as we
are guaranteed that our program is linked directly with the TSan runtime.

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

llvm-svn: 245374
2015-08-18 22:31:24 +00:00
Alexander Kornienko
f993659b8f Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)
Apparently, the style needs to be agreed upon first.

llvm-svn: 240390
2015-06-23 09:49:53 +00:00
Alexander Kornienko
40cb19d802 Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:

tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
  -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
  llvm/lib/


Thanks to Eugene Kosov for the original patch!

llvm-svn: 240137
2015-06-19 15:57:42 +00:00
Chris Bieneman
937b40b209 Defining a new API for debug options that doesn't rely on static global cl::opts.
Summary:
This is based on the discussions from the LLVMDev thread:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-August/075886.html

Reviewers: chandlerc

Reviewed By: chandlerc

Subscribers: llvm-commits

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

llvm-svn: 219854
2014-10-15 21:54:35 +00:00
Jiangning Liu
c7a7a14ca1 Move GlobalMerge from Transform to CodeGen.
This patch is to move GlobalMerge pass from Transform/Scalar                                                           
to CodeGen, because GlobalMerge depends on TargetMachine.
In the mean time, the macro INITIALIZE_TM_PASS is also moved
to CodeGen/Passes.h. With this fix we can avoid making
libScalarOpts depend on libCodeGen.

llvm-svn: 210951
2014-06-13 22:57:59 +00:00
Zachary Turner
886b0eebc0 Remove pimpl class from PassRegistry.
Since removeRegistrationListener is no longer called during static
destruction, we can get rid of the pimpl in PassRegistry.

This should clean up the code somewhat, increase clarity, and also
allows us to put the Lock as a member of the class, instead of as a
ManagedStatic.

As part of this change, the PassInfo class is moved from
PassSupport.h to its own file, to eliminate the otherwise circular
header dependency between PassRegistry.h and PassSupport.h

Reviewed by: rnk, dblaikie

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

llvm-svn: 210793
2014-06-12 16:06:51 +00:00
Zachary Turner
d98404210d Do not register and de-register PassRegistrationListeners during
construction and destruction.

PassRegistrationListener is intended for use as a generic listener.
In some cases, PassRegistrationListener-derived classes were being
created, and automatically registered and de-registered in static
constructors and destructors.  Since ManagedStatics are destroyed
prior to program shutdown, this leads to errors where an attempt is
made to access a ManagedStatic that has already been destroyed.

Reviewed by: rnk, dblaikie

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

llvm-svn: 210724
2014-06-12 00:16:36 +00:00
Jiangning Liu
a490614c0a Create macro INITIALIZE_TM_PASS.
Pass initialization requires to initialize TargetMachine for back-end
specific passes. This commit creates a new macro INITIALIZE_TM_PASS to
simplify this kind of initialization.

llvm-svn: 210641
2014-06-11 07:04:37 +00:00
Juergen Ributzka
2a4b7a30e4 Revert "[PM] Add pass run listeners to the pass manager."
Revert the current implementation and C API. New implementation and C APIs are
in the works.

llvm-svn: 208904
2014-05-15 17:49:20 +00:00
Juergen Ributzka
d66145227a [PM] Add pass run listeners to the pass manager.
This commit provides the necessary C/C++ APIs and infastructure to enable fine-
grain progress report and safe suspension points after each pass in the pass
manager.

Clients can provide a callback function to the pass manager to call after each
pass. This can be used in a variety of ways (progress report, dumping of IR
between passes, safe suspension of threads, etc).

The run listener list is maintained in the LLVMContext, which allows a multi-
threaded client to be only informed for it's own thread. This of course assumes
that the client created a LLVMContext for each thread.

This fixes <rdar://problem/16728690>

llvm-svn: 207430
2014-04-28 18:19:25 +00:00
Craig Topper
457de03c6e [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr.
llvm-svn: 205831
2014-04-09 06:08:46 +00:00
Benjamin Kramer
6748fa3a23 Revert "[C++11] Replace LLVM atomics with std::atomic."
Breaks the MSVC build.
DataStream.cpp(44): error C2552: 'llvm::Statistic::Value' : non-aggregates cannot be initialized with initializer list

llvm-svn: 202731
2014-03-03 18:02:34 +00:00
Benjamin Kramer
d55423bf4c [C++11] Replace LLVM atomics with std::atomic.
With C++11 we finally have a standardized way to specify atomic operations. Use
them to replace the existing custom implemention. Sadly the translation is not
entirely trivial as std::atomic allows more fine-grained control over the
atomicity. I tried to preserve the old semantics as well as possible.

Differential Revision: http://llvm-reviews.chandlerc.com/D2915

llvm-svn: 202730
2014-03-03 17:53:30 +00:00
Quentin Colombet
b42dbc5117 [opt][PassInfo] Allow opt to run passes that need target machine.
When registering a pass, a pass can now specify a second construct that takes as
argument a pointer to TargetMachine.
The PassInfo class has been updated to reflect that possibility.
If such a constructor exists opt will use it instead of the default constructor
when instantiating the pass.

Since such IR passes are supposed to be rare, no specific support has been
added to this commit to allow an easy registration of such a pass.
In other words, for such pass, the initialization function has to be
hand-written (see CodeGenPrepare for instance).

Now, codegenprepare can be tested using opt:
opt -codegenprepare -mtriple=mytriple input.ll

llvm-svn: 199430
2014-01-16 21:44:34 +00:00
Jakub Staszak
f1ea1a7f37 Fix include guards so they exactly match file names.
llvm-svn: 172025
2013-01-10 00:45:19 +00:00
Duncan Sands
bea16337de Fix comment typo.
llvm-svn: 170317
2012-12-17 11:43:15 +00:00
Chandler Carruth
ca305491f6 Sort the #include lines for the include/... tree with the script.
AKA: Recompile *ALL* the source code!

This one went much better. No manual edits here. I spot-checked for
silliness and grep-checked for really broken edits and everything seemed
good. It all still compiles. Yell if you see something that looks goofy.

llvm-svn: 169133
2012-12-03 17:02:12 +00:00
Craig Topper
24f46609c1 Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION.
llvm-svn: 164017
2012-09-17 07:16:40 +00:00
Nick Lewycky
fc10724777 Add Tsan annotations to the pass system.
Perhaps once(&func) should be hoisted into lib/Support.

llvm-svn: 146110
2011-12-08 00:15:41 +00:00
Nick Lewycky
5a1035a0dc Revert r131155 for now. It makes VMCore depend on Analysis and Transforms
headers.

llvm-svn: 131159
2011-05-10 22:16:06 +00:00
David Chisnall
17ae92b2d8 Add support for plugins add passes to the default set of passes. The standard set of passes used by front ends can now be modified by LLVM plugins, without needing to modify any front ends.
Still to do:

- Allow replacing / removing passes (infrastructure there, just needs an infrastructure exposed)
- Defining sets of passes to be added or removed as a group
- Extending the support to allow user-defined groups of optimisations
- Allow plugins to be specified for loading automatically (e.g. from plugins.conf or some similar mechanism)

Reviewed by Nick Lewycky.

llvm-svn: 131155
2011-05-10 21:36:48 +00:00
Michael J. Spencer
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Owen Anderson
9e9ae1b048 Attempt to fix valgrind complaining about (benign) leaks in pass registration by having PassRegistry
delete PassInfo objects that were created using new-style initialization.

llvm-svn: 116959
2010-10-20 22:22:30 +00:00
Owen Anderson
933c8cc6ed Remove extraneous slash.
llvm-svn: 116851
2010-10-19 19:54:48 +00:00
Owen Anderson
65610b8589 Factor out the call-once implementation into its own macro.
llvm-svn: 116832
2010-10-19 18:02:06 +00:00
Owen Anderson
46990c17f7 Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
registration/creation, please send the testcase to me directly.

llvm-svn: 116820
2010-10-19 17:21:58 +00:00
Owen Anderson
467d56737b Try again at implementing thread-safe lazy pass initialization, without depending on static local initialization
being threadsafe AND ensuring that initialization is complete by the time the initializeFooPass method returns.

llvm-svn: 116492
2010-10-14 17:59:03 +00:00
Owen Anderson
5114ec184e Revert r116489. It included some changes I didn't intend to commit, and broke the buildbots.
llvm-svn: 116491
2010-10-14 17:36:50 +00:00
Owen Anderson
2928dbea72 Apparently MSVC doesn't support thread-safe static local initialization. Roll our own solution instead.
llvm-svn: 116489
2010-10-14 17:26:06 +00:00
Owen Anderson
2ea9b016d8 Conversely, Analysis-implementations do NOT need to initialize the AnalysisGroup. It will only matter when
someone tries to require that AG, in which case it is the requester's responsibility to initialize it.

llvm-svn: 116442
2010-10-13 21:55:07 +00:00
Owen Anderson
c65395a991 Analysis groups need to initialize their default implementations.
llvm-svn: 116441
2010-10-13 21:49:58 +00:00
Owen Anderson
63b480c711 Take advantage of C++'s thread-safe static local initialization to simplify thread-safe pass initialization.
llvm-svn: 116426
2010-10-13 20:24:34 +00:00
Owen Anderson
63f757463c Begin adding static dependence information to passes, which will allow us to
perform initialization without static constructors AND without explicit initialization
by the client.  For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve.  I hope to be able to relax
the latter requirement in the future.

llvm-svn: 116334
2010-10-12 19:48:12 +00:00
Owen Anderson
69cbf2e8b7 Now with fewer extraneous semicolons!
llvm-svn: 115996
2010-10-07 22:25:06 +00:00
Owen Anderson
a8a7bf484f Move the pass initialization helper functions into the llvm namespace, and add
a header declaring them all.  This is also where we will declare per-library pass-set
initializer functions down the road.

llvm-svn: 115900
2010-10-07 04:13:08 +00:00
Owen Anderson
2a670815f6 Hide analysis group registration behind a macro, just like pass registration.
llvm-svn: 115835
2010-10-06 21:02:27 +00:00
Owen Anderson
123f4e5c19 Pass initialization functions should take a PassRegistry as a parameter
rather than being fixed to the global registry.

llvm-svn: 115824
2010-10-06 20:07:03 +00:00
Owen Anderson
38e84dd7ea Another step towards getting rid of static ctors for pass registration: have INITIALIZE_PASS AND INITIALIZE_AG_PASS
expand to an initializeMyPass() function (in additional to the extant static ctors).  Eventually, these will be called
from a big InitializeAllPasses() function, and the PassInfo's they create (which would be leaked if this code were used
at the moment) will be handed off to a PassRegistry for ownership.

llvm-svn: 115703
2010-10-05 22:58:16 +00:00
Owen Anderson
e15120e561 Clean up some of the PassRegistry implementation, and pImpl-ize it to reduce #include clutter
and exposing internal details.

llvm-svn: 113252
2010-09-07 19:16:25 +00:00
Dan Gohman
1d48a4b1d7 Tidy some #includes and forward-declarations, and move the C binding code
out of PassManager.cpp and into Core.cpp with the rest of the C binding code.

llvm-svn: 110494
2010-08-07 00:43:20 +00:00
Rafael Espindola
2145c31de3 Some cleanup. Use a class (OptionInfo) instead of a pair of a pair and remove
some default values that are not used.

llvm-svn: 110485
2010-08-06 23:03:52 +00:00
Owen Anderson
f2fea95f2f Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
aadd8a89ca Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
b9762c07cb Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.

llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Owen Anderson
b36d01c1b6 Add INSTANTIATE_AG_PASS, which combines RegisterPass<> with RegisterAnalysisGroup<> for pass registration.
llvm-svn: 109058
2010-07-21 23:07:00 +00:00
Owen Anderson
e8e8b5a744 Add the INITIALIZE_PASS macro.
llvm-svn: 109034
2010-07-21 20:46:41 +00:00
Owen Anderson
6265d52037 Move the handling of PassRegistrationListener's to PassRegistry.
llvm-svn: 108966
2010-07-20 23:41:56 +00:00
Owen Anderson
e5f3371961 Pull out r108755. After offline discussion with Chris, we're going to go a different direction with this.
llvm-svn: 108856
2010-07-20 16:55:05 +00:00
Owen Anderson
5f218b8612 Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch
would cause them to fail the way they are, but none of the other intervening patches seem likely either.

llvm-svn: 108818
2010-07-20 08:26:15 +00:00
Owen Anderson
cf625d0179 Reapply r108794, a fix for the failing test from last time.
llvm-svn: 108813
2010-07-20 06:52:42 +00:00