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

113402 Commits

Author SHA1 Message Date
Michael Kuperstein
70d8ac0a8e Fix quoting of #pragma comment for MS compat, LLVM part.
For #pragma comment(linker, ...) MSVC expects the comment string to be quoted, but for #pragma comment(lib, ...) the compiler itself quotes the library name.
Since this distinction disappears by the time the directive reaches the backend, move quoting for the "lib" version to the frontend.

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

llvm-svn: 229375
2015-02-16 11:57:17 +00:00
Chandler Carruth
358c1db65e [x86] Add initial basic support for forming blends of v16i8 vectors.
This blend instruction is ... really lame. The register usage is insane.
As a consequence this is probably only *barely* better than 2 pshufbs
followed by a por, and that mostly because it only has to read from
a single memory location.

However, this doesn't fix as much as I kind of expected, so more to go.
Pretty sure that the ordering and delegation of v16i8 is just really,
really bad.

llvm-svn: 229373
2015-02-16 10:58:23 +00:00
Chandler Carruth
db7a8ca276 [x86] Add some more test cases for i8 vector blends.
llvm-svn: 229372
2015-02-16 10:51:49 +00:00
Benjamin Kramer
a78f8364ea Document that defaulted & deleted methods and explicit conversions are allowed now.
llvm-svn: 229369
2015-02-16 10:28:41 +00:00
Chandler Carruth
28b7a71785 [x86] Switch my usage of VariadicFunction to a "normal" variadic
template now that we can use them.

This is, of course, horribly ugly because of the required recursive
formulation. Suggestions for making it less ugly welcome.

llvm-svn: 229367
2015-02-16 09:59:48 +00:00
David Majnemer
64cd3dbda5 IR: SrcTy == DstTy doesn't imply that a cast is valid
Cast validity depends on the cast's kind, not just its types.

llvm-svn: 229366
2015-02-16 09:37:35 +00:00
David Majnemer
4f5d97ee4f AsmParser: extractvalue requires at least one index operand
llvm-svn: 229365
2015-02-16 09:18:13 +00:00
David Majnemer
7f40c08dca AsmParser: Make sure GlobalVariables have sane types
llvm-svn: 229364
2015-02-16 08:41:08 +00:00
David Majnemer
b5464fbff9 AsmParser: Reject alloca with function type
llvm-svn: 229363
2015-02-16 08:38:03 +00:00
Chandler Carruth
160432e384 Switch our index sequence away from template aliases and just use
classes. We can't use template aliases because on MSVC they don't appear
to work correctly in the common usage such as Format.h.

Many thanks to Zach for doing all the testing and debugging here. I just
slotted the fix into the code.

llvm-svn: 229362
2015-02-16 08:22:35 +00:00
David Majnemer
9580d6a824 Verifier: Diagnose module flags which have null ID operands
llvm-svn: 229361
2015-02-16 08:14:22 +00:00
Craig Topper
b3a29e8067 [X86] Add support for lowering shuffles to 256-bit PALIGNR instruction.
llvm-svn: 229359
2015-02-16 06:29:06 +00:00
Craig Topper
988e9c859c [X86] Remove some hard tab characters from tests.
llvm-svn: 229358
2015-02-16 06:29:02 +00:00
David Majnemer
3ae73b8e74 DebugInfo: Don't crash if 'Debug Info Version' has a strange value
llvm-svn: 229356
2015-02-16 06:04:53 +00:00
David Majnemer
271992a42e DataLayout: Validate that the pref alignment is at least the ABI align
llvm-svn: 229355
2015-02-16 05:41:55 +00:00
David Majnemer
18f3685387 DataLayout: Report when the datalayout type alignment/width is too large
llvm-svn: 229354
2015-02-16 05:41:53 +00:00
David Majnemer
2b452a1df4 IR: Properly return nullptr when getAggregateElement is out-of-bounds
We didn't properly handle the out-of-bounds case for
ConstantAggregateZero and UndefValue.  This would manifest as a crash
when the constant folder was asked to fold a load of a constant global
whose struct type has no operands.

This fixes PR22595.

llvm-svn: 229352
2015-02-16 04:02:09 +00:00
NAKAMURA Takumi
0dd5b347b1 [CMake] Add RuntimeDyld to libdeps corresponding to r229343.
llvm-svn: 229351
2015-02-16 02:13:30 +00:00
Chandler Carruth
a34a4a834e [x86] Teach the 128-bit vector shuffle lowering routines to take
advantage of the existence of a reasonable blend instruction.

The 256-bit vector shuffle lowering has leveraged the general technique
of decomposed shuffles and blends for quite some time, but this never
made it back into the 128-bit code, and there are a large number of
patterns where this is substantially better. For example, this removes
almost all domain crossing in vector shuffles that involve some blend
and some permutation with SSE4.1 and later. See the massive reduction
in 'shufps' for integer test cases in this commit.

