Commit Graph

268357 Commits

Author SHA1 Message Date
Tim Northover a7f583e33b GlobalISel: map 128-bit values to an FPR by default.
Eventually we may want to allow a pair of GPRs but absolutely nothing in the
entire world is ready for that yet.

llvm-svn: 309404
2017-07-28 17:11:01 +00:00
Michael Kruse c99209b4b2 [test] Fix typo in filename. NFC.
llvm-svn: 309403
2017-07-28 16:57:56 +00:00
Michael Kruse 6c8f91b908 [Simplify] Fix typo in statistics output. NFC.
llvm-svn: 309402
2017-07-28 16:57:51 +00:00
Michael Kruse 34a77780c5 [Simplify] Remove empty partial accesses first. NFC.
So follow-up cleanup do not need special handling for such accesses.

llvm-svn: 309401
2017-07-28 16:57:45 +00:00
Reid Kleckner 125c74bc56 [lit] Dump some FileCheck inputs to try to debug some failing tests
llvm-svn: 309400
2017-07-28 16:24:18 +00:00
Reid Kleckner 432914bba0 [lit] Fix shtest-format external_shell failures
When using win32 cmd.exe, turn off command echoing at the beginning of
the script (@echo off).

Replace a bash shell script with a python script for the
fail_with_bad_encoding test.

llvm-svn: 309399
2017-07-28 16:13:02 +00:00
Matt Arsenault 9166ce86e8 AMDGPU: Annotate implicitarg.ptr usage
We need to pass something to functions for this to work.
It isn't derivable just from the kernarg segment pointer
because the implicit arguments are placed after the
kernel arguments.

Also fixes missing test for the intrinsic.

llvm-svn: 309398
2017-07-28 15:52:08 +00:00
Wei Mi 55c05e14af [GVN] Recommit the patch "Add phi-translate support in scalarpre"
Recommit after workaround the bug PR31652.

Three bugs fixed in previous recommits: The first one is to use CurrentBlock
instead of PREInstr's Parent as param of performScalarPREInsertion because
the Parent of a clone instruction may be uninitialized. The second one is stop
PRE when CurrentBlock to its predecessor is a backedge and an operand of CurInst
is defined inside of CurrentBlock. The same value defined inside of loop in last
iteration can not be regarded as available. The third one is an out-of-bound
array access in a flipped if guard.

Right now scalarpre doesn't have phi-translate support, so it will miss some
simple pre opportunities. Like the following testcase, current scalarpre cannot
recognize the last "a * b" is fully redundent because a and b used by the last
"a * b" expr are both defined by phis.

long a[100], b[100], g1, g2, g3;
__attribute__((pure)) long goo();

void foo(long a, long b, long c, long d) {

  g1 = a * b;
  if (__builtin_expect(g2 > 3, 0)) {
    a = c;
    b = d;
    g2 = a * b;
  }
  g3 = a * b;      // fully redundant.

}

The patch adds phi-translate support in scalarpre. This is only a temporary
solution before the newpre based on newgvn is available.

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

llvm-svn: 309397
2017-07-28 15:47:25 +00:00
Chris Bieneman b311741011 [CMake] libcompression is optional not required for debugserver
Fix a quick bug from r309395.

llvm-svn: 309396
2017-07-28 15:44:16 +00:00
Chris Bieneman 8c01cc54eb [CMake] Add checks for libcompression
This enables libcompression when available in the CMake build system.

llvm-svn: 309395
2017-07-28 15:39:51 +00:00
Chris Bieneman 0025f3f6ba [CMake] Cleanup of header fixup and installation
This patch does the following:

* Gets the header copy step to re-run whenever header change
* Gets the header fix-up step to re-run whenever headers are copied
* Removes lldb-private*.h headers from the installed headers

llvm-svn: 309394
2017-07-28 15:39:51 +00:00
Chris Bieneman e142631443 [CMake] Enable OS_LOG support on Darwin
This gets CMake to match the Xcode project build

llvm-svn: 309393
2017-07-28 15:39:50 +00:00
Chris Bieneman 6bcc4b96b3 [CMake] Adapt to clang r309390
This removes the configuration order dependence between LLDB and Clang.

llvm-svn: 309392
2017-07-28 15:39:49 +00:00
Rafael Espindola d21ac10f6d Fix the order of section that are not on an order file.
They were being placed before sections that were listed.

