Commit Graph

206199 Commits

Author SHA1 Message Date
Greg Clayton 88c05f54a0 Use double-checked locking to avoid locking the Module mutex if we don't need to. This avoid a deadlock we were seeing in Xcode.
<rdar://problem/21512067>

llvm-svn: 243180
2015-07-24 23:38:01 +00:00
Michael Kruse be16d22f04 Normalize whitespace in makefiles
Tabs for rules and space for line continuations.

llvm-svn: 243179
2015-07-24 23:30:31 +00:00
Rui Ueyama 2296dc137c COFF: Fix base relocation type for x86.
llvm-svn: 243178
2015-07-24 23:24:45 +00:00
Rui Ueyama 3cb895c930 COFF: Fix __ImageBase symbol relocation.
__ImageBase is a special symbol whose value is the image base address.
Previously, we handled __ImageBase symbol as an absolute symbol.

Absolute symbols point to specific locations in memory and the locations
never change even if an image is base-relocated. That means that we
don't have base relocation entries for absolute symbols.

This is not a case for __ImageBase. If an image is base-relocated, its
base address changes, and __ImageBase needs to be shifted as well.
So we have to have base relocations for __ImageBase. That means that
__ImageBase is not really an absolute symbol but a different kind of
symbol.

In this patch, I introduced a new type of symbol -- DefinedRelative.
DefinedRelative is similar to DefinedAbsolute, but it has not a VA but RVA
and is a subject of base relocation. Currently only __ImageBase is of
the new symbol type.

llvm-svn: 243176
2015-07-24 22:58:44 +00:00
Jason Molenda 67e5ba33e2 Log socket communications to LIBLLDB_LOG_COMMUNICATION instead of
the Host channel.

http://reviews.llvm.org/D11497

llvm-svn: 243175
2015-07-24 22:42:03 +00:00
Zachary Turner fbf8dad8eb Some fixes to get LLDB compiling with MSVC 2015.
llvm-svn: 243174
2015-07-24 22:32:22 +00:00
Alex Lorenz 1bb48de1f9 MIR Serialization: Serialize MachineFrameInfo's callee saved information.
This commit serializes the callee saved information from the class
'MachineFrameInfo'. This commit extends the YAML mappings for the fixed and
the ordinary stack objects and adds an optional 'callee-saved-register'
attribute. This attribute is used to serialize the callee save information.

llvm-svn: 243173
2015-07-24 22:22:50 +00:00
Lawrence Hu dc8a83b53b Handle loop with negtive induction variable increment
This patch extend LoopReroll pass to hand the loops which
is similar to the following:

      while (len > 1) {
            sum4 += buf[len];
            sum4 += buf[len-1];
            len -= 2;
        }

llvm-svn: 243171
2015-07-24 22:01:49 +00:00
Alexey Samsonov 398a301893 [CMake] Workaround for PR24222: don't fail if we can't target COMPILER_RT_TEST_TARGET_TRIPLE unless it was explicitly set.
Summary:
Although we assume that we can always target host triple, relax
this check to avoid failing at configure-time for cases when we are
not able to correctly infer/verify host triple for some reasons.

See http://llvm.org/bugs/show_bug.cgi?id=24222 for more details.

Reviewers: hans

Subscribers: llvm-commits

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

llvm-svn: 243170
2015-07-24 22:01:07 +00:00
Aaron Ballman f0248a0e7d Replacing some diagnostic string literals with tablegen equivalents because the wording is identical; NFC.
llvm-svn: 243169
2015-07-24 21:49:29 +00:00
Michael Kruse 392417808d Add isl_ffs.c to file list in autoconf builds
In most configurations it doesn't contain any symbol, but add for
completeness.

llvm-svn: 243168
2015-07-24 21:40:22 +00:00
Pete Cooper 3191697138 Remove unnecessary null check. NFC.
Since both places which set this variable do so with dyn_cast, and not
dyn_cast_or_null, its impossible to get a nullptr here, so we can remove
the check.

