Commit Graph

259586 Commits

Author SHA1 Message Date
Francis Ricci bdb8b58d16 Don't assume PTHREAD_CREATE_JOINABLE is 0 on all systems
Summary:
Lsan was using PTHREAD_CREATE_JOINABLE/PTHREAD_CREATE_DETACHED
as truthy values, which works on Linux, where the values are 0 and 1,
but this fails on OS X, where the values are 1 and 2.

Set PTHREAD_CREATE_DETACHED to the correct value for a given system.

Reviewers: kcc, glider, kubamracek, alekseyshl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31883

llvm-svn: 300221
2017-04-13 17:28:52 +00:00
Andrey Churbanov 4a9a89241b KMP_HW_SUBSET extended with NUMA support when HWLOC enabled
Differential Revision: https://reviews.llvm.org/D31600

llvm-svn: 300220
2017-04-13 17:15:07 +00:00
Craig Topper 7840dc8451 [APInt] Fix the returns description for the postfix increment/decrement operators. NFC
llvm-svn: 300219
2017-04-13 17:12:00 +00:00
Marshall Clow 5948e39297 Implement LWG#2855 - made easy by previous refactoring
llvm-svn: 300218
2017-04-13 16:57:42 +00:00
Craig Topper 72f8257cba Revert r300213 "[APSInt] Add a static_assert to ensure APSInt is packed well with APInt after r300171"
MSVC doesn't pack derived classes the same way clang/gcc do.

llvm-svn: 300217
2017-04-13 16:54:25 +00:00
Alex Shlyapnikov 8b2caae996 Cache size per class size in SizeClassAllocatorXLocalCache.
Summary:
Allocator::ClassIdToSize() is not free and calling it in every
Allocate/Deallocate has noticeable impact on perf.
Reapplying D31991 with the appropriate fixes.

Reviewers: cryptoad

Subscribers: kubamracek, llvm-commits

Differential Revision: https://reviews.llvm.org/D32024

llvm-svn: 300216
2017-04-13 16:49:16 +00:00
Brian Gesiak 0a7894d99c [Analysis] Support bitreverse in -demanded-bits pass
Summary:
* Add a bitreverse case in the demanded bits analysis pass.
* Add tests for the bitreverse (and bswap) intrinsic in the
  demanded bits pass.
* Add a test case to the BDCE tests: that manipulations to
  high-order bits are eliminated once the bits are reversed
  and then right-shifted.

Reviewers: mkuper, jmolloy, hfinkel, trentxintong

Reviewed By: jmolloy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31857

llvm-svn: 300215
2017-04-13 16:44:25 +00:00
Reid Kleckner d6fea19a97 Use the clang-cl recognized spelling of --target=
This fixes a warning. The test was passing without this change.

llvm-svn: 300214
2017-04-13 16:36:28 +00:00
Craig Topper 0b6b81ee0f [APSInt] Add a static_assert to ensure APSInt is packed well with APInt after r300171.
llvm-svn: 300213
2017-04-13 16:34:49 +00:00
Michael Kruse a8e885d87c [DeLICM] Introduce unittesting infrastructure for Known and Written. NFC.
llvm-svn: 300212
2017-04-13 16:32:46 +00:00
Michael Kruse 72f3922534 [DeLICM] Export Known and Written to DeLICMTests. NFC.
This will allow unittesting of new functionality based on
Known and Written.

llvm-svn: 300211
2017-04-13 16:32:39 +00:00
Michael Kruse a2acc11949 [DeLICM] Add Knowledge::Known. NFC.
This field will later contain a ValInst that is known to be stored
in an occupied array element.

llvm-svn: 300210
2017-04-13 16:32:31 +00:00
Reid Kleckner d87a751d88 Re-land "[clang-cl] Make all sanitizer flags available in clang-cl"
Adding RUN lines with %clang_cl was causing these tests to fail on Mac
because absolute paths there tend to start with "/User/", which is
recognized as the "/U" flag.

Re-lands r300122

llvm-svn: 300209
2017-04-13 16:32:26 +00:00
Michael Kruse fa7c8cdfc6 [DeLICM] Make Knowledge::Written an isl::union_map. NFC.
The map will later point to a ValInst that is written.

