Commit Graph

20753 Commits

Author SHA1 Message Date
Craig Topper 35b2f75733 Convert some assert(0) to llvm_unreachable or fold an 'if' condition into the assert.
llvm-svn: 211254
2014-06-19 06:10:58 +00:00
Matt Arsenault a0050b0961 R600/SI: Add intrinsics for various math instructions.
These will be used for custom lowering and for library
implementations of various math functions, so it's useful
to expose these as builtins.

llvm-svn: 211247
2014-06-19 01:19:19 +00:00
David Blaikie d3d6de2703 Fix breakage from r211244 by using LLVM_EXPLICIT to avoid using explicit operators under MSVC where they're not supported.
llvm-svn: 211246
2014-06-19 01:09:49 +00:00
Nikola Smiljanic 89e561a63e PR10140 - StringPool's PooledStringPtr has non-const operator== causing bad OR-result.
Mark conversion operator explicit and const qualify comparison operators.

llvm-svn: 211244
2014-06-19 00:26:49 +00:00
Rafael Espindola 1fe2c5ab27 Add a symbols() range and use a range loop.
llvm-svn: 211222
2014-06-18 21:14:57 +00:00
Zachary Turner 62ce4e88fd Replace Execution Engine's mutex with std::recursive_mutex.
This change has a bit of a trickle down effect due to the fact that
there are a number of derived implementations of ExecutionEngine,
and that the mutex is not tightly encapsulated so is used by other
classes directly.

Reviewed by: rnk

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

llvm-svn: 211214
2014-06-18 20:17:35 +00:00
Rafael Espindola a1ea4ccc06 Remove BitcodeReader::setBufferOwned.
We do have use cases for the bitcode reader owning the buffer or not, but we
always know which one we have when we construct it.

It might be possible to simplify this further, but this is a step in the
right direction.

llvm-svn: 211205
2014-06-18 18:55:41 +00:00
Rafael Espindola f9ba889c61 Update to the latest registered ELF e_machine names and values.
Patch by John Wolf!

llvm-svn: 211202
2014-06-18 18:30:15 +00:00
Justin Bogner 989574ca99 ProfileData: Fix copy-paste type in RawInstrProfReader
These deleted definitions had the wrong types.

Patch by Alex L!

llvm-svn: 211199
2014-06-18 18:20:44 +00:00
Weiming Zhao 8c89973462 [ARM] [MC] Refactor the constant pool classes
ARMTargetStreamer implements ConstantPool and AssmeblerConstantPools
to keep track of assembler-generated constant pools that are used for
ldr-pseudo.

When implementing ldr-pseudo for AArch64, these two classes can be reused.
So this patch factors them out from ARM target to the general MC lib.

llvm-svn: 211198
2014-06-18 18:17:25 +00:00
Ed Maste f054c7ed68 ADT: correct typo in comment
llvm-svn: 211196
2014-06-18 18:08:55 +00:00
Ulrich Weigand 457e606d1f Support LE in RelocVisitor::visitELF_PPC64_*
Since we now support both LE and BE PPC64 variants, use of getAddend64BE
is no longer correct.  Use the generic getELFRelocationAddend instead,
as was already done for Mips.

llvm-svn: 211170
2014-06-18 15:15:49 +00:00
JF Bastien acf5bc16e3 Revert "Random Number Generator (llvm)"
This reverts commit cccba093090d127e0b6d17473b14c264c14c5259.

It causes build breakage.

llvm-svn: 211146
2014-06-18 06:33:23 +00:00
JF Bastien f8ad92da5c Random Number Generator (llvm)
Summary:
Provides an abstraction for a random number generator (RNG) that produces a stream of pseudo-random numbers.
The current implementation uses C++11 facilities and is therefore not cryptographically secure.

The RNG is salted with the text of the current command line invocation.
In addition, a user may specify a seed (reproducible builds).

In clang, the seed can be set via
  -frandom-seed=X
In the back end, the seed can be set via
  -rng-seed=X

This is the llvm part of the patch.
clang part: D3391

Reviewers: ahomescu, rinon, nicholas, jfb

Reviewed By: jfb

Subscribers: jfb, perl

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

llvm-svn: 211145
2014-06-18 06:23:25 +00:00
James Molloy f1653b5260 Move SetTheory from utils/TableGen into lib/TableGen so Clang can use it.
llvm-svn: 211100
2014-06-17 13:10:38 +00:00
Jordan Rose 57ffdb07fd Add an overload for SourceMgr::PrintMessage that takes an existing diagnostic.
llvm-svn: 211087
2014-06-17 02:15:40 +00:00
Jordan Rose b4cfd0070d Modernize doc comments for SourceMgr.
No functionality change.