llvm-svn: 243167
2015-07-24 21:38:01 +00:00
Siva Chandra d26eb907bc Add option eTypeOptionHideEmptyAggregates.
Summary:
For certain data structures, when the synthetic child provider returns
zero children, a summary like "Empty instance of <typename>" could be
more appropriate than something like "size=0 {}". This new option helps
hide the trailing "{}".

This is also exposed with a -h option for the command "type summary add".

Reviewers: granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 243166
2015-07-24 21:30:58 +00:00
Hans Wennborg fd4dfdcea1 LibompMicroTests.cmake: Invoke 'test' instead of using '[ x -eq y ]'
I was getting this cmake error on Mac OS X:

  CMake Error: Error in cmake code at
  /tmp/openmp/runtime/cmake/LibompMicroTests.cmake:140:
  Parse error.  Function missing ending ")".  Instead found bad character with text "[".

Perhaps invoking 'test' is less confusing for cmake.

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

llvm-svn: 243165
2015-07-24 21:24:48 +00:00
Pete Cooper 7679afda82 Use make_range(rbegin(), rend()) to allow foreach loops. NFC.
Instead of the pattern

for (auto I = x.rbegin(), E = x.end(); I != E; ++I)

we can use make_range to construct the reverse range and iterate using
that instead.

llvm-svn: 243163
2015-07-24 21:13:43 +00:00
Duncan P. N. Exon Smith 16bc6e1727 DI: Fix unit tests after r243160
These always empty fields are gone, so don't test that they're empty.

llvm-svn: 243162
2015-07-24 21:11:06 +00:00
Michael J. Spencer 84487f1174 [ELF2] Add a new ELF linker based on the new PE/COFF linker.
Differential Revision: http://reviews.llvm.org/D11188

llvm-svn: 243161
2015-07-24 21:03:07 +00:00
Duncan P. N. Exon Smith b9e045af44 DI: Remove unnecessary DICompositeTypeBase
Remove unnecessary and confusing common base class for `DICompositeType`
and `DISubroutineType`.

While at a high-level `DISubroutineType` is a sort of composite of other
types, it has no shared code paths, and its fields are completely
disjoint.  This relationship was left over from the old debug info
hierarchy.

llvm-svn: 243160
2015-07-24 20:56:36 +00:00
Duncan P. N. Exon Smith 260fa8a75b DI: Simplify DebugInfoFinder::processType(), NFC
Handle `DISubroutineType` up-front rather than as part of a branch for
`DICompositeTypeBase`.  The only shared code path was looking through
the base type, but `DISubroutineType` can never have a base type.

This also removes the last use of `DICompositeTypeBase`, since we can
strengthen the cast to `DICompositeType`.

llvm-svn: 243159
2015-07-24 20:56:10 +00:00
Duncan P. N. Exon Smith 3c5a56b13c DI: Remove dead code: getDICompositeType()
llvm-svn: 243158
2015-07-24 20:46:46 +00:00
Duncan P. N. Exon Smith acd8cf8582 AsmPrinter: Use DICompositeType in updateAcceleratorTables(), NFC
`DISubroutineType` is impossible at this `dyn_cast` site, since we're
only dealing with named types and `DISubroutineType` cannot be named.
Strengthen the `dyn_cast` to `DICompositeType`.

llvm-svn: 243157
2015-07-24 20:45:26 +00:00
Alex Lorenz ab4cbcfda7 MIR Serialization: Serialize the simple virtual register allocation hints.
This commit serializes the virtual register allocations hints of type 0.
These hints specify the preferred physical registers for allocations.

llvm-svn: 243156
2015-07-24 20:35:40 +00:00
Duncan P. N. Exon Smith bd210e638a DI: Make getOrCreateLimitedType() return DICompositeType, NFC
Change `getOrCreateLimitedType()` to return a `DICompositeType` and
remove the casts from its callers.  Inside, I've strengthened a `cast`
from `DICompositeTypeBase`, but the casts in the callers already prove
that this is safe.  There should be no functionality change here.

llvm-svn: 243155
2015-07-24 20:34:41 +00:00
Michael Kruse 1bbe346cef Make the lit configuration Python 3 compatible
by using the same techniques as LLVM's lit configuration.

llvm-svn: 243154
2015-07-24 20:33:22 +00:00
Yaron Keren e896939e54 Select the highest version of the mingw toolchain found using Generic_GCC::GCCVersion
similar to the way Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple works.