llvm-svn: 300208
2017-04-13 16:32:25 +00:00
Michael Kruse 5e6456979b [DeLICM] Rename Knowledge to KnowledgeStr. NFC.
Some debuggers get confused by different class of the same name
defined independently in different translation units.

llvm-svn: 300207
2017-04-13 16:32:16 +00:00
Shoaib Meenai 6170765a3c [libc++] Explicitly set output directory for DLL
DLLs on Windows are treated as runtime targets. Explicitly set the
output directory for them, to be consistent with other platforms.

llvm-svn: 300206
2017-04-13 16:27:38 +00:00
Tobias Edler von Koch 90df1f48d5 LTO: Pass SF_Executable flag through to InputFile::Symbol
Summary:
The linker needs to be able to determine whether a symbol is text or data to
handle the case of a common being overridden by a strong definition in an
archive. If the archive contains a text member of the same name as the common,
that function is discarded. However, if the archive contains a data member of
the same name, that strong definition overrides the common. This is a behavior
of ld.bfd, which the Qualcomm linker also supports in LTO.

Here's a test case to illustrate:

####

cat > 1.c << \!
int blah;
!

cat > 2.c << \!
int blah() {
  return 0;
}
!

cat > 3.c << \!
int blah = 20;
!

clang -c 1.c
clang -c 2.c
clang -c 3.c

ar cr lib.a 2.o 3.o
ld 1.o lib.a -t

####

The correct output is:

1.o
(lib.a)3.o

Thanks to Shankar Easwaran and Hemant Kulkarni for the test case!

Reviewers: mehdi_amini, rafael, pcc, davide

Reviewed By: pcc

Subscribers: davide, llvm-commits, inglorion

Differential Revision: https://reviews.llvm.org/D31901

llvm-svn: 300205
2017-04-13 16:24:14 +00:00
Alex Shlyapnikov d77394c5f2 Enable LSan on PowerPC64.
Summary:
With D31555 commited, looks like basic LSan functionality
works on PPC64. Time to enable LSan there.

Reviewers: eugenis

Subscribers: nemanjai, llvm-commits

Differential Revision: https://reviews.llvm.org/D31995

llvm-svn: 300204
2017-04-13 16:17:32 +00:00
Krzysztof Parzyszek c87c48019c [Hexagon] Unxfail passing tests
r300198 fixed a problem that caused two tests to be xfailed. Unxfail
these tests now, since they are passing.

llvm-svn: 300203
2017-04-13 16:05:35 +00:00
Sanjay Patel a8ebb46e0e [InstCombine] fix assert to not always be true
llvm-svn: 300202
2017-04-13 16:05:01 +00:00
Sanjay Patel 104e36a0e9 [InstCombine] add/move tests for or-of-icmps; NFC
If we had these tests, the bug caused by https://reviews.llvm.org/rL299851 would have been caught sooner.
There's also an assert in the code that should have caught that bug, but the assert line itself has a bug.

llvm-svn: 300201
2017-04-13 15:46:39 +00:00
Geoff Berry 85a530fb59 Re-apply "[GVNHoist] Move GVNHoist to function simplification part of pipeline."
This reverts commit r296872 now that PR32153 has been fixed.

llvm-svn: 300200
2017-04-13 15:36:25 +00:00
Krzysztof Parzyszek 5619952ee1 [Hexagon] Implement HexagonTargetLowering::CanLowerReturn
Patch by Michael Wu.

Differential Revision: https://reviews.llvm.org/D32000

llvm-svn: 300199
2017-04-13 15:05:51 +00:00
Krzysztof Parzyszek 3e2046cd1b [Hexagon] Fix "LowerFormalArguments emitted a value with the wrong type!" assertion
Patch by Michael Wu.

Differential Revision: https://reviews.llvm.org/D31999

llvm-svn: 300198
2017-04-13 15:00:18 +00:00
Marshall Clow e9ca2bb8ab Refactor throw_with_nested. NFC.
llvm-svn: 300197
2017-04-13 14:41:45 +00:00
Serge Pavlov 49acf9c8eb Use methods to access data stored with frame instructions
Instructions CALLSEQ_START..CALLSEQ_END and their target dependent
counterparts keep data like frame size, stack adjustment etc. These
data are accessed by getOperand using hard coded indices. It is
error prone way. This change implements the access by special methods,
which improve readability and allow changing data representation without
massive changes of index values.

Differential Revision: https://reviews.llvm.org/D31953