llvm-svn: 309391
2017-07-28 15:36:15 +00:00
Chris Bieneman 6b5851bb4a [CMake] NFC. Add clang-tablegen-targets utility target
By creating this target other projects that depend on clang-generated headers (like LLDB) will no longer be order-dependent on Clang being processed by CMake first.

Also, by creating a dummy of this target in ClangConfig.cmake, projects that can build against out-of-tree clang can freely depend on the target without needing to have conditionals for if clang is in-tree or out-of-tree.

llvm-svn: 309390
2017-07-28 15:33:47 +00:00
Chris Bieneman 5726589209 [CMake] NFC. Add intrinsics_gen target to CMake Exports
By creating a dummy of this target in LLVMConfig.cmake, projects that can build against out-of-tree LLVM can freely depend on the target without needing to have conditionals for if LLVM is in-tree or out-of-tree.

llvm-svn: 309389
2017-07-28 15:33:35 +00:00
Dehao Chen ab360d6015 Change INSTR_PROF_DEFAULT_NUM_VAL_PER_SITE from 8 to 16.
Summary: In the current implementation, the defaul number of values per site tracked by value profiler is 8, which is too small and could introduce inaccuracies to profile. Changing it to 16 will be able to gain more accurate value profiler.

Reviewers: davidxl, tejohnson

Reviewed By: tejohnson

Subscribers: sanjoy, llvm-commits

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

llvm-svn: 309388
2017-07-28 15:00:30 +00:00
Siddharth Bhat 4ebeb3568a [PPCGCodeGeneration] Check that invariant load hoisting succeeded.
If we fail, throw an error for now. We can gracefully handle this later.

llvm-svn: 309387
2017-07-28 14:48:32 +00:00
Alex Lorenz 45b4014711 Recommit r308327 3rd time: Add a warning for missing
'#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files