llvm-svn: 211086
2014-06-17 02:15:36 +00:00
Zachary Turner 814a49385c Expose ValueMap's mutex type as a typedef instead of a sys::Mutex.
This enables static polymorphism of the mutex type, which is
necessary in order to replace the standard mutex implementation
with a different type.

llvm-svn: 211080
2014-06-17 00:17:38 +00:00
Zachary Turner ccbf3d01f0 Revert r211066, 211067, 211068, 211069, 211070.
These were committed accidentally from the wrong branch before having
a review sign-off.

llvm-svn: 211072
2014-06-16 22:49:41 +00:00
Zachary Turner 89ae856c46 Kill the LLVM global lock.
llvm-svn: 211069
2014-06-16 22:40:42 +00:00
Zachary Turner d4f7dfe7f2 Remove some code churn.
llvm-svn: 211068
2014-06-16 22:40:29 +00:00
Zachary Turner 0f2c641f86 Remove some more code out into a separate CL.
llvm-svn: 211067
2014-06-16 22:40:17 +00:00
Zachary Turner b344f057d0 Users of the llvm global mutex must now acquire it manually.
This allows the mutex to be acquired in a guarded, RAII fashion.

llvm-svn: 211066
2014-06-16 22:39:38 +00:00
Jim Grosbach cc71514d3a AArch64: Add backend intrinsic for rbit.
Define an intrinsic for the frontend to use and pattern match it to
the RBIT instruction.

rdar://9283021

llvm-svn: 211058
2014-06-16 21:55:35 +00:00
Jim Grosbach 07393ba31b ARM: intrinsic support for rbit.
We already have an ARMISD node. Create an intrinsic to map to it so we can
add support for the frontend __rbit() intrinsic.

rdar://9283021

llvm-svn: 211057
2014-06-16 21:55:30 +00:00
Zachary Turner 2f825df60b Clean up some unnecessary mutex guards.
These were being used as unreferenced parameters to enforce that
the methods must not be called without holding a mutex, but all
of the methods in question were internal, and the methods were
only exposed through an interface whose entire purpose was to
serialize access to these structures, so expecting the methods
to be accessed under a mutex is reasonable enough.

Reviewed by: blaikie

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

llvm-svn: 211054
2014-06-16 20:54:28 +00:00
Rafael Espindola ae460027a4 Convert the Archive API to use ErrorOr.
Now that we have c++11, even things like ErrorOr<std::unique_ptr<...>> are
easy to use.

No intended functionality change.

llvm-svn: 211033
2014-06-16 16:08:36 +00:00
Dmitri Gribenko 1089db0ee6 Support/ConvertUTF: implement U+FFFD insertion according to the recommendation
given in the Unicode spec

That is, replace every maximal subpart of an ill-formed subsequence with one
U+FFFD.

llvm-svn: 211015
2014-06-16 11:09:46 +00:00
Manuel Klimek b671e78606 Add specialization of FoldingSetTrait for std::pair.
llvm-svn: 210990
2014-06-15 14:42:25 +00:00
Artyom Skrobov 9aea8432c5 Using llvm::sys::swapByteOrder() for the common case of byte-swapping a value in place
llvm-svn: 210978
2014-06-14 13:18:07 +00:00
Artyom Skrobov e2d6008d2e Adding llvm::sys::swapByteOrder() for the common use-case of byte-swapping a value in place
llvm-svn: 210976
2014-06-14 12:52:55 +00:00
Artyom Skrobov ef5e867f16 Renaming SwapByteOrder() to getSwappedBytes()
The next commit will add swapByteOrder(), acting in-place

llvm-svn: 210973
2014-06-14 11:36:01 +00:00
Jiangning Liu 96e92c1d75 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
Eric Christopher f047bfd115 The hazard recognizer only needs a subtarget, not a target machine
so make it take one. Fix up all users accordingly.

llvm-svn: 210948
2014-06-13 22:38:52 +00:00
Zachary Turner 586fd74c30 Make the error-handling functions thread-safe.
Prior to this change, error handling functions must be installed
and removed only inside of an llvm_[start/stop]_multithreading
pair.  This change allows error handling functions to be installed
any time, and from any thread.

Reviewed by: chandlerc

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