llvm-svn: 243153
2015-07-24 20:18:27 +00:00
Duncan P. N. Exon Smith 338aef0a07 DI: Remove DIDerivedTypeBase
Remove an unnecessary (and confusing) common subclass for
`DIDerivedType` and `DICompositeType`.  These classes aren't really
related, and even in the old debug info hierarchy, there was a
long-standing FIXME to separate them.

llvm-svn: 243152
2015-07-24 20:16:36 +00:00
Ismail Pazarbasi 0193c3a40e __tsan::ThreadCreate takes incorrect value for detached argument
Summary:
PTHREAD_CREATE_DETACHED has a different value on Mac OS X. Since both
PTHREAD_CREATE_JOINABLE and PTHREAD_CREATE_DETACHED are non-zero,
`__tsan::ThreadCreate` always creates detached threads.

Reviewers: kcc, samsonov, glider

Subscribers: llvm-commits

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

llvm-svn: 243151
2015-07-24 20:00:49 +00:00
Duncan P. N. Exon Smith dbfc010691 Verifier: Sink filename check into visitMDCompositeType(), NFC
We really only want to check this for unions and classes (all the other
tags have been ruled out), so simplify the check and move it to the
right place.

llvm-svn: 243150
2015-07-24 19:57:19 +00:00
Duncan P. N. Exon Smith df9c9ff43b Verifier: Remove unnecessary references to DW_TAG_subroutine_type, NFC
Remove unnecessary references to `DW_TAG_subroutine_type` in
`visitDICompositeType()` and `visitDIDerivedTypeBase()`, since
`visitDISubroutineType()` doesn't call either of those (and shouldn't,
since subroutine types are really quite special).

llvm-svn: 243149
2015-07-24 19:52:18 +00:00
Duncan P. N. Exon Smith 89c5e6ff49 DI: Clarify isUnsignedDIType(), NFC
Refactor `isUnsignedDIType()` to deal with `DICompositeType` explicitly.
Since `DW_TAG_subroutine_type` isn't handled here (the assertions about
tags rule it out), this allows strengthening the `dyn_cast` to
`DIDerivedType`.

Besides making the code clearer, this it removes a use of
`DIDerivedTypeBase`.

llvm-svn: 243148
2015-07-24 19:42:12 +00:00
Renato Golin 57cb9919c5 [libunwind] Flip order of extern "C" and attribute(visibility)
GCC doesn't seems to like having the attribute before extern, but
Clang accepts it either way. This patch makes it compile on both.

llvm-svn: 243147
2015-07-24 19:29:05 +00:00
Pete Cooper 098f7c1fcb Add const to some Type* parameters which didn't need to be mutable. NFC.
We were only getting the size of the type which doesn't need to modify
the type.

llvm-svn: 243146
2015-07-24 19:19:26 +00:00
Diego Novillo b9bf447d90 Remove unused variable. NFC.
llvm-svn: 243145
2015-07-24 19:18:32 +00:00
Yaron Keren a749b1b2bd Base the sys-root/mingw/include path on sysroot and not on /usr.
Thanks to Richard Smith for pointing this out!

llvm-svn: 243144
2015-07-24 19:18:17 +00:00
Duncan P. N. Exon Smith 2ecfb1e269 DI: Strengthen some dyn_casts to DIDerivedType, NFC
The surrounding code proves in both cases that these must be
`DIDerivedType` if they're `DIDerivedTypeBase`, so strengthen the
`dyn_cast`s to the more specific type.

llvm-svn: 243143
2015-07-24 19:17:20 +00:00
Michael Kruse d3059f3853 Compile fix; add missing ISL files
The last ISL update added two files that we must also add to Polly. 

llvm-svn: 243142
2015-07-24 19:09:27 +00:00
Jingyue Wu abb05aa3c6 Remove the user-count threshold when analyzing read attributes
Summary:
This threshold limited FunctionAttrs ability to prove arguments to be read-only. 
In NVPTX, a specialized instruction ld.global.nc can be used to load memory
with non-coherent texture cache. We notice that in SHOC [1] benchmark, some
function arguments are not marked with readonly because FunctionAttrs reaches
a hardcoded threshold when analysis uses.