This isn't perfect yet for a few reasons:

1) The v8i16 shuffle lowering continues to plague me. We don't always
   form an unpack-based blend when that would be better. But the wins
   pretty drastically outstrip the losses here.
2) The v16i8 shuffle lowering is just a disaster here. I never went and
   implemented blend support here for some terrible reason. I'll do
   that next probably. I've not updated it for now.

More variations on this technique are coming as well -- we don't
shuffle-into-unpack or shuffle-into-palignr, both of which would also be
profitable.

Note that some test cases grow significantly in the number of
instructions, but I expect to actually be faster. We use
pshufd+pshufd+blendw instead of a single shufps, but the pshufd's are
very likely to pipeline well (two ports on most modern intel chips) and
the blend is a *very* fast instruction. The domain switch penalty will
essentially always be more than a blend instruction, which is the only
increase in tree height.

llvm-svn: 229350
2015-02-16 01:52:02 +00:00
Chandler Carruth
572fa3dbba [x86] Clean up a few test cases with the update script. NFC
llvm-svn: 229349
2015-02-16 01:39:50 +00:00
Craig Topper
916052961d [X86] Remove gcc builtins for AVX2 psll_dq and psrl_dq intrinsics. Clang no longer needs them.
llvm-svn: 229347
2015-02-16 00:42:36 +00:00
Filipe Cabecinhas
e4564d63bb [Bitcode reader] Fix a few assertions when reading invalid files
Summary:
When creating {insert,extract}value instructions from a BitcodeReader, we
weren't verifying the fields were valid.

Bugs found with afl-fuzz

Reviewers: rafael

Subscribers: llvm-commits

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

llvm-svn: 229345
2015-02-16 00:03:11 +00:00
Lang Hames
dbb9827d2f [ExecutionEngine] Fix dependence issue by moving RTDyldMemoryManager into
RuntimeDyld.

This should fix http://llvm.org/PR22593.

llvm-svn: 229343
2015-02-15 23:22:43 +00:00
Benjamin Kramer
d21608f72f MinGW's snprintf is not exposed through std::.
llvm-svn: 229342
2015-02-15 23:17:20 +00:00
Aaron Ballman
0b45511a2e Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition.
llvm-svn: 229340
2015-02-15 22:54:22 +00:00
Benjamin Kramer
99efbfba33 Format: Modernize using variadic templates.
Introduces a subset of C++14 integer sequences in STLExtras. This is
just enough to support unpacking a std::tuple into the arguments of
snprintf, we can add more of it when it's actually needed.

Also removes an ancient macro hack that leaks a macro into the global
namespace. Clean up users that made use of the convenient hack.

llvm-svn: 229337
2015-02-15 22:15:41 +00:00
Aaron Ballman
0e19b5d670 Removing LLVM_EXPLICIT, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition.
llvm-svn: 229335
2015-02-15 22:00:20 +00:00
Aaron Ballman
f48307f858 Since MSVC 1800 is our lowest common denominator, we don't need an explicit check for it in these macros any longer; NFC.
llvm-svn: 229333
2015-02-15 21:21:52 +00:00
Benjamin Kramer
1256b8262c CommandLine: Use variadic templates to simplify opt constructors.
llvm-svn: 229332
2015-02-15 21:11:25 +00:00
Zachary Turner
1008f9bfa4 llvm-pdbdump: Fix warning caused by missing sentinel value.
llvm-svn: 229331
2015-02-15 20:37:44 +00:00
Zachary Turner
e9cd3c4989 llvm-pdbdump: Add flags controlling the type of values to dump.
llvm-svn: 229330
2015-02-15 20:27:53 +00:00
Benjamin Kramer
7ce6e93852 FoldingSet: Replace faux variadics with real variadics. NFC.
llvm-svn: 229328
2015-02-15 20:12:17 +00:00
Benjamin Kramer
c1b3bb4e32 Remove LLVM_HAS_VARIADIC_TEMPLATES and all the faux variadic workarounds guarded by it.
We no longer support compilers without variadic template support.

llvm-svn: 229324
2015-02-15 19:34:28 +00:00
Benjamin Kramer
4579422ac9 Update the docs to require at least MSVC 2013.
llvm-svn: 229323
2015-02-15 19:34:17 +00:00
Philip Reames
673440a8bc Revert 229175
This change is a logical suspect in 22587 and 22590.  Given it's of minimal importanance and I can't get clang to build on my home machine, I'm reverting so that I can deal with this next week.