The second recommit (r309106) was reverted because the "non-default #pragma
pack value chages the alignment of struct or union members in the included file"
warning proved to be too aggressive for external projects like Chromium
(https://bugs.chromium.org/p/chromium/issues/detail?id=749197). This recommit
makes the problematic warning a non-default one, and gives it the
-Wpragma-pack-suspicious-include warning option.

The first recommit (r308441) caused a "non-default #pragma pack value might
change the alignment of struct or union members in the included file" warning
in LLVM itself. This recommit tweaks the added warning to avoid warnings for
#includes that don't have any records that are affected by the non-default
alignment. This tweak avoids the previously emitted warning in LLVM.

Original message:

This commit adds a new -Wpragma-pack warning. It warns in the following cases:

- When a translation unit is missing terminating #pragma pack (pop) directives.
- When entering an included file if the current alignment value as determined
  by '#pragma pack' directives is different from the default alignment value.
- When leaving an included file that changed the state of the current alignment
  value.

rdar://10184173

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

llvm-svn: 309386
2017-07-28 14:41:21 +00:00
Chad Rosier e42b44b87d [ValueTracking] Remove a number of unused arguments. NFC.
llvm-svn: 309385
2017-07-28 14:39:06 +00:00
Joel Jones 08e88e8df7 [AArch64] Standardize suffixes for LSE Atomics mnemonics (NFCI)
This NFC changeset standardizes the suffixes used for LSE Atomics
instructions.

It changes the existing suffixes - 'b', 'h', 's', 'd' - to the existing
standard 'B', 'H', 'W' and 'X'.

This changeset is the result of the code review discussion for D35319.

Patch by: steleman

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

llvm-svn: 309384
2017-07-28 14:09:24 +00:00
Simon Pilgrim 0b37ffbbf9 Strip trailing whitespace. NFCI.
llvm-svn: 309383
2017-07-28 14:01:51 +00:00
Simon Pilgrim 9207fab61a [X86] Add tests showing inability of vector non-temporal load/store intrinsic to force pointer alignment (PR33830)
Clang specifies a max type alignment of 16 bytes on darwin targets, meaning that the builtin nontemporal stores don't correctly align the loads/stores to 32 or 64 bytes when required, resulting in lowering to temporal unaligned loads/stores.

llvm-svn: 309382
2017-07-28 13:47:02 +00:00
Strahinja Petrovic 25e9e1b866 [ARM] Add the option to directly access TLS pointer
This patch enables choice for accessing thread local
storage pointer (like '-mtp' in gcc).

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

llvm-svn: 309381
2017-07-28 12:54:57 +00:00
Alexander Kornienko f288ace639 [clang-tidy] Expand readability-redundant-function-ptr-dereference test
llvm-svn: 309380
2017-07-28 12:46:08 +00:00
Alexander Kornienko f3321c5f68 [clang-tidy] readability-redundant-declaration: ignore friends and macros
llvm-svn: 309379
2017-07-28 12:46:02 +00:00
Ilya Biryukov 4dafd14d1a [clangd] Workaround for a test failure on Windows.
Previous workaround (r308959) didn't account for a case when system drive
letter is not 'C:'.

llvm-svn: 309378
2017-07-28 12:25:51 +00:00
Siddharth Bhat 0a1177b58e [ScopDetect] add `-polly-ignore-func` flag to ignore functions by name.
Ignore all functions whose name match a regex. Useful because creating a
regex that does *not* match a string is somewhat hard.

Example:
https://stackoverflow.com/questions/1240275/how-to-negate-specific-word-in-regex

llvm-svn: 309377
2017-07-28 11:47:24 +00:00
George Rimar 7b30dd1c53 [ELF] - Cleanup MapFile.cpp. NFC.
* Removed redundant templating.
* Added missing `static` keyword.

llvm-svn: 309376
2017-07-28 11:13:21 +00:00
Simon Pilgrim 1ff3da7273 [X86] Add test case for PR33290
llvm-svn: 309375
2017-07-28 09:43:52 +00:00
Simon Pilgrim 88d3bed351 [X86][AVX] Cleanup shuffle combine tests - remove old prefixes.
llvm-svn: 309374
2017-07-28 09:41:55 +00:00
Tobias Grosser c0678c016f Add missing namespace comment
llvm-svn: 309373
2017-07-28 09:33:06 +00:00
George Rimar 60833f6e22 [ELF] - Do not crash when ALIGN/DATA_SEGMENT_ALIGN expression used with zero value.
Previously we would crash when tried to ALIGN(0).
Patch uses value 1 instead in this case, that
looks to be consistent with GNU linkers
and reasonable and simple behavior itself.

Differential revision: https://reviews.llvm.org/D35942

llvm-svn: 309372
2017-07-28 09:27:49 +00:00
Peter Smith 5804364f7a [ARM] Add test to check pcs of ARM ABI runtime floating point helpers
The ARM Runtime ABI document (IHI0043) defines the AEABI floating point
helper functions in section 4.1.2 The floating-point helper functions.
The functions listed in this section must always use the base AAPCS calling
convention.

This test generates calls to all the helper functions that llvm supports
and checks that the base AAPCS calling convention has been used. We test
the equivalent of -mfloat-abi=soft, -mfloat-abi=softfp, -mfloat-abi=hardfp
with an FPU that supports single and double precision, and one that only
supports double precision.

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

llvm-svn: 309371
2017-07-28 09:21:00 +00:00
Francois Ferrand a64ba70183 clang-format: merge short case labels with trailing comments
Summary:
Allow merging short case labels when they actually end with a comment
(like a comment after the ``break``) and when followed by switch-level
comments (e.g. aligned with next case):

  switch(a) {
  case 0: break; // comment at end of case
  case 1: return value;
  // comment related to next case
  // comment related to next case
  case 2:
  }

Reviewers: krasimir, djasper

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 309370
2017-07-28 07:56:18 +00:00
Francois Ferrand a98a95cca7 clang-format: fix block OpeningLineIndex around preprocessor
Summary:
The current code would return an incorrect value when a preprocessor
directive is present immediately after the opening brace: this causes
the nanespace end comment fixer to break in some places, for exemple it
would not add the comment in this case:

  namespace a {
  #define FOO
  }

Fixing the computation is simple enough, but it was breaking a feature,
as it would cause comments to be added also when the namespace
declaration was dependant on conditional compilation.

To fix this, a hash of the current preprocessor stack/branches is
computed at the beginning of parseBlock(), so that we explicitely do not
store the OpeningLineIndex when the beginning and end of the block are
not in the same preprocessor conditions.

Tthe hash is computed based on the line, but this could propbably be
improved by using the actual condition, so that clang-format would be
able to match multiple identical #ifdef blocks.

Reviewers: krasimir, djasper

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 309369
2017-07-28 07:56:14 +00:00
Tobias Grosser 25271b91b2 [GPGPU] Do not require the Scop::Context to have information about all parameters
llvm-svn: 309368
2017-07-28 06:49:44 +00:00
Max Kazantsev fa4969539a [SCEV] Do not visit nodes twice in containsConstantSomewhere
This patch reworks the function that searches constants in Add and Mul SCEV expression
chains so that now it does not visit a node more than once, and also renames this function
for better correspondence between its implementation and semantics.

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

llvm-svn: 309367
2017-07-28 06:42:15 +00:00
Tobias Grosser 30caae6d23 [GPGPU] Fix compilation issue with latest CUDA upgrade to i128
llvm-svn: 309366
2017-07-28 06:38:49 +00:00
Jessica Paquette 4602c3437c [MachineOutliner] NFC: Comment tidying
The comment on describing the suffix tree had some pruning
stuff that was out of date in it.

Also fixed some typos.

llvm-svn: 309365
2017-07-28 05:59:30 +00:00
Michal Gorny a3ad81d255 Revert rL309320 - "[OCaml] Respect CMAKE_C_FLAGS for OCaml C files"
This causes buildbot breakage for systems where OCaml files are built
with a different compiler.

llvm-svn: 309364
2017-07-28 04:29:20 +00:00
Saleem Abdulrasool 61d81ec754 test: require x86 backend
Ensure that the target is registered before using it.  Should fix the
hexagon Bots.

llvm-svn: 309363
2017-07-28 04:15:35 +00:00
Petr Hosek a7a9ca4ad1 Support libc++abi in addition to libstdc++
This change adds sanitizer support for LLVM's libunwind and libc++abi
as an alternative to libstdc++. This allows using the in tree version
of libunwind and libc++abi which is useful when building a toolchain
for different target.

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

llvm-svn: 309362
2017-07-28 03:39:39 +00:00
Petr Hosek 2bbb6ad217 Support compiler-rt builtins
This change adds support for compiler-rt builtins as an alternative
compiler runtime to libgcc.

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

llvm-svn: 309361
2017-07-28 03:39:38 +00:00
Saleem Abdulrasool a219b3d8d1 MC: add support for cfi_return_column
This adds support for the CFI pseudo-op return_column.  This specifies
the frame table column which contains the return address.

Addresses PR33953!

llvm-svn: 309360
2017-07-28 03:39:19 +00:00
Saleem Abdulrasool b3c70c09e3 MC: clang-format enumeration (NFC)
This was hard to insert elements into.  clang-format it so that it is
easier.  NFC.

llvm-svn: 309359
2017-07-28 03:39:18 +00:00
Jan Vesely 09f0a560e1 add __kernel_exec macros
also consolidate macros into one file, and rename to clcmacros.h

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 309358
2017-07-28 03:39:03 +00:00
Sanjoy Das 843ab57457 Revert "[SCEV] Cache results of computeExitLimit"
This reverts commit r309080.  The patch needs to clear out the
ScalarEvolution::ExitLimits cache in forgetMemoizedResults.

I've replied on the commit thread for the patch with more details.

llvm-svn: 309357
2017-07-28 03:25:07 +00:00
Jessica Paquette 809d708b8a [MachineOutliner] NFC: Split up getOutliningBenefit
This is some more cleanup in preparation for some actual
functional changes. This splits getOutliningBenefit into
two cost functions: getOutliningCallOverhead and
getOutliningFrameOverhead. These functions return the
number of instructions that would be required to call
a specific function and the number of instructions
that would be required to construct a frame for a
specific funtion. The actual outlining benefit logic
is moved into the outliner, which calls these functions.

The goal of refactoring getOutliningBenefit is to:

- Get us closer to getting rid of the IsTailCall flag

- Further split up "target-specific" things and
"general algorithm" things

llvm-svn: 309356
2017-07-28 03:21:58 +00:00
Davide Italiano 75a001ba78 [JumpThreading] Stop falsely preserving LazyValueInfo.
JumpThreading claims to preserve LVI, but it doesn't preserve
the analyses which LVI holds a reference to (e.g. the Dominator).
In the current pass manager infrastructure, after JT runs, the
PM frees these analyses (including DominatorTree) but preserves
LVI.

CorrelatedValuePropagation runs immediately after and queries
a corrupted domtree, causing weird miscompiles.

This commit disables the preservation of LVI for the time being.
Eventually, we should either move LVI to a proper dependency
tracking mechanism (i.e. an analyses shouldn't hold references
to other analyses and compute them on demand if needed), or
we should teach all the passes preserving LVI to preserve the
analyses LVI depends on.

The new pass manager has a mechanism to invalidate LVI in case
one of the analyses it depends on becomes invalid, so this problem
shouldn't exist (at least not in this immediate form), but handling
of analyses holding references is still a very delicate subject.

Fixes PR33917 (and rustc).

llvm-svn: 309355
2017-07-28 03:10:43 +00:00