Tom Stellard [Mon, 28 Mar 2016 16:10:13 +0000 (16:10 +0000)]
AMDGPU/SI: Limit load clustering to 16 bytes instead of 4 instructions
Summary:
This helps prevent load clustering from drastically increasing register
pressure by trying to cluster 4 SMRDx8 loads together. The limit of 16
bytes was chosen, because it seems like that was the original intent
of setting the limit to 4 instructions, but more analysis could show
that a different limit is better.
This fixes yields small decreases in register usage with shader-db, but
also helps avoid a large increase in register usage when lane mask
tracking is enabled in the machine scheduler, because lane mask tracking
enables more opportunities for load clustering.
shader-db stats:
2379 shaders in 477 tests
Totals:
SGPRS: 49744 -> 48600 (-2.30 %)
VGPRS: 34120 -> 34076 (-0.13 %)
Code Size: 1282888 -> 1283184 (0.02 %) bytes
LDS: 28 -> 28 (0.00 %) blocks
Scratch: 495616 -> 492544 (-0.62 %) bytes per wave
Max Waves: 6843 -> 6853 (0.15 %)
Wait states: 0 -> 0 (0.00 %)
Reviewers: nhaehnle, arsenm
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D18451
llvm-svn: 264589
Davide Italiano [Mon, 28 Mar 2016 15:54:01 +0000 (15:54 +0000)]
[SimplifyLibCalls] Transform printf("%s", "a") -> putchar('a').
llvm-svn: 264588
Vedant Kumar [Mon, 28 Mar 2016 15:52:08 +0000 (15:52 +0000)]
[PGO] Fix name encoding for ObjC-like functions
Function names in ObjC can have spaces in them. This interacts poorly
with name compression, which uses spaces to separate PGO names. Fix the
issue by using a different separator and update a test.
I chose "\01" as the separator because 1) it's non-printable, 2) we
strip it from PGO names, and 3) it's the next natural choice once "\00"
is discarded (that one's overloaded).
Differential Revision: http://reviews.llvm.org/D18516
llvm-svn: 264587
Vedant Kumar [Mon, 28 Mar 2016 15:49:08 +0000 (15:49 +0000)]
[Coverage] Strip <unknown> from PGO names if no filenames are available
Patch suggested by David Li!
llvm-svn: 264586
Davide Italiano [Mon, 28 Mar 2016 15:44:21 +0000 (15:44 +0000)]
[LTO] Internalize symbols.
IPO doesn't work very well across symbols referenced
by others TUs. The linker here tries to evaluate
which symbols are safe to internalize and switches
their linkage.
Differential Revision: http://reviews.llvm.org/D18415
llvm-svn: 264585
Krzysztof Parzyszek [Mon, 28 Mar 2016 15:43:03 +0000 (15:43 +0000)]
[Hexagon] Improve handling of unaligned vector loads and stores
llvm-svn: 264584
James Y Knight [Mon, 28 Mar 2016 15:05:30 +0000 (15:05 +0000)]
NFC: skip FenceInst up-front in AtomicExpandPass.
llvm-svn: 264583
Nico Weber [Mon, 28 Mar 2016 14:55:24 +0000 (14:55 +0000)]
Reduce size of DefinitionData from 120 to 96 bytes on Windows.
In the Microsoft ABI, only bitfields with identical types get
packed together, so use unsigned consistently instead of a
bool / unsigned mix.
No intended behavior change.
llvm-svn: 264582
Krzysztof Parzyszek [Mon, 28 Mar 2016 14:52:21 +0000 (14:52 +0000)]
[Hexagon] Only use restore functions for single register at -Oz
llvm-svn: 264581
Krzysztof Parzyszek [Mon, 28 Mar 2016 14:42:03 +0000 (14:42 +0000)]
[Hexagon] Speed up frame lowering when no optimizations are enabled
- Do not optimize stack slots in optnone functions.
- Get aligned-base register from HexagonMachineFunctionInfo instead of
looking for ALIGNA instruction in the function's body.
llvm-svn: 264580
Douglas Katzman [Mon, 28 Mar 2016 14:00:11 +0000 (14:00 +0000)]
Sparc: silently ignore .proc assembler directive
Differential Revision: http://reviews.llvm.org/D18463
llvm-svn: 264579
Jacques Pienaar [Mon, 28 Mar 2016 13:09:54 +0000 (13:09 +0000)]
[lanai] Add Lanai backend.
Add the Lanai backend to lib/Target.
General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend" (http://lists.llvm.org/pipermail/llvm-dev/2016-February/095118.html).
Differential Revision: http://reviews.llvm.org/D17011
llvm-svn: 264578
Alexey Bataev [Mon, 28 Mar 2016 12:58:34 +0000 (12:58 +0000)]
Revert "[OPENMP] Allow runtime insert its own code inside OpenMP regions."
Reverting because of failed tests.
llvm-svn: 264577
Alexey Bataev [Mon, 28 Mar 2016 12:52:58 +0000 (12:52 +0000)]
[OPENMP] Allow runtime insert its own code inside OpenMP regions.
Solution unifies interface of RegionCodeGenTy type to allow insert
runtime-specific code before/after main codegen action defined in
CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy
for general OpenMP directives, but must be allowed to insert its own
(required) code to support target specific codegen.
llvm-svn: 264576
Hongbin Zheng [Mon, 28 Mar 2016 12:41:49 +0000 (12:41 +0000)]
Add fine-grain dependences analysis to release notes.
Differential Revision: http://reviews.llvm.org/D17905
llvm-svn: 264575
Michael Zuckerman [Mon, 28 Mar 2016 12:23:09 +0000 (12:23 +0000)]
[CLANG][avx512][BUILTIN] Adding fixupimm{pd|ps|sd|ss}
getexp{sd|ss} getmant{sd|ss} kunpck{di|si} loada{pd|ps} loaddqu{di|hi|qi|si} max{sd|ss} min{sd|ss} kmov16 builtins to clang
Differential Revision: http://reviews.llvm.org/D18215
llvm-svn: 264574
Hal Finkel [Mon, 28 Mar 2016 11:23:21 +0000 (11:23 +0000)]
[SROA] Fix typo in comment
llvm-svn: 264573
Hal Finkel [Mon, 28 Mar 2016 11:13:03 +0000 (11:13 +0000)]
C++11 is required, remove some preprocessor checks for it
We require C++11 to build, so remove a few remaining preprocessor checks for
'__cplusplus >= 201103L'. This should always be true.
llvm-svn: 264572
Kuba Brecka [Mon, 28 Mar 2016 10:21:35 +0000 (10:21 +0000)]
Fix-up for OS X test failure after r264451 ("Add memset, memmove, and memcpy to the common interceptors")
llvm-svn: 264571
Alexey Bataev [Mon, 28 Mar 2016 10:12:03 +0000 (10:12 +0000)]
Revert "[OPENMP] Allow runtime insert its own code inside OpenMP regions."
This reverts commit
3ee791165100607178073f14531a0dc90c622b36.
llvm-svn: 264570
Alexey Bataev [Mon, 28 Mar 2016 09:53:43 +0000 (09:53 +0000)]
[OPENMP] Allow runtime insert its own code inside OpenMP regions.
Solution unifies interface of RegionCodeGenTy type to allow insert
runtime-specific code before/after main codegen action defined in
CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy
for general OpenMP directives, but must be allowed to insert its own
(required) code to support target specific codegen.
llvm-svn: 264569
Chuang-Yu Cheng [Mon, 28 Mar 2016 09:04:23 +0000 (09:04 +0000)]
[Power9] Implement new altivec instructions: bcd* series
This patch implements the following altivec instructions:
- Decimal Convert From/to National/Zoned/Signed-QWord:
bcdcfn. bcdcfz. bcdctn. bcdctz. bcdcfsq. bcdctsq.
- Decimal Copy-Sign/Set-Sign:
bcdcpsgn. bcdsetsgn.
- Decimal Shift/Unsigned-Shift/Shift-and-Round:
bcds. bcdus. bcdsr.
- Decimal (Unsigned) Truncate:
bcdtrunc. bcdutrunc.
Total 13 instructions
Thanks Amehsan's advice! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D17838
llvm-svn: 264568
Chuang-Yu Cheng [Mon, 28 Mar 2016 08:34:28 +0000 (08:34 +0000)]
[Power9] Implement new vsx instructions: insert, extract, test data class, min/max, reverse, permute, splat
This change implements the following vsx instructions:
- Scalar Insert/Extract
xsiexpdp xsiexpqp xsxexpdp xsxsigdp xsxexpqp xsxsigqp
- Vector Insert/Extract
xviexpdp xviexpsp xvxexpdp xvxexpsp xvxsigdp xvxsigsp
xxextractuw xxinsertw
- Scalar/Vector Test Data Class
xststdcdp xststdcsp xststdcqp
xvtstdcdp xvtstdcsp
- Maximum/Minimum
xsmaxcdp xsmaxjdp
xsmincdp xsminjdp
- Vector Byte-Reverse/Permute/Splat
xxbrd xxbrh xxbrq xxbrw
xxperm xxpermr
xxspltib
30 instructions
Thanks Nemanja for invaluable discussion! Thanks Kit's great help!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16842
llvm-svn: 264567
Elena Demikhovsky [Mon, 28 Mar 2016 07:47:58 +0000 (07:47 +0000)]
AVX-512: Fixed ICMP instruction selection for i1 operands
ICMP instruction selection fails on SKX and KNL for i1 operand.
I use XOR to resolve:
(A == B) is equivalent to (A xor B) == 0
Differential Revision: http://reviews.llvm.org/D18511
llvm-svn: 264566
Chuang-Yu Cheng [Mon, 28 Mar 2016 07:38:01 +0000 (07:38 +0000)]
[Power9] Implement new vsx instructions: quad-precision move, fp-arithmetic
This change implements the following vsx instructions:
- quad-precision move
xscpsgnqp, xsabsqp, xsnegqp, xsnabsqp
- quad-precision fp-arithmetic
xsaddqp(o) xsdivqp(o) xsmulqp(o) xssqrtqp(o) xssubqp(o)
xsmaddqp(o) xsmsubqp(o) xsnmaddqp(o) xsnmsubqp(o)
22 instructions
Thanks Nemanja and Kit for careful review and invaluable discussion!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
http://reviews.llvm.org/D16110
llvm-svn: 264565
Richard Smith [Mon, 28 Mar 2016 06:08:37 +0000 (06:08 +0000)]
P0138R2: Allow direct-list-initialization of an enumeration from an integral
value that can convert to the enum's underlying type.
llvm-svn: 264564
Richard Thomson [Mon, 28 Mar 2016 04:15:41 +0000 (04:15 +0000)]
clang-tidy: Fix broken buildbot
VS 2013 does not support char16_t or char32_t
llvm-svn: 264563
David Majnemer [Mon, 28 Mar 2016 03:19:50 +0000 (03:19 +0000)]
Fix serialization/deserialization for __uuidof
I broke this back in r264529 because I forgot to serialize the UuidAttr
member. Fix this by replacing the UuidAttr with a StringRef which is
properly serialized and deserialized.
llvm-svn: 264562
NAKAMURA Takumi [Mon, 28 Mar 2016 02:14:49 +0000 (02:14 +0000)]
llvm/test/Transforms/FunctionImport/funcimport.ll: -stats REQUIRES +Asserts.
llvm-svn: 264561
Rafael Espindola [Mon, 28 Mar 2016 01:31:11 +0000 (01:31 +0000)]
R_AARCH64_PREL64 is relative.
llvm-svn: 264560
Vedant Kumar [Mon, 28 Mar 2016 01:16:12 +0000 (01:16 +0000)]
[Coverage] Fix the way we load "<unknown>:func" records
When emitting coverage mappings for functions with local linkage and an
unknown filename, we use "<unknown>:func" for the PGO function name. The
problem is that we don't strip "<unknown>" from the name when loading
coverage data, like we do for other file names. Fix that and add a test.
llvm-svn: 264559
Duncan P. N. Exon Smith [Mon, 28 Mar 2016 00:03:12 +0000 (00:03 +0000)]
BitcodeWriter: Replace dead code with an assertion, NFC
The caller of ValueEnumerator::EnumerateOperandType never sends in
metadata. Assert that, and remove the unnecessary logic.
llvm-svn: 264558
Duncan P. N. Exon Smith [Sun, 27 Mar 2016 23:59:32 +0000 (23:59 +0000)]
BitcodeWriter: Reuse writeMetadataRecords, NFC
Change writeFunctionMetadata to call writeMetadataRecords. For now
there's no functionality change, but makes it easy to serialize other
types of metadata in the function block in the future.
llvm-svn: 264557
Duncan P. N. Exon Smith [Sun, 27 Mar 2016 23:56:04 +0000 (23:56 +0000)]
BitcodeWriter: Rename some functions for consistency, NFC
To match writeMetadataRecords, writeNamedMetadata and
writeMetadataStrings, change:
WriteModuleMetadata => writeModuleMetadata
WriteFunctionLocalMetadata => writeFunctionMetadata
Write##CLASS => write##CLASS
The only major change is "FunctionLocal" => "Function". The point is to
be less specific, in preparation for emitting normal metadata records
inside function metadata blocks (currently we only emit
`LocalAsMetadata` there).
llvm-svn: 264556
Duncan P. N. Exon Smith [Sun, 27 Mar 2016 23:53:30 +0000 (23:53 +0000)]
BitcodeWriter: Split out writeMetadataRecords, NFC
Besides being a nice cleanup, this is preparation for reusing the code
in function metadata blocks.
llvm-svn: 264555
Duncan P. N. Exon Smith [Sun, 27 Mar 2016 23:38:36 +0000 (23:38 +0000)]
BitcodeWriter: Restructure WriteFunctionLocalMetadata, NFC
Use an early return to simplify logic.
llvm-svn: 264554
Duncan P. N. Exon Smith [Sun, 27 Mar 2016 23:36:55 +0000 (23:36 +0000)]
Bitcode: Fix MSVC bot failure from r264549
make_unique => llvm::make_unique
llvm-svn: 264553
Duncan P. N. Exon Smith [Sun, 27 Mar 2016 23:22:31 +0000 (23:22 +0000)]
BitcodeWriter: Simplify tracking of function-local metadata, NFC
We don't really need a separate vector here; instead, point at a range
inside the main MDs array. This matches how r264551 references the
ranges of strings and non-strings.
llvm-svn: 264552
Duncan P. N. Exon Smith [Sun, 27 Mar 2016 23:17:54 +0000 (23:17 +0000)]
Reapply ~"Bitcode: Collect all MDString records into a single blob"
Spiritually reapply commit r264409 (reverted in r264410), albeit with a
bit of a redesign.
Firstly, avoid splitting the big blob into multiple chunks of strings.
r264409 imposed an arbitrary limit to avoid a massive allocation on the
shared 'Record' SmallVector. The bug with that commit only reproduced
when there were more than "chunk-size" strings. A test for this would
have been useless long-term, since we're liable to adjust the chunk-size
in the future.
Thus, eliminate the motivation for chunk-ing by storing the string sizes
in the blob. Here's the layout:
vbr6: # of strings
vbr6: offset-to-blob
blob:
[vbr6]: string lengths
[char]: concatenated strings
Secondly, make the output of llvm-bcanalyzer readable.
I noticed when debugging r264409 that llvm-bcanalyzer was outputting a
massive blob all in one line. Past a small number, the strings were
impossible to split in my head, and the lines were way too long. This
version adds support in llvm-bcanalyzer for pretty-printing.
<STRINGS abbrevid=4 op0=3 op1=9/> num-strings = 3 {
'abc'
'def'
'ghi'
}
From the original commit:
Inspired by Mehdi's similar patch, http://reviews.llvm.org/D18342, this
should (a) slightly reduce bitcode size, since there is less record
overhead, and (b) greatly improve reading speed, since blobs are super
cheap to deserialize.
llvm-svn: 264551
Duncan P. N. Exon Smith [Sun, 27 Mar 2016 23:04:04 +0000 (23:04 +0000)]
BitcodeWriter: Simplify and test writing blobs, NFC
Split helper out of EmitRecordWithAbbrevImpl called emitBlob to reduce
code duplication, and add a few tests for it.
No functionality change intended.
llvm-svn: 264550
Duncan P. N. Exon Smith [Sun, 27 Mar 2016 23:00:59 +0000 (23:00 +0000)]
Support: Implement StreamingMemoryObject::getPointer
The implementation is fairly obvious. This is preparation for using
some blobs in bitcode.
For clarity (and perhaps future-proofing?), I moved the call to
JumpToBit in BitstreamCursor::readRecord ahead of calling
MemoryObject::getPointer, since JumpToBit can theoretically (a) read
bytes, which (b) invalidates the blob pointer.
This isn't strictly necessary the two memory objects we have:
- The return of RawMemoryObject::getPointer is valid until the memory
object is destroyed.
- StreamingMemoryObject::getPointer is valid until the next chunk is
read from the stream. Since the JumpToBit call is only going ahead
to a word boundary, we'll never load another chunk.
However, reordering makes it clear by inspection that the blob returned
by BitstreamCursor::readRecord will be valid.
I added some tests for StreamingMemoryObject::getPointer and
BitstreamCursor::readRecord.
llvm-svn: 264549
Duncan P. N. Exon Smith [Sun, 27 Mar 2016 22:55:19 +0000 (22:55 +0000)]
Support: Move StreamingMemoryObject{,Test}.cpp, NFC
Change the filename to indicate this is a test, rename the tests, move
them into an anonymous namespace, and rename some variables. All to
match our usual style before making further changes.
llvm-svn: 264548
Duncan P. N. Exon Smith [Sun, 27 Mar 2016 22:49:32 +0000 (22:49 +0000)]
Bitcode: Add SimpleBitstreamCursor::setArtificialByteLimit
Allow users of SimpleBitstreamCursor to limit the number of bytes
available to the cursor. This is preparation for instantiating a cursor
that isn't allowed to load more bytes from a StreamingMemoryObject (just
move around the ones already-loaded).
llvm-svn: 264547
Duncan P. N. Exon Smith [Sun, 27 Mar 2016 22:45:25 +0000 (22:45 +0000)]
Bitcode: Add SimpleBitstreamCursor::getPointerToByte, etc.
Add API to SimpleBitstreamCursor to allow users to translate between
byte addresses and pointers.
- jumpToPointer: move the bit position to a particular pointer.
- getPointerToByte: get the pointer for a particular byte.
- getPointerToBit: get the pointer for the byte of the current bit.
- getCurrentByteNo: convenience function for assertions and tests.
Mainly adds unit tests (getPointerToBit/Byte already has a use), but
also preparation for eventually using jumpToPointer.
llvm-svn: 264546
Duncan P. N. Exon Smith [Sun, 27 Mar 2016 22:40:55 +0000 (22:40 +0000)]
Bitcode: Split out SimpleBitstreamCursor
Split out SimpleBitstreamCursor from BitstreamCursor, which is a
lower-level cursor with no knowledge of bitcode blocks, abbreviations,
or records. It just knows how to read bits and navigate the stream.
This is mainly organizational, to separate the API for manipulating raw
bits from that for bitcode concepts like Record and Block.
llvm-svn: 264545
JF Bastien [Sun, 27 Mar 2016 20:50:05 +0000 (20:50 +0000)]
Revert "isPodLike: more precise"
This reverts commit
c45f2afac5d6855a4804456a0f718563dc47ada0.
Looks like it may be causing a failure, I'll revert for now.
from
lib/CodeGen/AsmPrinter/DwarfDebug.cpp:14:
/usr/include/c++/4.9.2/bits/stl_pair.h: In instantiation of
'std::pair<_T1, _T2>& std::pair<_T1,
_T2>::operator=(const std::pair<_T1, _T2>&) [with _T1 =
std::unique_ptr<llvm::DwarfTypeUnit>; _T2 = const
llvm::DICompositeType*]':
/usr/include/c++/4.9.2/bits/stl_pair.h:160:8: error: use of deleted
function 'std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp,
_Dp>::operator=(const std::unique_ptr<_Tp, _Dp>&) [with _Tp =
llvm::DwarfTypeUnit; _Dp = std::default_delete<llvm::DwarfTypeUnit>]'
first = __p.first;
^
llvm-svn: 264544
Sanjay Patel [Sun, 27 Mar 2016 20:44:35 +0000 (20:44 +0000)]
workaround for an IR variable named %.
(which SimplifyCFG can produce...)
llvm-svn: 264543
Sanjay Patel [Sun, 27 Mar 2016 20:43:02 +0000 (20:43 +0000)]
add scrubber for excessive leading whitespace
llvm-svn: 264542
JF Bastien [Sun, 27 Mar 2016 20:32:21 +0000 (20:32 +0000)]
isPodLike: more precise
I tried to use isPodLike in:
http://reviews.llvm.org/D18483
That failed because !is_class is too strict on platforms which don't yet
have is_trivially_copyable. This update tries to make isPodLike smarter
for platforms which don't have is_trivially_copyable, and AFAICT it
Should Just Work on all of them. I'll revert if the bots disagree with
me.
I'll also rename isPodLike to isTriviallyCopyable if this all works out,
since that's what the standard calls it now and one day we'll be rid of
isPodLike.
llvm-svn: 264541
Richard Smith [Sun, 27 Mar 2016 20:13:24 +0000 (20:13 +0000)]
[modules] When encoding SourceLocations in bitcode, rotate the 'is macro' flag
bit from the top bit to the bottom bit, so that we don't need 6 VBR6 hunks for
each macro location. Reduces libstdc++ module size by about 1%.
llvm-svn: 264540
Richard Thomson [Sun, 27 Mar 2016 16:43:44 +0000 (16:43 +0000)]
clang-tidy: Add check modernize-raw-string-literal
llvm-svn: 264539
Teresa Johnson [Sun, 27 Mar 2016 15:36:43 +0000 (15:36 +0000)]
Use DAG check to try to appease bot
Try to appease
http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/34772. This was
the only check that didn't use DAG and it wasn't found.
llvm-svn: 264538
Teresa Johnson [Sun, 27 Mar 2016 15:27:30 +0000 (15:27 +0000)]
[ThinLTO] Add optional import message and statistics
Summary:
Add a statistic to count the number of imported functions. Also, add a
new -print-imports option to emit a trace of imported functions, that
works even for an NDEBUG build.
Note that emitOptimizationRemark does not work for the above printing as
it expects a Function object and DebugLoc, neither of which we have
with summary-based importing.
This is part 2 of D18487, the first part was committed separately as
r264536.
Reviewers: joker.eph
Subscribers: llvm-commits, joker.eph
Differential Revision: http://reviews.llvm.org/D18487
llvm-svn: 264537
Teresa Johnson [Sun, 27 Mar 2016 15:01:11 +0000 (15:01 +0000)]
[ThinLTO] Don't try to import alias unless aliasee can be imported
With r264503, aliases are now being added to the GlobalsToImport set
even when their aliasees can't be imported due to their linkage type.
While the importing worked correctly (the aliases imported as
declarations) due to the logic in doImportAsDefinition, there is no
point to adding them to the GlobalsToImport set.
Additionally, with D18487 it was resulting in incorrectly printing a
message indicating that the alias was imported.
To avoid this, delay adding aliases to the GlobalsToImport set until
after the linkage type of the aliasee is checked.
This patch is part of D18487.
llvm-svn: 264536
Hal Finkel [Sun, 27 Mar 2016 13:24:09 +0000 (13:24 +0000)]
Fixing the non-x86 build by removing dependence on kmp_cpuid_t
The problem is that the definition of kmp_cpuinfo_t contains:
char name [3*sizeof (kmp_cpuid_t)]; // CPUID(0x80000002,0x80000003,0x80000004)
and kmp_cpuid_t is only defined when compiling for x86.
Differential Revision: http://reviews.llvm.org/D18245
llvm-svn: 264535
Richard Smith [Sun, 27 Mar 2016 07:28:06 +0000 (07:28 +0000)]
Encapsulate a couple of on-disk structures a little more.
llvm-svn: 264534
Richard Smith [Sun, 27 Mar 2016 05:52:25 +0000 (05:52 +0000)]
Remove unused support for replacing declarations from chained AST files.
llvm-svn: 264533
Hal Finkel [Sun, 27 Mar 2016 05:40:56 +0000 (05:40 +0000)]
[PowerPC] Map max/minnum intrinsics and fmax/fmin to ISD nodes for CTR-based loop legality
Intrinsic::maxnum and Intrinsic::minnum, along with the associated libc
function calls (fmax[f], etc.) generally map to function calls after lowering.
For some vector types with QPX at least, however, we can legally lower these,
and we don't need to prohibit CTR-based loops on their account.
It turned out, however, that the logic that checked the opcodes associated with
intrinsics was broken (it would set the Opcode variable, but that variable was
later checked only if set for some otherwise-external function call.
This fixes the latter problem and adds the FMAX/MINNUM mappings.
llvm-svn: 264532
Richard Thomson [Sun, 27 Mar 2016 05:06:57 +0000 (05:06 +0000)]
Add clang-tools-extra release notes
llvm-svn: 264531
David Majnemer [Sun, 27 Mar 2016 04:46:14 +0000 (04:46 +0000)]
Use the correct alignment for uuid descriptors
The _GUID_ descriptors emitted by MSVC have alignment 8 for 64-bit
builds: we should do the same if the linker picks the "wrong" COMDAT.
llvm-svn: 264530
David Majnemer [Sun, 27 Mar 2016 04:46:07 +0000 (04:46 +0000)]
Improve the representation of CXXUuidofExpr
Keep a pointer to the UuidAttr that the CXXUuidofExpr corresponds to.
This makes translating from __uuidof to the underlying constant a lot
more straightforward.
llvm-svn: 264529
Michael Kruse [Sat, 26 Mar 2016 23:32:57 +0000 (23:32 +0000)]
[Verifier] Reject PHIs using defs from own block.
Reject the following IR as malformed (assuming that %entry, %next are
not in a loop):
next:
%y = phi i32 [ 0, %entry ]
%x = phi i32 [ %y, %entry ]
Such PHI nodes came up in PR26718. While there was no consensus on
whether or not this is valid IR, most opinions on that bug and in a
discussion on the llvm-dev mailing list tended towards a
"strict interpretation" (term by Joseph Tremoulet) of PHI node uses.
Also, the language reference explicitly states that "the use of each
incoming value is deemed to occur on the edge from the corresponding
predecessor block to the current block" and
`DominatorTree::dominates(Instruction*, Use&)` uses this definition as
well.
For the code mentioned in PR15384, clang does not compile to such PHIs
(anymore?). The test case still hangs when replacing `%tmp6` with `%tmp`
in revisions before r176366 (where PR15384 has been fixed). The
occurrence of %tmp6 therefore was probably unintentional. Its value is
not used except in other PHIs.
Reviewers: majnemer, reames, JosephTremoulet, bkramer, grosser, jdoerfert, kparzysz, sanjoy
Differential Revision: http://reviews.llvm.org/D18443
llvm-svn: 264528
Sanjay Patel [Sat, 26 Mar 2016 23:30:50 +0000 (23:30 +0000)]
[SimplifyCFG] propagate branch metadata when creating select (PR26636)
llvm-svn: 264527
Sanjay Patel [Sat, 26 Mar 2016 23:09:25 +0000 (23:09 +0000)]
minimize test cases
These are tests for store transforms.
The loads, adds, and geps were irrelevant.
llvm-svn: 264526
Faisal Vali [Sat, 26 Mar 2016 20:46:45 +0000 (20:46 +0000)]
[NFC] Tweak diagnostic for template template arguments, to include template aliases.
The prior diagnostic (err_template_arg_not_class_template) would state that the template argument to a template template parameter can only be a class template, when it can also be a template alias. The newly renamed diagnostic (err_template_arg_not_valid_template) mentions template aliases.
llvm-svn: 264522
Xinliang David Li [Sat, 26 Mar 2016 20:44:03 +0000 (20:44 +0000)]
Make vp merge test more robust
llvm-svn: 264521
David Blaikie [Sat, 26 Mar 2016 20:32:14 +0000 (20:32 +0000)]
llvm-dwp: Include the dwo name (if available) when diagnosing duplicate CU IDs from dwp input files
If you're building dwps from other dwps, it can be hard to track down a
duplicate CU ID if it comes from two compilations of the same file in
different modes, etc. By including the .dwo path (which is hopefully
more unique than the file path) it can help track down where the
duplicates came from.
llvm-svn: 264520
Bob Wilson [Sat, 26 Mar 2016 18:55:13 +0000 (18:55 +0000)]
Check if a path is already absolute before trying to make it so.
The FileSystem::makeAbsolute function has been calculating the current
working directory unconditionally, even when it is not needed. This calls
down to llvm::sys::fs::current_path, which is relatively expensive
because it stats two directories, regardless of whether those paths are
already in the stat cache. The net effect is that when using the
VFS, every stat during header search turns into three stats. With this
change, we get back to a single stat for absolute directory paths.
llvm-svn: 264519
Davide Italiano [Sat, 26 Mar 2016 18:33:09 +0000 (18:33 +0000)]
[ELF/LTO] Refactor to reduce indentation.
Suggested by: Rui Ueyama.
llvm-svn: 264518
Simon Pilgrim [Sat, 26 Mar 2016 18:32:13 +0000 (18:32 +0000)]
[X86][AVX] Enabled SMUL_LOHI/UMUL_LOHI v8i32 vectors on AVX1 targets
Correct splitting of v8i32 vectors into v4i32 vectors to prevent scalarization
llvm-svn: 264517
JF Bastien [Sat, 26 Mar 2016 18:20:02 +0000 (18:20 +0000)]
Revert "NFC: static_assert instead of comment"
This reverts commit
fa36fcff16c7d4f78204d6296bf96c3558a4a672.
Causes the following Windows failure:
C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\lib\CodeGen\MachineInstr.cpp(762):
error C2338: must be trivially copyable to memmove
llvm-svn: 264516
JF Bastien [Sat, 26 Mar 2016 18:14:27 +0000 (18:14 +0000)]
NFC: static_assert instead of comment
Summary: isPodLike is as close as we have for is_trivially_copyable.
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D18483
llvm-svn: 264515
Johannes Doerfert [Sat, 26 Mar 2016 16:17:00 +0000 (16:17 +0000)]
Generalize the domain complexity restrictions
This patch applies the restrictions on the number of domain conjuncts
also to the domain parts of piecewise affine expressions we generate.
To this end the wording is change slightly. It was needed to support
complex additions featuring zext-instructions but it also fixes PR27045.
lnt profitable runs reports only little changes that might be noise:
Compile Time:
Polybench/[...]/2mm +4.34%
SingleSource/[...]/stepanov_container -2.43%
Execution Time:
External/[...]/186_crafty -2.32%
External/[...]/188_ammp -1.89%
External/[...]/473_astar -1.87%
llvm-svn: 264514
Faisal Vali [Sat, 26 Mar 2016 16:11:37 +0000 (16:11 +0000)]
[Cxx1z-constexpr-lambda-P0170R1] Support parsing of constexpr specifier (and its inference) on lambda expressions
Support the constexpr specifier on lambda expressions - and support its inference from the lambda call operator's body.
i.e.
auto L = [] () constexpr { return 5; };
static_assert(L() == 5); // OK
auto Implicit = [] (auto a) { return a; };
static_assert(Implicit(5) == 5);
We do not support evaluation of lambda's within constant expressions just yet.
Implementation Strategy:
- teach ParseLambdaExpressionAfterIntroducer to expect a constexpr specifier and mark the invented function call operator's declarator's decl-specifier with it; Have it emit fixits for multiple decl-specifiers (mutable or constexpr) in this location.
- for cases where constexpr is not explicitly specified, have buildLambdaExpr check whether the invented function call operator satisfies the requirements of a constexpr function, by calling CheckConstexprFunctionDecl/Body.
Much obliged to Richard Smith for his patience and his care, in ensuring the code is clang-worthy.
llvm-svn: 264513
Simon Pilgrim [Sat, 26 Mar 2016 15:44:55 +0000 (15:44 +0000)]
[X86][AVX] Enabled MULHS/MULHU v16i16 vectors on AVX1 targets
Correct splitting of v16i16 vectors into v8i16 vectors to prevent scalarization
Differential Revision: http://reviews.llvm.org/D18307
llvm-svn: 264512
Simon Pilgrim [Sat, 26 Mar 2016 15:27:20 +0000 (15:27 +0000)]
[X86][SSE] Add MULHS/MULHU custom lowering for i8 vectors
Currently this is to mainly to prevent scalarization of integer division by constants.
Differential Revision: http://reviews.llvm.org/D18307
llvm-svn: 264511
Simon Pilgrim [Sat, 26 Mar 2016 09:50:06 +0000 (09:50 +0000)]
[X86][SSE] Added v64i8 vector integer multiply tests
llvm-svn: 264510
Simon Pilgrim [Sat, 26 Mar 2016 09:44:27 +0000 (09:44 +0000)]
[X86][AVX512BW] AVX512BW can sign-extend v32i8 to v32i16 for simpler v32i8 multiplies.
Only pre-AVX512BW targets need to split v32i8 vectors.
llvm-svn: 264509
David Majnemer [Sat, 26 Mar 2016 09:42:31 +0000 (09:42 +0000)]
[PowerPC] Disable the CTR optimization in the presence of {min,max}num
The minnum and maxnum intrinsics get lowered to libcalls which
invalidates the CTR optimization.
This fixes PR27083.
llvm-svn: 264508
Simon Pilgrim [Sat, 26 Mar 2016 09:35:48 +0000 (09:35 +0000)]
[X86][SSE] Refreshed vector integer multiply tests
Add all 256-bit vector tests.
Added AVX512F/AVX512BW test targets.
Renamed tests something more meaningful.
llvm-svn: 264507
Simon Pilgrim [Sat, 26 Mar 2016 09:29:04 +0000 (09:29 +0000)]
[X86][SSE] Don't duplicate Lower256IntArith functionality in LowerMul. NFC.
LowerMul v32i8 on AVX2 needs to split the 256-bit sources to allow sign-extension back to v16i16 to occur. Since this is basically the same as Lower256IntArith we simplify by using that here instead.
llvm-svn: 264506
Junmo Park [Sat, 26 Mar 2016 06:04:55 +0000 (06:04 +0000)]
Minor code cleanup. NFC.
llvm-svn: 264505
Chuang-Yu Cheng [Sat, 26 Mar 2016 05:46:11 +0000 (05:46 +0000)]
[Power9] Implement new altivec instructions: permute, count zero, extend sign, negate, parity, shift/rotate, mul10
This change implements the following vector operations:
- vclzlsbb vctzlsbb vctzb vctzd vctzh vctzw
- vextsb2w vextsh2w vextsb2d vextsh2d vextsw2d
- vnegd vnegw
- vprtybd vprtybq vprtybw
- vbpermd vpermr
- vrlwnm vrlwmi vrldnm vrldmi vslv vsrv
- vmul10cuq vmul10uq vmul10ecuq vmul10euq
28 instructions
Thanks Nemanja, Kit for invaluable hints and discussion!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan
Phabricator: http://reviews.llvm.org/D15887
llvm-svn: 264504
Mehdi Amini [Sat, 26 Mar 2016 05:40:34 +0000 (05:40 +0000)]
ThinLTO: use the callgraph from the combined index to drive the FunctionImporter
Summary:
Now that the summary contains the full reference/call graph, we can
replace the existing function importer that loads and inspect the IR
to iteratively walk the call graph by a traversal based purely on the
summary information. Decouple the actual importing decision from any
IR manipulation.
Reviewers: tejohnson
Subscribers: llvm-commits, joker.eph
Differential Revision: http://reviews.llvm.org/D18343
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 264503
Matthias Braun [Sat, 26 Mar 2016 04:07:55 +0000 (04:07 +0000)]
abtest: Cleanup, improve comments
llvm-svn: 264502
Sean Silva [Sat, 26 Mar 2016 04:01:57 +0000 (04:01 +0000)]
[libprofile] Adjust dummy condition to be more forgiving.
On PS4, we have to fake environment variables by passing extra command
line arguments, so the dummy test `argc > 1` was failing.
The condition is just a dummy condition that the compiler can't fold
away, so the number is arbitrary as long as the condition is false.
Increase the number it compares against.
llvm-svn: 264491
Sean Silva [Sat, 26 Mar 2016 03:37:45 +0000 (03:37 +0000)]
[libprofile] Add some missing `env` prefixes on commands.
llvm-svn: 264490
Mehdi Amini [Sat, 26 Mar 2016 03:35:38 +0000 (03:35 +0000)]
Rename ModuleSummaryIndex::modPathStringEntries() into modulePaths()
It now return the map instead of an iterator.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 264489
Richard Smith [Sat, 26 Mar 2016 03:06:42 +0000 (03:06 +0000)]
Stop depending on the keys in a hash table being in a particular order.
llvm-svn: 264488
Richard Smith [Sat, 26 Mar 2016 02:02:59 +0000 (02:02 +0000)]
Stop testing the unspecified order in which the OnDiskHashTable stores entries.
llvm-svn: 264487
Richard Smith [Sat, 26 Mar 2016 01:49:50 +0000 (01:49 +0000)]
Don't force OnDiskHashTables to have a minimum of 64 buckets. That's
preposterously large for some lookup tables -- in C++ classes generated by
template instantiation, it's very common for the number of lookup results to be
either 1 or 2.
This reduces size of a libstdc++ module by 7-15%.
llvm-svn: 264486
Sean Callanan [Sat, 26 Mar 2016 00:37:55 +0000 (00:37 +0000)]
When we import the definition for a Tagdecl, propagate its completeness too.
The ASTImporter completes the full definiton for a TagDecl in several places,
including the type-deport logic. When this happens, we should also propagate
the bit that says that this is a complete definition. This makes (for example)
lambdas callable.
<rdar://problem/
22864976>
llvm-svn: 264485
Matthias Braun [Sat, 26 Mar 2016 00:36:58 +0000 (00:36 +0000)]
abtest: Check all files, improve announcements
Simply searching for gooddir/* and baddir/* instead of *.s the script
should also work with .o files.
llvm-svn: 264484
Sean Callanan [Sat, 26 Mar 2016 00:30:40 +0000 (00:30 +0000)]
Record all translation units with more than one function in them (e.g., blocks).
Blocks and lambdas have their implementation functions stored in the IR for an
expression. If we put the block/lambda into a result variable it needs to stay
around. As a heuristic, remember any execution unit that has more than one
function in it.
<rdar://problem/
22864976>
llvm-svn: 264483
Matthias Braun [Sat, 26 Mar 2016 00:23:59 +0000 (00:23 +0000)]
Put my abtest scripts into the util directory
See http://lists.llvm.org/pipermail/llvm-dev/2016-March/097640.html
There is also a description/tutorial in the comments of the abtest.py
file.
llvm-svn: 264482
Kostya Serebryany [Sat, 26 Mar 2016 00:00:19 +0000 (00:00 +0000)]
[asan] bump the scariness score of read-after-frees (based on feedback from the Chrome security team)
llvm-svn: 264481
Vedant Kumar [Fri, 25 Mar 2016 23:56:23 +0000 (23:56 +0000)]
[profile] Add integration test to validate PGO function names
Differential Revision: http://reviews.llvm.org/D18485
llvm-svn: 264480
Lang Hames [Fri, 25 Mar 2016 23:54:32 +0000 (23:54 +0000)]
[Support] Switch to RAII helper for error-as-out-parameter idiom.
As discussed on the llvm-commits thread for r264467.
llvm-svn: 264479
Sean Callanan [Fri, 25 Mar 2016 23:51:25 +0000 (23:51 +0000)]
Removed LoggingDiagnosticConsumer, an unused class.
llvm-svn: 264478
Sunil Srivastava [Fri, 25 Mar 2016 23:41:28 +0000 (23:41 +0000)]
Improve the reliability of file renaming in Windows by having the compiler retry
the rename operation on 3 error conditions of ReplaceFileW() that it was
previously bailing out on.
Patch by Douglas Yung!
Differential Revision: http://reviews.llvm.org/D17903
llvm-svn: 264477