139238 Commits

Author SHA1 Message Date
Brian Gesiak
b3f94cd3e0 [docs] Add PR to Lexicon
Summary:
The acronym PR could be ambiguous to some users, especially those who
are used to interpreting it as GitHub's "pull request".

Reviewers: ddunbar, jordan_rose, void, beanz

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283465 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 16:39:22 +00:00
Matt Arsenault
ecc6c2b633 BranchRelaxation: Support expanding unconditional branches
AMDGPU needs to expand unconditional branches in a new
block with an indirect branch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283464 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 16:20:41 +00:00
Krzysztof Parzyszek
1418f155d0 [Hexagon] Avoid replacing full regs with subregisters in tied operands
Doing so will result in the two-address pass generating incorrect code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283463 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 16:18:04 +00:00
Matt Arsenault
38b9b4748d BranchRelaxation: Account for function alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283462 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 16:00:58 +00:00
Matt Arsenault
c205b62417 Move AArch64BranchRelaxation to generic code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283459 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 15:38:53 +00:00
Matt Arsenault
30ab32f7bf AArch64: Move remaining target specific BranchRelaxation bits to TII
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283458 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 15:38:09 +00:00
Nirav Dave
c8f9ada8c6 [X86] Fix intel syntax push parsing bug
Change erroneous parsing of push immediate instructions in intel syntax
to default to pointer size by rewriting into the ATT style for matching.

This fixes PR22028.

Reviewers: majnemer, rnk

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 15:28:08 +00:00
Mehdi Amini
54de287798 Revert "Use StringRef in LTOModule implementation (NFC)"
This reverts commit r282997, a windows bot is asserting in
one test apparently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283456 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 15:12:22 +00:00
Rafael Espindola
ddec8ab4d7 Centralize sh_entsize checking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283455 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 15:08:10 +00:00
Rafael Espindola
42b70df58d Refactor to use getSectionContentsAsArray.
This centralizes quite a bit of error checking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283454 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 14:47:04 +00:00
Rafael Espindola
605a3d0a40 Refactor duplicated typedefs. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 14:07:26 +00:00
Tim Northover
2d767ebb66 GlobalISel: fix misuse of using declaration in test.
Clang didn't diagnose it before. Oops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 13:57:31 +00:00
Sam Kolton
665e97634e [AMDGPU] Disassembler: print label names in branch instructions
Summary: Add AMDGPUSymbolizer for finding names for labels from ELF symbol table.
Initialize MCObjectFileInfo with some default values.