llvm-svn: 300196
2017-04-13 14:10:52 +00:00
Francis Ricci e32a66b2de Free zone name when destroying malloc zone
Summary:
The darwin interceptor for malloc_destroy_zone manually frees the
zone struct, but does not free the name component. Make sure to
free the name if it has been set.

Reviewers: kubamracek, alekseyshl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31983

llvm-svn: 300195
2017-04-13 14:00:24 +00:00
Maxim Ostapenko 661033d575 [lsan] Reenable lsan tests on ARM bots
This patch addresses pr32636. Enable lsan tests on ARM bots filtering out Thumb targets.
Tested locally on ARM Arndale board in two configurations:

1) CFLAGS="-march=armv7-a"
	Testing Time: 37.57s
	Expected Passes    : 69
	Unsupported Tests  : 7

2) CFLAGS="-march=armv7-a -mthumb"
	Testing Time: 0.16s
	Unsupported Tests  : 76

Differential Revision: https://reviews.llvm.org/D32007

llvm-svn: 300194
2017-04-13 12:00:56 +00:00
NAKAMURA Takumi 9763a3249f llvm/test/BugPoint/compile-custom.ll: Use %/s for its path not to be mis-escaped.
llvm-svn: 300193
2017-04-13 11:40:32 +00:00
Peter Smith 4dc4bc4e3c [ELF] Tidy up handleARMTlsRelocation [NFC]
Replace addModuleReloc with AddTlsReloc so that we can use it for both the
module relocation and the offset relocation.

Differential Revision: https://reviews.llvm.org/D31751

llvm-svn: 300192
2017-04-13 10:56:40 +00:00
Eric Fiselier 859f80b06f Add TEST_NOEXCEPT_FALSE to support D31738
llvm-svn: 300191
2017-04-13 10:17:23 +00:00
Ayman Musa 62d1c71676 [X86] Added missing mayLoad/mayStore attributes to some X86 instructions.
Throughout the effort of automatically generating the X86 memory folding tables these missing information were encountered.
This is a preparation work for a future patch including the automation of these tables.

Differential Revision: https://reviews.llvm.org/D31714

llvm-svn: 300190
2017-04-13 10:03:45 +00:00
Artem Dergachev 6dd11048f5 [analyzer] Enforce super-region classes for various memory regions.
We now check the type of the super-region pointer for most SubRegion classes
in compile time; some checks are run-time though.

This is an API-breaking change (we now require explicit casts to specific region
sub-classes), but in practice very few checkers are affected.

Differential Revision: https://reviews.llvm.org/D26838

llvm-svn: 300189
2017-04-13 09:56:07 +00:00
George Rimar d4998b0344 [DWARF] - Simplify (use dyn_cast instead of isa + cast).
This addresses post commit review comments for r300039.