Removing this threshold won't cause significant regression in compilation time, because the worst-case time complexity of the algorithm is still O(# of instructions) for each parameter.

Patched by Xuetian Weng.  

[1] https://github.com/vetter/shoc

Reviewers: nlewycky, jingyue, nicholas

Subscribers: nicholas, test, llvm-commits

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

llvm-svn: 243141
2015-07-24 19:05:53 +00:00
Philip Reames fa2c630f79 [RewriteStatepointsForGC] Adjust naming scheme to be more stable
The names for instructions inserted were previous dependent on iteration order.  By deriving the names from the original instructions, we can avoid instability in tests without resorting to ordered traversals.  It also makes the IR mildly easier to read at large scale.

llvm-svn: 243140
2015-07-24 19:01:39 +00:00
Evgeniy Stepanov 7fb865ea8e [asan] Only link liblog on Android when it exists.
With r242975, liblog is only used on certain older platforms.

llvm-svn: 243139
2015-07-24 19:00:16 +00:00
Duncan P. N. Exon Smith 099ea1c9ae DI: Strengthen block-byref cast to DIDerivedType, NFC
This code is visiting the members of a block-byref, and we know those
are all `DIDerivedType`.  Strengthen the cast.

llvm-svn: 243138
2015-07-24 18:58:32 +00:00
Evgeniy Stepanov f021b9b3b3 [asan] Fix android system property access on aarch64.
__system_property_get is gone from the NDK headers and libs in 64-bit
toolchains, but it is still exported by platform libc.so.

llvm-svn: 243137
2015-07-24 18:57:44 +00:00
Pete Cooper 0debbdc872 Use foreach loops for StructType::elements(). NFC.
We had a few places where we did

for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {

but those could instead do

for (auto *EltTy : STy->elements()) {

llvm-svn: 243136
2015-07-24 18:55:49 +00:00
Pete Cooper 6aaad8d88d Add const to a bunch of Type* in DataLayout. NFC.
Almost all methods in DataLayout took mutable pointers but didn't need to.
These were only accessing constant methods of the types, or using the Type*
to key a map.  Neither of these needs a mutable pointer.

llvm-svn: 243135
2015-07-24 18:29:09 +00:00
Duncan P. N. Exon Smith 6ac940db19 DI: Only DICompositeType has getElements(), NFC
There is an assertion inside `DICompositeTypeBase::getElements()` that
`this` is not a `DISubroutineType`, leaving only `DICompositeType`.
Make that clear at the call sites.

llvm-svn: 243134
2015-07-24 18:17:17 +00:00
Chih-Hung Hsieh 0b0eeaaaf6 Correct x86_64 Android fp128 mangled name
These changes are for Android x86_64 targets to be compatible with current Android g++.
https://llvm.org/bugs/show_bug.cgi?id=23897
Use 'g' and 'Cg' for "long double" and "long double _Complex" mangled type names.

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

llvm-svn: 243133
2015-07-24 18:12:54 +00:00
Tom Stellard 7a09e88b6e Fix double implementation of log
We need to use M_LOG2E instead of M_LOG2E_F.

llvm-svn: 243132
2015-07-24 18:07:14 +00:00
Tom Stellard 44b6117dfd Implement accurate log2 function
Use the implementation was ported from the AMD builtin library rather
than LLVM Intrinsics.

This has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 243131
2015-07-24 18:07:12 +00:00
Tom Stellard f01ffa9ddc Use llvm intrinsics for native_log and native_log2
llvm-svn: 243130
2015-07-24 18:07:06 +00:00
Duncan P. N. Exon Smith ac346ba5a1 DI: Make StaticDataMemberCache type-safe, NFC
Change `StaticDataMemberCache` to store references to `DIDerivedType`
directly, and remove now-unnecessary casts from the accessors.

llvm-svn: 243129
2015-07-24 18:05:58 +00:00
Alex Lorenz c7bf20403b MIR Parser: Run the machine verifier after initializing machine functions.
llvm-svn: 243128
2015-07-24 17:44:49 +00:00