Reviewers: vpykhtin, artem.tamazov, tstellarAMD

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283450 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 13:46:08 +00:00
Anna Thomas
7161c1a5a8 [RS4GC] Fix comment to show TODO. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 13:24:20 +00:00
Rafael Espindola
493d9f99e8 Use range loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283447 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 13:11:12 +00:00
Krzysztof Parzyszek
630fd0186c [RDF] Replace some expensive copies with references in range-based loops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283446 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 13:05:46 +00:00
Krzysztof Parzyszek
78f1992816 [RDF] Replace potentially unclear autos with real types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283445 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 13:05:13 +00:00
Hal Finkel
7b08fb4456 [llvm-opt-report] Record VF, etc. correctly for multiple opts on one line
When there are multiple optimizations on one line, record the vectorization
factors, etc. correctly (instead of incorrectly substituting default values).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283443 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 11:58:52 +00:00
Diana Picus
44f7288034 Revert "[ARM] Use __rt_div functions for divrem on Windows"
This reverts commit r283383 because it broke some of the bots:
undefined reference to ` __aeabi_uldivmod'

It affected (at least) clang-cmake-armv7-a15-selfhost,
clang-cmake-armv7-a15-selfhost and clang-native-arm-lnt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283442 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 11:24:29 +00:00
Hal Finkel
a172b8d4e9 [llvm-opt-report] Print line numbers starting from 1
Line numbers should start from 1, not 2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283440 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 11:11:11 +00:00
Henric Karlsson
d4d21fd53a Test commit access (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283439 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 10:58:41 +00:00
Matt Arsenault
25ec259059 AMDGPU: Partially fix reported code size for some instructions
These ones need to have the size on the pseudo instruction set for
getInstSizeInBytes to work correctly. These also have a statically
known size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283437 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 10:13:23 +00:00
Zvi Rackover
c2afd0ce7b Add test-cases which demontrate pr30561
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283436 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 10:04:00 +00:00
Bjorn Pettersson
c4e191a67a [ValueTracking] Teach computeKnownBits and ComputeNumSignBits to look through ExtractElement.
Summary:
The computeKnownBits and ComputeNumSignBits functions in ValueTracking can now do a simple look-through of ExtractElement.

Reviewers: majnemer, spatel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283434 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 09:56:21 +00:00
Sagar Thakur
45cea084aa [EfficiencySanitizer] Adds shadow memory parameters for 40-bit virtual memory address.
Adding 40-bit shadow memory parameters because MIPS64 uses 40-bit virtual memory addresses.

Reviewed by rengolin.
Differential: https://reviews.llvm.org/D23801


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283433 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 09:52:06 +00:00
Nuno Lopes
9f79578305 fix build on cygwin
Cygwin has dlfcn.h, but no Dl_info

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 09:32:16 +00:00
James Molloy
3747be0f9d [ARM] Constant pool promotion - fix alignment calculation
Global variables are GlobalValues, so they have explicit alignment. Querying
DataLayout for the alignment was incorrect.

Testcase added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283423 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 07:56:00 +00:00
James Molloy
3ea0d2211a [ARM] Improve testcase for r283323
We can work around a shortcoming of FileCheck by using {{\[}} to match a square
bracket before a [[ sequence.

Thanks to Eli Friedman for the heads up!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283422 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 07:44:05 +00:00
Petr Hosek
fc05fb6f65 [Triple] Add triple for Fuchsia
Fuchsia is a new operating system.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283419 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 05:17:26 +00:00
Kostya Serebryany
89268017c2 [libFuzzer] be more careful with memory usage, print peak rss in status lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 05:14:00 +00:00
Konstantin Zhuravlyov
bb3823e630 [AMDGPU] Promote uniform i16 bitreverse intrinsic to i32
Differential Revision: https://reviews.llvm.org/D25121


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283415 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 02:20:46 +00:00
Kostya Serebryany
aca34111f6 [libFuzzer] when re-running for lsan, don't look at the coverage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283411 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 23:31:01 +00:00
Sanjay Patel
d26d793130 [DAG] add tests to show missing checks for SDNode FMF
The AVX attribute is added to remove noise caused by SSE's destructive insts.  


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283410 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 23:20:32 +00:00
Kostya Serebryany
cc6cbfdebc [libFuzzer] refactoring to make -shrink=1 work for value profile, added a test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283409 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 22:56:21 +00:00
Hal Finkel
51ab65f27e Fix tests for Windows
We need to match file names with both forward and backward slashes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283407 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 22:48:13 +00:00
Richard Smith
c5aa2871f3 Add missing #include from r283039. Found by modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283405 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 22:40:54 +00:00
Reid Kleckner
193dcc8866 [codeview] Truncate records to maximum record size near 64KB
If we don't truncate, LLVM asserts when the label difference doesn't fit
in a 16 bit field. This patch truncates two kinds of data: trailing null
terminated names in symbol records, and inline line tables. The inline
line table test that I have is too large (many MB), so I'm not checking
it in.

Hopefully fixes PR28264.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283403 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 22:36:07 +00:00
Hal Finkel
0837bf4c51 [llvm-opt-report] Distinguish inlined contexts when optimizations differ
How code is optimized sometimes, perhaps often, depends on the context into
which it was inlined. This change allows llvm-opt-report to track the
differences between the optimizations performed, or not, in different contexts,
and when these differ, display those differences.

For example, this code:

  $ cat /tmp/q.cpp
  void bar();
  void foo(int n) {
    for (int i = 0; i < n; ++i)
      bar();
  }

  void quack() {
    foo(4);
  }

  void quack2() {
    foo(4);
  }

will now produce this report:

  < /home/hfinkel/src/llvm/test/tools/llvm-opt-report/Inputs/q.cpp
   2         | void bar();
   3         | void foo(int n) {
   [[
    > foo(int):
   4         |   for (int i = 0; i < n; ++i)
    > quack(), quack2():
   4  U4     |   for (int i = 0; i < n; ++i)
   ]]
   5         |     bar();
   6         | }
   7         |
   8         | void quack() {
   9 I       |   foo(4);
  10         | }
  11         |
  12         | void quack2() {
  13 I       |   foo(4);
  14         | }
  15         |

Note that the tool has demangled the function names, and grouped the reports
associated with line 4. This shows that the loop on line 4 was unrolled by a
factor of 4 when inlined into the functions quack() and quack2(), but not in
the function foo(int) itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283402 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 22:25:33 +00:00
Adrian Prantl
3d7360fb8a Verifier: Reject any unknown named MD nodes in the llvm.dbg namespace.
This came out of a discussion in https://reviews.llvm.org/D25285.

There used to be various other llvm.dbg.* nodes, but we don't support
upgrading them and we want to reserve the namespace for future uses.

This also removes an entirely obsolete and bitrotted testcase for PR7662.

Reapplies 283390 with a forgotten testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283400 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 22:15:37 +00:00
Adrian Prantl
5f1ad48020 Revert "Verifier: Reject any unknown named MD nodes in the llvm.dbg namespace."
Forgot to add a testcase in r283390.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283399 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 22:15:34 +00:00
Hal Finkel
6af7eec625 Add an llvm-opt-report tool to generate basic source-annotated optimization summaries
LLVM now has the ability to record information from optimization remarks in a
machine-consumable YAML file for later analysis. This can be enabled in opt
(see r282539), and D25225 adds a Clang flag to do the same. This patch adds
llvm-opt-report, a tool to generate basic optimization "listing" files
(annotated sources with information about what optimizations were performed)
from one of these YAML inputs.

D19678 proposed to add this capability directly to Clang, but this more-general
YAML-based infrastructure was the direction we decided upon in that review
thread.

For this optimization report, I focused on making the output as succinct as
possible while providing information on inlining and loop transformations. The
goal here is that the source code should still be easily readable in the
report. My primary inspiration here is the reports generated by Cray's tools
(http://docs.cray.com/books/S-2496-4101/html-S-2496-4101/z1112823641oswald.html).
These reports are highly regarded within the HPC community. Intel's compiler,
for example, also has an optimization-report capability
(https://software.intel.com/sites/default/files/managed/55/b1/new-compiler-optimization-reports.pdf).

  $ cat /tmp/v.c
  void bar();
  void foo() { bar(); }

  void Test(int *res, int *c, int *d, int *p, int n) {
    int i;

  #pragma clang loop vectorize(assume_safety)
    for (i = 0; i < 1600; i++) {
      res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
    }

    for (i = 0; i < 16; i++) {
      res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
    }

    foo();

    foo(); bar(); foo();
  }

D25225 adds -fsave-optimization-record (and
-fsave-optimization-record=filename), and this would be used as follows:

  $ clang -O3 -o /tmp/v.o -c /tmp/v.c -fsave-optimization-record
  $ llvm-opt-report /tmp/v.yaml > /tmp/v.lst
  $ cat /tmp/v.lst

  < /tmp/v.c
   2          | void bar();
   3          | void foo() { bar(); }
   4          |
   5          | void Test(int *res, int *c, int *d, int *p, int n) {
   6          |   int i;
   7          |
   8          | #pragma clang loop vectorize(assume_safety)
   9     V4,2 |   for (i = 0; i < 1600; i++) {
  10          |     res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
  11          |   }
  12          |
  13  U16     |   for (i = 0; i < 16; i++) {
  14          |     res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
  15          |   }
  16          |
  17 I        |   foo();
  18          |
  19          |   foo(); bar(); foo();
     I        |   ^
     I        |                 ^
  20          | }

Each source line gets a prefix giving the line number, and a few columns for
important optimizations: inlining, loop unrolling and loop vectorization. An
'I' is printed next to a line where a function was inlined, a 'U' next to an
unrolled loop, and 'V' next to a vectorized loop. These are printed on the
relevant code line when that seems unambiguous, or on subsequent lines when
multiple potential options exist (messages, both positive and negative, from
the same optimization with different column numbers are taken to indicate
potential ambiguity). When on subsequent lines, a '^' is output in the relevant
column.

Annotated source for all relevant input files are put into the listing file
(each starting with '<' and then the file name).

You can disable having the unrolling/vectorization factors appear by using the
-s flag.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283398 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 22:10:35 +00:00
Reid Kleckner
81e3914a00 Remove extra semicolon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283395 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 21:46:56 +00:00
Reid Kleckner
87bf0196f2 Fix the build with MSVC 2013, still cannot default move ctors yet
Ten days.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283394 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 21:44:46 +00:00
Sanjay Patel
2a4f206513 [DAG] change test to use 'unsafe' function attribute instead of global setting
But we have node-level FMF, so the next step is to fix this at the instruction/node-level.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283393 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 21:43:50 +00:00
David Callahan
8be61a8c7e Modify df_iterator to support post-order actions
Summary: This makes a change to the state used to maintain visited information for depth first iterator. We know assume a method "completed(...)" which is called after all children of a node have been visited. In all existing cases, this method does nothing so this patch has no functional changes.  It will however allow a client to distinguish back from cross edges in a DFS tree.

Reviewers: nadav, mehdi_amini, dberlin

Subscribers: MatzeB, mzolotukhin, twoh, freik, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 21:36:16 +00:00
Adrian Prantl
5ea3570b6a Verifier: Reject any unknown named MD nodes in the llvm.dbg namespace.
This came out of a discussion in https://reviews.llvm.org/D25285.

There used to be various other llvm.dbg.* nodes, but we don't support
upgrading them and we want to reserve the namespace for future uses.

This also removes an entirely obsolete and bitrotted testcase for PR7662.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 21:31:19 +00:00
Dan Gohman
6a6f29c0d8 [WebAssembly] Add binary-encoding opcode values to instruction descriptions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 21:24:08 +00:00
Reid Kleckner
ba129eb40a [codeview] Translate bitpiece metadata to DEFRANGE_SUBFIELD* records
This allows LLVM to describe locations of aggregate variables that have
been split by SROA.

Fixes PR29141

Reviewers: amccarth, majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283388 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 21:21:33 +00:00
Lang Hames
191187346b [Object] Fix a crash in Archive::child_iterator's default constructor.
To be default constructible, Archive::child_iterator needs to be able to
construct an Archive::Child with a null parent, however Archive::Child's
constructor always dereferenced its Parent argument to compute the remaining
archive size. This commit fixes Archive::Child's constructor to only do the
size calculation when the parent is non-null.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283387 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 21:20:00 +00:00
Martin Storsjo
8c96de4693 [ARM] Use __rt_div functions for divrem on Windows
This avoids falling back to calling out to the GCC rem functions
(__moddi3, __umoddi3) when targeting Windows.

The __rt_div functions have flipped the two arguments compared
to the __aeabi_divmod functions. To match MSVC, we emit a
check for division by zero before actually calling the library
function (even if the library function itself also might do
the same check).

Not all calls to __rt_div functions for division are currently
merged with calls to the same function with the same parameters
for the remainder. This is more wasteful than a div + mls as before,
but avoids calls to __moddi3.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 21:08:02 +00:00