llvm-svn: 229322
2015-02-15 19:07:31 +00:00
Simon Pilgrim
9849f0e2cd Added (still inefficient) shuffle test case for PR21138
llvm-svn: 229321
2015-02-15 18:21:39 +00:00
NAKAMURA Takumi
3e2afcf188 Reapply r229185(cbieneman) -- Raising minimum required Visual Studio version to 2013.
This is based on the discussions on: [LLVMdev] [RFC] Raising LLVM minimum required MSVC version to 2013 for trunk

llvm-svn: 229320
2015-02-15 17:53:10 +00:00
Hal Finkel
afd400b12e [ADCE] Convert another loop for a range-based for
We can use a range-based for for the operands loop too; NFC.

llvm-svn: 229319
2015-02-15 15:51:25 +00:00
Hal Finkel
bc23b1a680 [ADCE] Use inst_range and range-based fors
Convert a few loops to range-based fors; NFC.

llvm-svn: 229318
2015-02-15 15:51:23 +00:00
Hal Finkel
20dadad9f5 [ADCE] Fix formatting of pointer types
We prefer to put the * with the variable, not with the type; NFC.

llvm-svn: 229317
2015-02-15 15:47:52 +00:00
Hal Finkel
f67e71db4d [ADCE] Fix capitalization of another local variable
Bring another local variable in compliance with our naming conventions, NFC.

llvm-svn: 229316
2015-02-15 15:45:30 +00:00
Hal Finkel
6660cfbeba [ADCE] Fix capitalization of some local variables
Bring some local variables in compliance with our naming conventions, NFC.

llvm-svn: 229315
2015-02-15 15:45:28 +00:00
Simon Pilgrim
dc017ce5f6 Added some test cases of missed opportunities to use unpckl/unpckh shuffles
llvm-svn: 229313
2015-02-15 15:07:45 +00:00
Simon Pilgrim
9264c389f1 Coding style fixes to recent patches. NFC.
llvm-svn: 229312
2015-02-15 14:19:29 +00:00
Simon Pilgrim
ddbf019542 [X86][AVX2] vpslldq/vpsrldq byte shifts for AVX2
This patch refactors the existing lowerVectorShuffleAsByteShift function to add support for 256-bit vectors on AVX2 targets.

It also fixes a tablegen issue that prevented the lowering of vpslldq/vpsrldq vec256 instructions.

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

llvm-svn: 229311
2015-02-15 13:19:52 +00:00
Chandler Carruth
eb48186ef8 [x86] Add the test case from PR22412, we now get this right even with
the new vector shuffle legality.

llvm-svn: 229310
2015-02-15 12:45:05 +00:00
Chandler Carruth
2fac6b1c98 [x86] Teach the decomposed shuffle/blend lowering to use an early blend
when that will allow it to lower with a single permute instead of
multiple permutes.

It tries to detect when it will only have to do a single permute in
either case to maximize folding of loads and such.

This cuts a *lot* of the avx2 shuffle permute counts in half. =]

llvm-svn: 229309
2015-02-15 12:42:15 +00:00
Chandler Carruth
0b684c6980 [SDAG] Teach the SelectionDAG to canonicalize vector shuffles of splats
directly into blends of the splats.

These patterns show up even very late in the vector shuffle lowering
where we don't have any chance for DAG combining to kick in, and
blending is a tremendously simpler operation to model. By coercing the
shuffle into a blend we can much more easily match and lower shuffles of
splats.

Immediately with this change there are significantly more blends being
matched in the x86 vector shuffle lowering.

llvm-svn: 229308
2015-02-15 12:18:12 +00:00
Chandler Carruth
fa7b9ba328 [x86] Teach the shuffle mask equivalence test to look through build
vectors and detect equivalent inputs.

This lets the code match unpck-style instructions when only one of the
inputs are lined up but the other input is a splat and so which lanes we
pull from doesn't matter. Today, this doesn't really happen, but just by
accident. I have a patch that normalizes how we shuffle splats, and with
that patch this will be necessary for a lot of the mask equivalence
tests to work.

I don't really know how to write a test case for this specific change
until the other change lands though.

llvm-svn: 229307
2015-02-15 12:07:55 +00:00
Chandler Carruth
941ec691e8 [x86] Tweak the ordering of unpack matching vs. element insertion, and
don't try to do element insertion for non-zero-index floating point
vectors.

We don't have any useful patterns or lowering for element insertion into
high elements of a floating point vector, and the generic shuffle
lowering will end up being better -- namely it will fall back to unpck.
But we should try to handle other forms of element insertion before
matching unpck patterns.

While this doesn't matter much right now, I'm working on a patch that
makes unpck matching much more powerful, and that patch will break
without this re-ordering.

llvm-svn: 229306
2015-02-15 12:01:14 +00:00