Commit Graph

113609 Commits

Author SHA1 Message Date
James Molloy
25a35b5639 Run LICM as part of the cleanup phase from the scalar optimizer.
Things like LoopUnrolling can produce loop invariant values - make sure
we pick them up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229419 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 18:59:54 +00:00
Aaron Ballman
987d1055d3 We require MSVC 1800 as our minimum, so these checks can safely go away; NFC. (It seems this code has been copy/pasted around, unfortunately.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229417 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 18:34:57 +00:00
Aaron Ballman
502401111b We require MSVC 1800 as our minimum, so these checks can safely go away; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229415 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 18:23:00 +00:00
Aaron Ballman
7fcd74585a MSVC 2013 supports std::forward_as_tuple, while MSVC 2012 did not; so we can move to using the improved API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229414 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 18:21:19 +00:00
Andrew Trick
4f7d60c1ea AArch64: Safely handle the incoming sret call argument.
This adds a safe interface to the machine independent InputArg struct
for accessing the index of the original (IR-level) argument. When a
non-native return type is lowered, we generate the hidden
machine-level sret argument on-the-fly. Before this fix, we were
representing this argument as OrigArgIndex == 0, which is an outright
lie. In particular this crashed in the AArch64 backend where we
actually try to access the type of the original argument.

Now we use a sentinel value for machine arguments that have no
original argument index. AArch64, ARM, Mips, and PPC now check for this
case before accessing the original argument.

Fixes <rdar://19792160> Null pointer assertion in AArch64TargetLowering

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229413 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 18:10:47 +00:00
Hal Finkel
793a52967b [ADCE] Don't indent inside an anonymous namespace
To be consistent with what clang-format does, don't add extra indentation
inside an anonymous namespace. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229412 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 18:08:00 +00:00
James Molloy
2a7fbb1927 [LoopReroll] Relax some assumptions a little.
We won't find a root with index zero in any loop that we are able to reroll.
However, we may find one in a non-rerollable loop, so bail gracefully instead
of failing hard.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229406 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 17:02:00 +00:00
James Molloy
4b739069e4 [LoopReroll] Don't crash on dead code
If a PHI has no users, don't crash; bail gracefully. This shouldn't
happen often, but we can make no guarantees that previous passes didn't leave
dead code around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229405 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 17:01:52 +00:00
Jonas Paulsson
c21da273fe [PBQP] Improve the assert for conservatively allocatables.
Remember if the node ever was in this state instead of checking just the
final state.

Reviewed by Arnaud de Grandmaison.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229400 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 15:39:26 +00:00
Evgeniy Stepanov
989552ca7f [asan] Reuse a common function.
Do not reimplement RoundUpToAlignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229397 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 14:49:37 +00:00
Chandler Carruth
cbe6ecfc81 [x86] Add a generic unpack-targeted lowering technique. This can be used
to generically lower blends and is particularly nice because it is
available frome SSE2 onward. This removes a lot of the remaining domain
crossing blends in SSE2 code.

I'm hoping to replace some of the "interleaved" lowering hacks with
something closer to this which should be more principled. First, this
needs to learn how to detect and use other interleavings besides that of
the natural type provided. That will be a follow-up patch though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229378 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 12:28:18 +00:00
Chandler Carruth
e62fbca6b7 [x86] Switch this test to use checks generated by my update script. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229377 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 12:23:22 +00:00
Michael Kuperstein
012d5929f1 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229375 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 11:57:17 +00:00
Chandler Carruth
29679ccc12 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229373 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 10:58:23 +00:00
Chandler Carruth
ab497238cb [x86] Add some more test cases for i8 vector blends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229372 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 10:51:49 +00:00
Benjamin Kramer
1114203a73 Document that defaulted & deleted methods and explicit conversions are allowed now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229369 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 10:28:41 +00:00
Chandler Carruth
8b1a5559e9 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229367 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 09:59:48 +00:00
David Majnemer
b7a7566165 IR: SrcTy == DstTy doesn't imply that a cast is valid
Cast validity depends on the cast's kind, not just its types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229366 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 09:37:35 +00:00
David Majnemer
415561b6e0 AsmParser: extractvalue requires at least one index operand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229365 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 09:18:13 +00:00
David Majnemer
40d10639cf AsmParser: Make sure GlobalVariables have sane types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229364 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 08:41:08 +00:00
David Majnemer
b3dd3c7ac3 AsmParser: Reject alloca with function type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229363 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 08:38:03 +00:00
Chandler Carruth
d99cd97f85 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229362 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 08:22:35 +00:00
David Majnemer
815c05d38c Verifier: Diagnose module flags which have null ID operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229361 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 08:14:22 +00:00
Craig Topper
74b9ad3485 [X86] Add support for lowering shuffles to 256-bit PALIGNR instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229359 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 06:29:06 +00:00
Craig Topper
abdf58f7f9 [X86] Remove some hard tab characters from tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229358 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 06:29:02 +00:00
David Majnemer
3f58e9b36a DebugInfo: Don't crash if 'Debug Info Version' has a strange value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229356 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 06:04:53 +00:00
David Majnemer
2b022d53a3 DataLayout: Validate that the pref alignment is at least the ABI align
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229355 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 05:41:55 +00:00
David Majnemer
c859e73a24 DataLayout: Report when the datalayout type alignment/width is too large
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229354 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 05:41:53 +00:00
David Majnemer
6de0a12927 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229352 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 04:02:09 +00:00
NAKAMURA Takumi
36fcfaf54e [CMake] Add RuntimeDyld to libdeps corresponding to r229343.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229351 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 02:13:30 +00:00
Chandler Carruth
454c3997b4 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229350 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 01:52:02 +00:00
Chandler Carruth
aa35e012a3 [x86] Clean up a few test cases with the update script. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229349 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 01:39:50 +00:00
Craig Topper
60db969913 [X86] Remove gcc builtins for AVX2 psll_dq and psrl_dq intrinsics. Clang no longer needs them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229347 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 00:42:36 +00:00
Filipe Cabecinhas
9183d13f45 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229345 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-16 00:03:11 +00:00
Lang Hames
52b43c0fb3 [ExecutionEngine] Fix dependence issue by moving RTDyldMemoryManager into
RuntimeDyld.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229343 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 23:22:43 +00:00
Benjamin Kramer
686746d71d MinGW's snprintf is not exposed through std::.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229342 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 23:17:20 +00:00
Aaron Ballman
66981fe208 Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229340 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 22:54:22 +00:00
Benjamin Kramer
aee01b35e4 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229337 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 22:15:41 +00:00
Aaron Ballman
d898d31ebc Removing LLVM_EXPLICIT, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229335 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 22:00:20 +00:00
Aaron Ballman
734d358274 Since MSVC 1800 is our lowest common denominator, we don't need an explicit check for it in these macros any longer; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229333 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 21:21:52 +00:00
Benjamin Kramer
a220bd5439 CommandLine: Use variadic templates to simplify opt constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229332 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 21:11:25 +00:00
Zachary Turner
70e171f7cd llvm-pdbdump: Fix warning caused by missing sentinel value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229331 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 20:37:44 +00:00
Zachary Turner
7f6d93f718 llvm-pdbdump: Add flags controlling the type of values to dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229330 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 20:27:53 +00:00
Benjamin Kramer
5a4e2d2d64 FoldingSet: Replace faux variadics with real variadics. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229328 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 20:12:17 +00:00
Benjamin Kramer
5d6f0738e3 Remove LLVM_HAS_VARIADIC_TEMPLATES and all the faux variadic workarounds guarded by it.
We no longer support compilers without variadic template support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229324 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 19:34:28 +00:00
Benjamin Kramer
cd2a5f28b1 Update the docs to require at least MSVC 2013.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229323 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 19:34:17 +00:00
Philip Reames
220a8ba114 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229322 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 19:07:31 +00:00
Simon Pilgrim
f4e056ac2a Added (still inefficient) shuffle test case for PR21138
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229321 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 18:21:39 +00:00
NAKAMURA Takumi
068db0bdb8 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229320 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 17:53:10 +00:00
Hal Finkel
962ebd4f23 [ADCE] Convert another loop for a range-based for
We can use a range-based for for the operands loop too; NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229319 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-15 15:51:25 +00:00