llvm-svn: 210937
2014-06-13 21:20:44 +00:00
Alexey Samsonov e595e1ade0 Remove top-level Clang -fsanitize= flags for optional ASan features.
Init-order and use-after-return modes can currently be enabled
by runtime flags. use-after-scope mode is not really working at the
moment.

The only problem I see is that users won't be able to disable extra
instrumentation for init-order and use-after-scope by a top-level Clang flag.
But this instrumentation was implicitly enabled for quite a while and
we didn't hear from users hurt by it.

llvm-svn: 210924
2014-06-13 17:53:44 +00:00
Rafael Espindola 2a826e40fa Finishing touch for the std::error_code transition.
While std::error_code itself seems to work OK in all platforms, there
are few annoying differences with regards to the std::errc enumeration.

This patch adds a simple llvm enumeration, which will hopefully avoid build
breakages in other platforms and surprises as we get more uses of
std::error_code.

llvm-svn: 210920
2014-06-13 17:20:48 +00:00
Tim Northover 420a216817 IR: add "cmpxchg weak" variant to support permitted failure.
This commit adds a weak variant of the cmpxchg operation, as described
in C++11. A cmpxchg instruction with this modifier is permitted to
fail to store, even if the comparison indicated it should.

As a result, cmpxchg instructions must return a flag indicating
success in addition to their original iN value loaded. Thus, for
uniformity *all* cmpxchg instructions now return "{ iN, i1 }". The
second flag is 1 when the store succeeded.

At the DAG level, a new ATOMIC_CMP_SWAP_WITH_SUCCESS node has been
added as the natural representation for the new cmpxchg instructions.
It is a strong cmpxchg.

By default this gets Expanded to the existing ATOMIC_CMP_SWAP during
Legalization, so existing backends should see no change in behaviour.
If they wish to deal with the enhanced node instead, they can call
setOperationAction on it. Beware: as a node with 2 results, it cannot
be selected from TableGen.

Currently, no use is made of the extra information provided in this
patch. Test updates are almost entirely adapting the input IR to the
new scheme.

Summary for out of tree users:
------------------------------

+ Legacy Bitcode files are upgraded during read.
+ Legacy assembly IR files will be invalid.
+ Front-ends must adapt to different type for "cmpxchg".
+ Backends should be unaffected by default.

llvm-svn: 210903
2014-06-13 14:24:07 +00:00
Juergen Ributzka 349777d3ea [FastISel][X86] Add MachineMemOperand to load/store instructions.
This commit adds MachineMemOperands to load and store instructions. This allows
the peephole optimizer to fold load instructions. Unfortunatelly the peephole
optimizer currently doesn't run at -O0.

llvm-svn: 210858
2014-06-12 23:27:57 +00:00
Richard Smith 51514ce625 [modules] The LLVM C API does not require C++!
llvm-svn: 210842
2014-06-12 22:09:39 +00:00
Rafael Espindola 3acea39853 Don't use 'using std::error_code' in include/llvm.
This should make sure that most new uses use the std prefix.

llvm-svn: 210835
2014-06-12 21:46:39 +00:00
Rafael Espindola a6e9c3e43a Remove system_error.h.
This is a minimal change to remove the header. I will remove the occurrences
of "using std::error_code" in a followup patch.

llvm-svn: 210803
2014-06-12 17:38:55 +00:00
Zachary Turner 0921f6bdb8 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
Rafael Espindola 0a5f9cf50d Replace llvm::error_code with std::error_code.
llvm-svn: 210783
2014-06-12 14:11:22 +00:00
Rafael Espindola ed6882b835 Don't import make_error_code into the llvm namespace.
llvm-svn: 210772
2014-06-12 11:58:49 +00:00
Alp Toker 156027ce66 Avoid in-class initializer from r210747
Turns out MSVC doesn't like this. Sorry for the noise!

llvm-svn: 210749
2014-06-12 04:27:37 +00:00
Alp Toker fc5f017894 Avoid anonymous namespace in header from r210747
llvm-svn: 210748
2014-06-12 04:21:14 +00:00
Alp Toker 3ba7673e34 Avoid redundant allocations in the linker optimisation hint
llvm-svn: 210747
2014-06-12 04:02:46 +00:00
Juergen Ributzka 04558dc77a [FastISel] Add support for the stackmap intrinsic.
This implements target-independent FastISel lowering for the stackmap intrinsic.

llvm-svn: 210742
2014-06-12 03:29:26 +00:00
Rafael Espindola 7e577f73ee Don't put generic_category in the llvm namespace.
llvm-svn: 210737
2014-06-12 02:00:39 +00:00