llvm-svn: 300188
2017-04-13 09:52:50 +00:00
Artem Dergachev b3241f41b2 [analyzer] Add numerous assertions to SVal, SymExpr, and MemRegion classes.
Clean up vtable anchors (remove anchors for regions that have regular
out-of-line virtual methods, add anchors for regions that don't have those).

Fix private/public methods (all constructors should now be private for leaf
classes, protected for abstract classes).

No functional change intended, only extra sanity checks and cleanups.

Differential Revision: https://reviews.llvm.org/D26837

llvm-svn: 300187
2017-04-13 09:48:05 +00:00
Daniel Sanders d0656a3af1 [globalisel][tablegen] Report more detail in some SelectionDAG import failures. NFC
Reviewers: ab, t.p.northover, qcolombet, aditya_nandakumar, rovka

Reviewed By: ab

Subscribers: dberris, kristof.beyls, igorb, llvm-commits

Differential Revision: https://reviews.llvm.org/D31325

llvm-svn: 300186
2017-04-13 09:45:37 +00:00
Ayman Musa 2d33869806 Reverting cmake/modules/AddLLVM.cmake changes from revision 300184 (Added by mistake).
llvm-svn: 300185
2017-04-13 09:26:49 +00:00
Ayman Musa c494718050 [X86] Change instructions names to keep consistency with the naming convention. NFC
Differential Revision: https://reviews.llvm.org/D31743

llvm-svn: 300184
2017-04-13 09:12:32 +00:00
Ayal Zaks cd712b6c49 [LV] Refactor ILV to provide vectorizeInstruction(); NFC
Refactoring InnerLoopVectorizer's vectorizeBlockInLoop() to provide
vectorizeInstruction(). Aligning DeadInstructions with its only user.
Facilitates driving the transformation by VPlan - follows
https://reviews.llvm.org/D28975 and its tentative breakdown.

Differential Revision: https://reviews.llvm.org/D31997

llvm-svn: 300183
2017-04-13 09:07:23 +00:00
Peter Smith cec1e260c3 [ELF] Mark ARM Exceptions that refer to folded code as not live
ARM Exception Index Table sections .ARM.exidx have an implicit dependency
on code sections via SHF_LINK_ORDER. When code sections are folded by ICF
we must mark the unique .ARM.exidx table that describes it as not live
to prevent an illegal entry in the exception table.
    
Note that we do not try and follow the relocations from the .ARM.exidx
section to the .ARM.extab sections to mark these as not live. Leaving
these sections is not a correctness problem. In theory these could be
removed via an application of garbage collection.
    
Fixes https://bugs.llvm.org/show_bug.cgi?id=32614

Differential Revision: https://reviews.llvm.org/D31932

llvm-svn: 300182
2017-04-13 08:52:58 +00:00
Akira Hatanaka 1c685cfe33 Revert "[clang-cl] Make all sanitizer flags available in clang-cl"
This reverts commit 47979b20b475664013d19382fc6875b5b9f3ed9d.

This was causing a couple of bots to fail.

http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/30152

llvm-svn: 300181
2017-04-13 08:02:29 +00:00
Diana Picus 7e5db62ad5 Revert "Cache size per class size in SizeClassAllocatorXLocalCache."
This reverts commit r300107 because it broke the ARM and AArch64
buildbots.

llvm-svn: 300180
2017-04-13 07:39:04 +00:00
Craig Topper 9bd2d55825 Fix typo in static_assert message. NFC
llvm-svn: 300179
2017-04-13 07:31:52 +00:00
Artem Dergachev 12294f8d2e [analyzer] Simplify values in binary operations a bit more aggressively.
SValBuilder tries to constant-fold symbols in the left-hand side of the symbolic
expression whenever it fails to evaluate the expression directly. However, it
only constant-folds them when they are atomic expressions, not when they are
complicated expressions themselves. This patch adds recursive constant-folding
to the left-hand side subexpression (there's a lack of symmetry because we're
trying to have symbols on the left and constants on the right). As an example,
we'd now be able to handle operations similar to "$x + 1 < $y", when $x is
constrained to a constant.

rdar://problem/31354676

Differential Revision: https://reviews.llvm.org/D31886

llvm-svn: 300178
2017-04-13 07:20:04 +00:00
Lang Hames f8e1841186 [ORC] Temporarily disable the RPC Error/Expected unit tests while I investigate
bot failures.

llvm-svn: 300177
2017-04-13 06:20:45 +00:00
Rui Ueyama 9d773f3cb2 Add comments for the RELRO segment.
RELRO is a feature to make segments read-only after dynamic relocations
are applied. It is different from read-only segments because RELRO is
initially writable. And of course RELRO is different from writable
segments.

RELRO is not a very well known feature. We have a series of checks to
make a decision whether a section should be in a RELRO segment or not,
but we didn't describe why. This patch adds comments to explain how
that decision is made.

llvm-svn: 300176
2017-04-13 05:40:07 +00:00
Eric Fiselier 4365d4e951 Cleanup any_cast failure test
llvm-svn: 300175
2017-04-13 05:27:55 +00:00
Lang Hames 7d3aaedc13 [Orc] Fix bool serialization for RawByteChannels.
The bool type may be larger than the char type, so assuming we can cast from
bool to char and write a byte out to the stream is unsafe.

Hopefully this will get RPCUtilsTest.ReturnExpectedFailure passing on the bots.

llvm-svn: 300174
2017-04-13 05:23:50 +00:00
Lang Hames 068655911e [ORC] Remove more extraneous semicolons from r300167, rename the RPC Expected
tests to be consistent with the Error tests.

llvm-svn: 300173
2017-04-13 05:05:26 +00:00
George Burgess IV 8a464a7592 Remove more lies from the LangRef.
Same change as in r300168, but for invoke instead of call.

llvm-svn: 300172
2017-04-13 05:00:31 +00:00