platform/upstream/llvm.git
5 years ago[ADT] Add a fallible_iterator wrapper.
Lang Hames [Tue, 5 Feb 2019 23:17:11 +0000 (23:17 +0000)]
[ADT] Add a fallible_iterator wrapper.

A fallible iterator is one whose increment or decrement operations may fail.
This would usually be supported by replacing the ++ and -- operators with
methods that return error:

    class MyFallibleIterator {
    public:
      // ...
      Error inc();
      Errro dec();
      // ...
    };

The downside of this style is that it no longer conforms to the C++ iterator
concept, and can not make use of standard algorithms and features such as
range-based for loops.

The fallible_iterator wrapper takes an iterator written in the style above
and adapts it to (mostly) conform with the C++ iterator concept. It does this
by providing standard ++ and -- operator implementations, returning any errors
generated via a side channel (an Error reference passed into the wrapper at
construction time), and immediately jumping the iterator to a known 'end'
value upon error. It also marks the Error as checked any time an iterator is
compared with a known end value and found to be inequal, allowing early exit
from loops without redundant error checking*.

Usage looks like:

    MyFallibleIterator I = ..., E = ...;

    Error Err = Error::success();
    for (auto &Elem : make_fallible_range(I, E, Err)) {
      // Loop body is only entered when safe.

      // Early exits from loop body permitted without checking Err.
      if (SomeCondition)
        return;

    }
    if (Err)
      // Handle error.

* Since failure causes a fallible iterator to jump to end, testing that a
  fallible iterator is not an end value implicitly verifies that the error is a
  success value, and so is equivalent to an error check.

Reviewers: dblaikie, rupprecht

Subscribers: mgorny, dexonsmith, kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 353237

5 years ago[WebAssembly] Add a comment about why v128.const test was disabled (NFC)
Heejin Ahn [Tue, 5 Feb 2019 23:01:41 +0000 (23:01 +0000)]
[WebAssembly] Add a comment about why v128.const test was disabled (NFC)

llvm-svn: 353236

5 years ago[InstCombine] limit extracting shuffle transform based on uses
Sanjay Patel [Tue, 5 Feb 2019 22:58:45 +0000 (22:58 +0000)]
[InstCombine] limit extracting shuffle transform based on uses

As discussed in D53037, this can lead to worse codegen, and we
don't generally expect the backend to be able to optimize
arbitrary shuffles. If there's only one use of the 1st shuffle,
that means it's getting removed, so that should always be
safe.

llvm-svn: 353235

5 years ago[WebAssembly] Disable a v128.const test line temporarily
Heejin Ahn [Tue, 5 Feb 2019 22:47:29 +0000 (22:47 +0000)]
[WebAssembly] Disable a v128.const test line temporarily

r353131 caused failures in v128.const test for clang-ppc64be-linux-lnt
and clang-s390x-linux bots. This temporarily disables that line until
it is fixed.

llvm-svn: 353234

5 years ago[InstCombine] split shuffle test to show extra use constraint; NFC
Sanjay Patel [Tue, 5 Feb 2019 22:46:13 +0000 (22:46 +0000)]
[InstCombine] split shuffle test to show extra use constraint; NFC

As discussed in D53037, this transform can cause codegen problems
if the 1st shuffle has multiple uses.

llvm-svn: 353233

5 years agoBasic CUDA-10 support.
Artem Belevich [Tue, 5 Feb 2019 22:38:58 +0000 (22:38 +0000)]
Basic CUDA-10 support.

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

llvm-svn: 353232

5 years ago[Preprocessor] Add a note with framework location for "file not found" error.
Volodymyr Sapsai [Tue, 5 Feb 2019 22:34:55 +0000 (22:34 +0000)]
[Preprocessor] Add a note with framework location for "file not found" error.

When a framework with the same name is available at multiple framework
search paths, we use the first matching location. If a framework at this
location doesn't have all the headers, it can be confusing for
developers because they see only an error `'Foo/Foo.h' file not found`,
can find the complete framework with required header, and don't know the
incomplete framework was used instead.

Add a note explaining a framework without required header was found.
Also mention framework directory path to make it easier to find the
incomplete framework.

rdar://problem/39246514

Reviewers: arphaman, erik.pilkington, jkorous

Reviewed By: jkorous

Subscribers: jkorous, dexonsmith, cfe-commits

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

llvm-svn: 353231

5 years ago[PGO] Use a function for creating variable for profile file name. NFC.
Rong Xu [Tue, 5 Feb 2019 22:34:45 +0000 (22:34 +0000)]
[PGO] Use a function for creating variable for profile file name. NFC.

Factored out the code for creating variable for profile file name to
a function.

llvm-svn: 353230

5 years ago[analyzer] Document RetainCountChecker behavior and annotations
George Karpenkov [Tue, 5 Feb 2019 22:27:10 +0000 (22:27 +0000)]
[analyzer] Document RetainCountChecker behavior and annotations

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

llvm-svn: 353229

5 years ago[analyzer] [testing] Inside CmpRuns.py output also print the filename of the first...
George Karpenkov [Tue, 5 Feb 2019 22:26:57 +0000 (22:26 +0000)]
[analyzer] [testing] Inside CmpRuns.py output also print the filename of the first item in the path

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

llvm-svn: 353228

5 years ago[analyzer] [RetainCountChecker] Bugfix: in non-OSObject-mode, do not track CXX method...
George Karpenkov [Tue, 5 Feb 2019 22:26:44 +0000 (22:26 +0000)]
[analyzer] [RetainCountChecker] Bugfix: in non-OSObject-mode, do not track CXX method calls

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

llvm-svn: 353227

5 years ago[Py3/TestAppleOSSimulator] Another byte<->str interoperability issue.
Davide Italiano [Tue, 5 Feb 2019 22:24:53 +0000 (22:24 +0000)]
[Py3/TestAppleOSSimulator] Another byte<->str interoperability issue.

llvm-svn: 353226

5 years ago[elfabi] Fix the type of the variable formated for error output
Petar Jovanovic [Tue, 5 Feb 2019 22:23:46 +0000 (22:23 +0000)]
[elfabi] Fix the type of the variable formated for error output

Change the format type of Dyn.SONameOffset to PRIx64 since it is a uint64_t.
The problem was detected on mips builds, where it was printing junk values
and causing test failure.

Patch by Milos Stojanovic.

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

llvm-svn: 353225

5 years agoUpdate the ioctl(2) list in sanitizers with NetBSD 8.99.34
Kamil Rytarowski [Tue, 5 Feb 2019 22:20:25 +0000 (22:20 +0000)]
Update the ioctl(2) list in sanitizers with NetBSD 8.99.34

llvm-svn: 353224

5 years ago[NFC][GlobalISel]: Add a convenience method to MachineInstrBuilder to simplify getOpe...
Aditya Nandakumar [Tue, 5 Feb 2019 22:14:40 +0000 (22:14 +0000)]
[NFC][GlobalISel]: Add a convenience method to MachineInstrBuilder to simplify getOperand(i).getReg()

https://reviews.llvm.org/D57608

It's a common pattern in GISel to have a MachineInstrBuilder from which we get various regs
(commonly MIB->getOperand(0).getReg()). This adds a helper method and the above can be
replaced with MIB.getReg(0).

llvm-svn: 353223

5 years ago[X86] Regenerate tests missed in r353061. NFC
Craig Topper [Tue, 5 Feb 2019 21:47:42 +0000 (21:47 +0000)]
[X86] Regenerate tests missed in r353061. NFC

We now print the implicit %st register on these instruction, but since they occur at the end of the line, FileCheck didn't see they were missing.

llvm-svn: 353222

5 years ago[InstrProf] Merge COFF .lprof* and .lcovmap sections into .data/.rdata
Reid Kleckner [Tue, 5 Feb 2019 21:26:31 +0000 (21:26 +0000)]
[InstrProf] Merge COFF .lprof* and .lcovmap sections into .data/.rdata

There is no reason for these sections to remain separate in the final
DLL or EXE.

I have not yet added a InstrProfilingPlatformWindows.c for these, since
avoiding dynamic profile data registration is a larger project for
later.

llvm-svn: 353221

5 years agoFix a missing word in comment
Adrian Prantl [Tue, 5 Feb 2019 21:21:01 +0000 (21:21 +0000)]
Fix a missing word in comment

llvm-svn: 353219

5 years ago[MC] Don't error on numberless .file directives on MachO
Reid Kleckner [Tue, 5 Feb 2019 21:14:09 +0000 (21:14 +0000)]
[MC] Don't error on numberless .file directives on MachO

Summary:
Before r349976, MC ignored such directives when producing an object file
and asserted when re-producing textual assembly output. I turned this
assertion into a hard error in both cases in r349976, but this makes it
unnecessarily difficult to write a single assembly file that supports
both MachO and other object formats that support .file. A user reported
this as PR40578, and we decided to go back to ignoring the directive.

Fixes PR40578

Reviewers: mstorsjo

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 353218

5 years ago[llvm-readobj] Display sections that do not belong to a segment in the section-mapping
Matt Davis [Tue, 5 Feb 2019 21:01:01 +0000 (21:01 +0000)]
[llvm-readobj] Display sections that do not belong to a segment in the section-mapping

Summary:
The following patch adds the "None" line to the section to segment mapping dump.
That line lists the sections that do not belong to any segment.
I realize that this change differs from GNU readelf which does not display the latter information.

I'd rather not add this "feature" under a command line option.  I think that might introduce confusion, since users would have to
make an additional decision as to if they want to see all of the section-to-segment map or just a subset of it.

Another option is to only print the "None" line if the `--section-mapping` option is passed; however,
that might also introduce some confusion, because the section-to-segment map would be different between`--program-headers`
and the `--section-mapping` output.  While the difference is just the "None" line, it seems that if we choose to display
the segment-to-section mapping, then we should always display the whole map including the sections
that do not belong to segments.

```
Section to Segment mapping:
  Segment Sections...
   00
   01     .interp
   02     .interp .note.ABI-tag .gnu.hash
   03     .init_array .fini_array .dynamic
   04     .dynamic
   05     .note.ABI-tag
   06     .eh_frame_hdr
   07
   08     .init_array .fini_array .dynamic .got
   None   .comment .symtab .strtab .shstrtab <--- THIS LINE
```

Reviewers: grimar, rupprecht, jhenderson, espindola

Reviewed By: rupprecht

Subscribers: khemant, emaste, arichardson, llvm-commits

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

llvm-svn: 353217

5 years ago[WebAssembly] Lower memmove to memory.copy
Thomas Lively [Tue, 5 Feb 2019 20:57:40 +0000 (20:57 +0000)]
[WebAssembly] Lower memmove to memory.copy

Summary: The lowering is identical to the memcpy lowering.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 353216

5 years ago[libc++] Fix XFAILs when exceptions are disabled
Louis Dionne [Tue, 5 Feb 2019 20:55:23 +0000 (20:55 +0000)]
[libc++] Fix XFAILs when exceptions are disabled

It turns out that I un-XFAILed too many tests in r353210: some tests
actually fail whether exceptions are enabled or not because they use
types that are marked as unavailable even when exceptions are disabled.

llvm-svn: 353215

5 years ago[DOCS]Support for emission of the debug info for the Cuda devices, NFC.
Alexey Bataev [Tue, 5 Feb 2019 20:38:36 +0000 (20:38 +0000)]
[DOCS]Support for emission of the debug info for the Cuda devices, NFC.

llvm-svn: 353214

5 years ago[TargetLibraryInfo] Regroup run time functions for Windows (NFC)
Evandro Menezes [Tue, 5 Feb 2019 20:24:21 +0000 (20:24 +0000)]
[TargetLibraryInfo] Regroup run time functions for Windows (NFC)

Regroup supported and unsupported functions by precision and C standard.

llvm-svn: 353213

5 years agoDo not use frame pointer by default for MSP430
Anton Korobeynikov [Tue, 5 Feb 2019 20:15:03 +0000 (20:15 +0000)]
Do not use frame pointer by default for MSP430

This is suggested by 3.3.9 of MSP430 EABI document.
We do allow user to manually enable frame pointer. GCC toolchain uses the same behavior.

Patch by Dmitry Mikushev!

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

llvm-svn: 353212

5 years agoMove some llvm-mc tests where they belong
Matt Arsenault [Tue, 5 Feb 2019 20:12:48 +0000 (20:12 +0000)]
Move some llvm-mc tests where they belong

llvm-svn: 353211

5 years ago[libc++] Fix XFAILs on macOS when exceptions are disabled
Louis Dionne [Tue, 5 Feb 2019 20:11:58 +0000 (20:11 +0000)]
[libc++] Fix XFAILs on macOS when exceptions are disabled

Some tests are marked as failing on platforms where the dylib does not
provide the required exception classes. However, when testing with
exceptions disabled, those tests shouldn't be marked as failing.

llvm-svn: 353210

5 years agoGlobalISel: Verify G_GEP
Matt Arsenault [Tue, 5 Feb 2019 20:04:12 +0000 (20:04 +0000)]
GlobalISel: Verify G_GEP

llvm-svn: 353209

5 years ago[CMake] Support compiler-rt builtins library in tests
Petr Hosek [Tue, 5 Feb 2019 19:50:47 +0000 (19:50 +0000)]
[CMake] Support compiler-rt builtins library in tests

We're building tests with -nostdlib which means that we need to
explicitly include the builtins library. When using libgcc (default)
we can simply include -lgcc_s on the link line, but when using
compiler-rt builtins we need a complete path to the builtins library.

This path is already available in CMake as <PROJECT>_BUILTINS_LIBRARY,
so we just need to pass that path to lit and if config.compiler_rt is
true, link it to the test.

Prior to this patch, running tests when compiler-rt is being used as
the builtins library was broken as all tests would fail to link, but
with this change running tests when compiler-rt bultins library is
being used should be supported.

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

llvm-svn: 353208

5 years ago[AMDGPU] Consider XOR in waterfall loop as a terminator
Scott Linder [Tue, 5 Feb 2019 19:50:32 +0000 (19:50 +0000)]
[AMDGPU] Consider XOR in waterfall loop as a terminator

Ensure the XOR in the waterfall loop for indirect addressing is considered a terminator.

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

llvm-svn: 353207

5 years ago[libc++] Use UNSUPPORTED instead of TEST_STD_VER #ifdef
Louis Dionne [Tue, 5 Feb 2019 19:50:17 +0000 (19:50 +0000)]
[libc++] Use UNSUPPORTED instead of TEST_STD_VER #ifdef

When the whole test only works starting at some version of the Standard,
use UNSUPPORTED lit markup instead of #ifdef TEST_STD_VER. This provides
more visibility into the test suite.

Reviewed as https://reviews.llvm.org/D57704.
Thanks to Andrey Maksimov for the patch.

llvm-svn: 353206

5 years ago[sanitizer] Fix unused function 'unpoison_passwd'
Vitaly Buka [Tue, 5 Feb 2019 19:46:44 +0000 (19:46 +0000)]
[sanitizer] Fix unused function 'unpoison_passwd'

llvm-svn: 353205

5 years ago[DEBUG_INFO][NVPTX] Generate correct data about variable address class.
Alexey Bataev [Tue, 5 Feb 2019 19:45:57 +0000 (19:45 +0000)]
[DEBUG_INFO][NVPTX] Generate correct data about variable address class.

Summary:
Added ability to generate correct debug info data about the variable
address class. Currently, for all the locals and globals the default
values are used, ADDR_local_space(6) for locals and ADDR_global_space(5)
for globals. The values are taken from the table in
  https://docs.nvidia.com/cuda/archive/10.0/ptx-writers-guide-to-interoperability/index.html#cuda-specific-dwarf.
  We need to emit correct data for address classes of, at least, shared
  and constant globals. Currently, all these variables are treated by
  the cuda-gdb debugger as the variables in the global address space
  and, thus, it require manual data type casting.

Reviewers: echristo, probinson

Subscribers: jholewinski, aprantl, cfe-commits

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

llvm-svn: 353204

5 years ago[DEBUG_INFO][NVPTX] Generate DW_AT_address_class to get the values in debugger.
Alexey Bataev [Tue, 5 Feb 2019 19:33:47 +0000 (19:33 +0000)]
[DEBUG_INFO][NVPTX] Generate DW_AT_address_class to get the values in debugger.

Summary:
According to
https://docs.nvidia.com/cuda/archive/10.0/ptx-writers-guide-to-interoperability/index.html#cuda-specific-dwarf,
the compiler should emit the DW_AT_address_class attribute for all
variable and parameter. It means, that DW_AT_address_class attribute
should be used in the non-standard way to support compatibility with the
cuda-gdb debugger.
Clang is able to generate the information about the variable address
class. This information is emitted as the expression sequence
`DW_OP_constu <DWARF Address Space> DW_OP_swap DW_OP_xderef`. The patch
tries to find all such expressions and transform them into
`DW_AT_address_class <DWARF Address Space>` if target is NVPTX and the debugger is gdb.
If the expression is not found, then default values are used. For the
local variables <DWARF Address Space> is set to ADDR_local_space(6), for
the globals <DWARF Address Space> is set to ADDR_global_space(5). The
values are taken from the table in the same section 5.2. CUDA-Specific
DWARF Definitions.

Reviewers: echristo, probinson

Subscribers: jholewinski, aprantl, llvm-commits

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

llvm-svn: 353203

5 years agoAMDGPU: Fix assert on trunc from bitcast of build_vector
Matt Arsenault [Tue, 5 Feb 2019 19:23:57 +0000 (19:23 +0000)]
AMDGPU: Fix assert on trunc from bitcast of build_vector

The v2i64 argument is lowered to a bitcast of v4i32 build_vector.
This would then attempt to use the i32-element as the source of the
vector truncate. This really would need to collect 2 elements from the
build_vector to produce the intended truncate.

llvm-svn: 353202

5 years ago[libcxx] Start defining lit features for tests depending on availability
Louis Dionne [Tue, 5 Feb 2019 19:22:38 +0000 (19:22 +0000)]
[libcxx] Start defining lit features for tests depending on availability

This patch removes some vendor-specific availability XFAILs from the
test suite. In the future, when a new feature is introduced in the
dylib, an availability macro should be created and a matching lit
feature should be created. That way, the test suite can XFAIL whenever
the implementation lacks the necessary feature instead of being
cluttered by vendor-specific annotations.

Right now, those vendor-specific annotations are still somewhat cluttering
the test suite by being in `config.py`, but at least they are localized.
In the future, we could design a way to define those less intrusively or
even automatically based on the availability macros that already exist
in <__config>.

llvm-svn: 353201

5 years agoInline a trivial function and update comment. NFC.
Rui Ueyama [Tue, 5 Feb 2019 19:19:45 +0000 (19:19 +0000)]
Inline a trivial function and update comment. NFC.

llvm-svn: 353200

5 years ago[opaque pointer types] More trivial changes to pass FunctionType to CallInst.
James Y Knight [Tue, 5 Feb 2019 19:17:50 +0000 (19:17 +0000)]
[opaque pointer types] More trivial changes to pass FunctionType to CallInst.

Change various functions to use FunctionCallee or Function*.

Pass function type through __builtin_dump_struct's dumpRecord helper.

llvm-svn: 353199

5 years ago[X86][SSE] Disable ZERO_EXTEND shuffle combining
Simon Pilgrim [Tue, 5 Feb 2019 19:15:48 +0000 (19:15 +0000)]
[X86][SSE] Disable ZERO_EXTEND shuffle combining

rL352997 enabled ZERO_EXTEND from non-shuffle-able value types. I've disabled it for now to fix a regression identified by @asbirlea until I can fix this properly.

llvm-svn: 353198

5 years agoMinor cleanup: remove CGBuild::CreateConst*ByteGEP overloads taking a Value*.
James Y Knight [Tue, 5 Feb 2019 19:01:33 +0000 (19:01 +0000)]
Minor cleanup: remove CGBuild::CreateConst*ByteGEP overloads taking a Value*.

llvm-svn: 353197

5 years ago[unittests] Fix warning
Jonas Devlieghere [Tue, 5 Feb 2019 18:46:37 +0000 (18:46 +0000)]
[unittests] Fix warning

warning: comparison of integers of different signs: 'const int' and
'const unsigned long' [-Wsign-compare]

llvm-svn: 353196

5 years ago[Reproducers] Instrumentation Framework: Serialization
Jonas Devlieghere [Tue, 5 Feb 2019 18:46:36 +0000 (18:46 +0000)]
[Reproducers] Instrumentation Framework: Serialization

This is the is serialization/deserialization part of the reproducer
instrumentation framework.

For all the details refer to the RFC on the mailing list:
http://lists.llvm.org/pipermail/lldb-dev/2019-January/014530.html

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

llvm-svn: 353195

5 years ago[PGO] Fix the type of the formated variable
Petar Jovanovic [Tue, 5 Feb 2019 18:09:28 +0000 (18:09 +0000)]
[PGO] Fix the type of the formated variable

Change the format type of Value to PRIu64 since it is a uint64_t.
The problem was detected on mips boards building 32-bit binaries,
where it was printing junk values and causing test failure.

Patch by Milos Stojanovic.

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

llvm-svn: 353194

5 years ago[LLVM-C] Add Bindings to GlobalIFunc
Robert Widmann [Tue, 5 Feb 2019 18:05:44 +0000 (18:05 +0000)]
[LLVM-C] Add Bindings to GlobalIFunc

Summary:
Adds the standard gauntlet of accessors for global indirect functions and updates the echo test.

Now it would be nice to have a target abstraction so one could know if they have access to a suitable ELF linker and runtime.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits

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

llvm-svn: 353193

5 years agoEnable integrated assembler on MSP430 by default.
Anton Korobeynikov [Tue, 5 Feb 2019 18:01:45 +0000 (18:01 +0000)]
Enable integrated assembler on MSP430 by default.

Patch by Kristina Bessonova!

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

llvm-svn: 353192

5 years ago[Obj-C] Fix undefined behaviour(s) in the new NSTaggedDate formatter.
Davide Italiano [Tue, 5 Feb 2019 17:30:53 +0000 (17:30 +0000)]
[Obj-C] Fix undefined behaviour(s) in the new NSTaggedDate formatter.

Type punning through a union -> no good.
double to uint64 to double again -> no good either.

The nice side effect, other than silencing the sanitizer bot
is that it fixes the formatting of some dates, e.g. Jan 1st 1970.

<rdar://problem/47617983>

llvm-svn: 353191

5 years ago[AArch64][Outliner] Don't outline BTI instructions
Oliver Stannard [Tue, 5 Feb 2019 17:21:57 +0000 (17:21 +0000)]
[AArch64][Outliner] Don't outline BTI instructions

We can't outline BTI instructions, because they need to be the very first
instruction executed after an indirect call or branch. If we outline them, then
an indirect call might go to the branch to the outlined function, which will
fault.

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

llvm-svn: 353190

5 years ago[X86][AVX] Attempt to combine shuffles to subvector broadcast load
Simon Pilgrim [Tue, 5 Feb 2019 17:02:49 +0000 (17:02 +0000)]
[X86][AVX] Attempt to combine shuffles to subvector broadcast load

llvm-svn: 353189

5 years agoAArch64/GlobalISel: Don't clamp from 2 to 2
Matt Arsenault [Tue, 5 Feb 2019 16:57:18 +0000 (16:57 +0000)]
AArch64/GlobalISel: Don't clamp from 2 to 2

This is equivalent to clampMaxNumElements, but saves a check.

llvm-svn: 353188

5 years ago[WebAssembly] Use wasm-ld rather than lld with -flavor in tests. NFC.
Sam Clegg [Tue, 5 Feb 2019 16:53:33 +0000 (16:53 +0000)]
[WebAssembly] Use wasm-ld rather than lld with -flavor in tests. NFC.

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

llvm-svn: 353187

5 years ago[OPENMP] issue error messages for multiple teams contructs in a target construct
Kelvin Li [Tue, 5 Feb 2019 16:43:00 +0000 (16:43 +0000)]
[OPENMP] issue error messages for multiple teams contructs in a target construct

The fix is to issue error messages if there are more than one
teams construct inside a target constructs.

#pragma omp target
{
  #pragma omp teams
  {  ...  }

  #pragma omp teams
  { ... }
}

llvm-svn: 353186

5 years ago[libc++] Control whether exceptions are enabled in the macOS trunk testing script
Louis Dionne [Tue, 5 Feb 2019 16:42:37 +0000 (16:42 +0000)]
[libc++] Control whether exceptions are enabled in the macOS trunk testing script

llvm-svn: 353185

5 years ago[opaque pointer types] Pass function types for runtime function calls.
James Y Knight [Tue, 5 Feb 2019 16:42:33 +0000 (16:42 +0000)]
[opaque pointer types] Pass function types for runtime function calls.

Emit{Nounwind,}RuntimeCall{,OrInvoke} have been modified to take a
FunctionCallee as an argument, and CreateRuntimeFunction has been
modified to return a FunctionCallee. All callers have been updated.

Additionally, CreateBuiltinFunction is removed, as it was redundant
with CreateRuntimeFunction after some previous changes.

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

llvm-svn: 353184

5 years ago[WebAssembly] Object: Remove redundant method. NFC.
Sam Clegg [Tue, 5 Feb 2019 16:30:21 +0000 (16:30 +0000)]
[WebAssembly] Object: Remove redundant method. NFC.

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

llvm-svn: 353183

5 years ago[X86][AVX] Add PR34041 subvector broadcast test cases
Simon Pilgrim [Tue, 5 Feb 2019 16:18:30 +0000 (16:18 +0000)]
[X86][AVX] Add PR34041 subvector broadcast test cases

llvm-svn: 353182

5 years ago[opaque pointer types] Fix the CallInfo passed to EmitCall in some
James Y Knight [Tue, 5 Feb 2019 16:05:50 +0000 (16:05 +0000)]
[opaque pointer types] Fix the CallInfo passed to EmitCall in some
edge cases.

Currently, EmitCall emits a call instruction with a function type
derived from the pointee-type of the callee. This *should* be the same
as the type created from the CallInfo parameter, but in some cases an
incorrect CallInfo was being passed.

All of these fixes were discovered by the addition of the assert in
EmitCall which verifies that the passed-in CallInfo matches the
Callee's function type.

As far as I know, these issues caused no bugs at the moment, as the
correct types were ultimately being emitted. But, some would become
problematic when pointee types are removed.

List of fixes:

* arrangeCXXConstructorCall was passing an incorrect value for the
  number of Required args, when calling an inheriting constructor
  where the inherited constructor is variadic. (The inheriting
  constructor doesn't actually get passed any of the user's args, but
  the code was calculating it as if it did).

* arrangeFreeFunctionLikeCall was not including the count of the
  pass_object_size arguments in the count of required args.

* OpenCL uses other address spaces for the "this" pointer. However,
  commonEmitCXXMemberOrOperatorCall was not annotating the address
  space on the "this" argument of the call.

* Destructor calls were being created with EmitCXXMemberOrOperatorCall
  instead of EmitCXXDestructorCall in a few places. This was a problem
  because the calling convention sometimes has destructors returning
  "this" rather than void, and the latter function knows about that,
  and sets up the types properly (through calling
  arrangeCXXStructorDeclaration), while the former does not.

* generateObjCGetterBody: the 'objc_getProperty' function returns type
  'id', but was being called as if it returned the particular
  property's type. (That is of course the *dynamic* return type, and
  there's a downcast immediately after.)

* OpenMP user-defined reduction functions (#pragma omp declare
  reduction) can be called with a subclass of the declared type. In
  such case, the call was being setup as if the function had been
  actually declared to take the subtype, rather than the base type.

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

llvm-svn: 353181

5 years ago[NFC][libc++] Reindent function
Louis Dionne [Tue, 5 Feb 2019 15:46:52 +0000 (15:46 +0000)]
[NFC][libc++] Reindent function

llvm-svn: 353180

5 years ago[CGP] add test for unsigned subtract of 1 with overflow; NFC
Sanjay Patel [Tue, 5 Feb 2019 15:27:40 +0000 (15:27 +0000)]
[CGP] add test for unsigned subtract of 1 with overflow; NFC

llvm-svn: 353179

5 years ago[AArch64][x86] add tests for unsigned subtract with overflow; NFC
Sanjay Patel [Tue, 5 Feb 2019 15:26:42 +0000 (15:26 +0000)]
[AArch64][x86] add tests for unsigned subtract with overflow; NFC

llvm-svn: 353178

5 years agogn build: BUILD.gn files for clang-tidy and clang-apply-replacements
Nico Weber [Tue, 5 Feb 2019 15:14:38 +0000 (15:14 +0000)]
gn build: BUILD.gn files for clang-tidy and clang-apply-replacements

Patch from Mirko Bonadei <mbonadei@webrtc.org>!

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

llvm-svn: 353177

5 years agoFix typo in comment, NFCI
Krasimir Georgiev [Tue, 5 Feb 2019 15:00:56 +0000 (15:00 +0000)]
Fix typo in comment, NFCI

llvm-svn: 353176

5 years agogn build: Merge r353072
Nico Weber [Tue, 5 Feb 2019 14:47:36 +0000 (14:47 +0000)]
gn build: Merge r353072

llvm-svn: 353175

5 years agoUpdate Xcode project after r353047
Stefan Granitz [Tue, 5 Feb 2019 14:41:26 +0000 (14:41 +0000)]
Update Xcode project after r353047

llvm-svn: 353174

5 years agoRecommit: Detect incorrect FileCheck variable CLI definition
Thomas Preud'homme [Tue, 5 Feb 2019 14:17:28 +0000 (14:17 +0000)]
Recommit: Detect incorrect FileCheck variable CLI definition

Summary:
While the backend code of FileCheck relies on definition of variable
from the command-line to have an equal sign '=' and a variable name
before that, the frontend does not actually enforce it. This leads to
FileCheck crashing when invoked with invalid syntax for the -D option.

This patch adds the missing validation in the frontend. It also makes
the -D option an AlwaysPrefix option to be able to detect -D=FOO as
being a define without variable and -D as missing its value.

Copyright:
- Linaro (changes in version 2 of revision D55940)
- GraphCore (changes in later versions)

Reviewers: jdenny

Subscribers: JonChesterfield, hiraditya, kristina, probinson,
llvm-commits

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

llvm-svn: 353173

5 years agoRecommit: Add support for prefix-only CLI options
Thomas Preud'homme [Tue, 5 Feb 2019 14:17:16 +0000 (14:17 +0000)]
Recommit: Add support for prefix-only CLI options

Summary:
Add support for options that always prefix their value, giving an error
if the value is in the next argument or if the option is given a value
assignment (ie. opt=val). This is the desired behavior for the -D option
of FileCheck for instance.

Copyright:
- Linaro (changes in version 2 of revision D55940)
- GraphCore (changes in later versions and introduced when creating
  D56549)

Reviewers: jdenny

Subscribers: llvm-commits, probinson, kristina, hiraditya,
JonChesterfield

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

llvm-svn: 353172

5 years ago[X86][SSE] Rename SimplifyDemandedVectorElts BLENDV tests
Simon Pilgrim [Tue, 5 Feb 2019 14:11:50 +0000 (14:11 +0000)]
[X86][SSE] Rename SimplifyDemandedVectorElts BLENDV tests

I'm going to be adding SimplifyDemandedBits tests shortly.

llvm-svn: 353171

5 years ago[MCA] Moved the logic that updates register dependencies from DispatchStage to Regist...
Andrea Di Biagio [Tue, 5 Feb 2019 14:11:41 +0000 (14:11 +0000)]
[MCA] Moved the logic that updates register dependencies from DispatchStage to RegisterFile. NFC

DispatchStage should always delegate to an object of class RegisterFile the task
of updating data dependencies.  ReadState and WriteState objects should not be
modified directly by DispatchStage.
This patch also renames stage IS_AVAILABLE to IS_DISPATCHED.

llvm-svn: 353170

5 years agogn build: Fix Python 3 write_vcsrevision script compatibility
Serge Guelton [Tue, 5 Feb 2019 13:01:12 +0000 (13:01 +0000)]
gn build: Fix Python 3 write_vcsrevision script compatibility

Trivial fix: decode was not called for all subprocess.check_output calls.

Commited on behalf of Andrew Boyarshin

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

llvm-svn: 353168

5 years ago[X86][SSE] Add SimplifyDemandedVectorElts support for X86ISD::BLENDV
Simon Pilgrim [Tue, 5 Feb 2019 12:27:29 +0000 (12:27 +0000)]
[X86][SSE] Add SimplifyDemandedVectorElts support for X86ISD::BLENDV

llvm-svn: 353165

5 years ago[X86][SSE] Add tests showing missing SimplifyDemandedVectorElts support for X86ISD...
Simon Pilgrim [Tue, 5 Feb 2019 12:18:34 +0000 (12:18 +0000)]
[X86][SSE] Add tests showing missing SimplifyDemandedVectorElts support for X86ISD::BLENDV

llvm-svn: 353164

5 years ago[NFC] Explicitly add -std=c++14 option to tests that rely on the C++14 default
Nemanja Ivanovic [Tue, 5 Feb 2019 12:05:53 +0000 (12:05 +0000)]
[NFC] Explicitly add -std=c++14 option to tests that rely on the C++14 default

When Clang/LLVM is built with the CLANG_DEFAULT_STD_CXX CMake macro that sets
the default standard to something other than C++14, there are a number of lit
tests that fail as they rely on the C++14 default.
This patch just adds the language standard option explicitly to such test cases.

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

llvm-svn: 353163

5 years ago[MCA] Simplify the logic in method WriteState::addUser. NFCI
Andrea Di Biagio [Tue, 5 Feb 2019 11:36:55 +0000 (11:36 +0000)]
[MCA] Simplify the logic in method WriteState::addUser. NFCI

In some cases, it is faster to just grow the set of 'Users' rather than
performing a llvm::find_if every time a new user is added to
the set. No functional change intended.

llvm-svn: 353162

5 years ago[Expressions] Fix -Wreorder warning from r353149
Krasimir Georgiev [Tue, 5 Feb 2019 11:35:45 +0000 (11:35 +0000)]
[Expressions] Fix -Wreorder warning from r353149

Summary:
```
ClangExpressionDeclMap.cpp:72:60: error: field 'm_struct_vars' will be initialized after field 'm_ctx_obj' [-Werror,-Wreorder]
      m_result_delegate(result_delegate), m_parser_vars(), m_struct_vars(),
```

Reviewers: bkramer, aleksandr.urakov

Reviewed By: aleksandr.urakov

Subscribers: aleksandr.urakov

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

llvm-svn: 353161

5 years agoFix ICE on reference binding with mismatching addr spaces.
Anastasia Stulova [Tue, 5 Feb 2019 11:32:58 +0000 (11:32 +0000)]
Fix ICE on reference binding with mismatching addr spaces.

When we attempt to add an addr space qual to a type already
qualified by an addr space ICE is triggered. Before creating
a type with new address space, remove the old addr space.

Fixing PR38614!

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

llvm-svn: 353160

5 years ago[DebugInfo][NFCI] Split salvageDebugInfo into helper functions
Jeremy Morse [Tue, 5 Feb 2019 11:11:28 +0000 (11:11 +0000)]
[DebugInfo][NFCI] Split salvageDebugInfo into helper functions

Some use cases are appearing where salvaging is needed that does not
correspond to an instruction being deleted -- for example an instruction
being sunk, or a Value not being available in a block being isel'd.

Enable more fine grained control over how salavging occurs by splitting
the logic into helper functions, separating things that are specific to
working on DbgVariableIntrinsics from those specific to interpreting IR
and building DIExpressions.

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

llvm-svn: 353156

5 years agoFix format string in bindings/go/llvm/ir_test.go (PR40561)
Hans Wennborg [Tue, 5 Feb 2019 11:01:54 +0000 (11:01 +0000)]
Fix format string in bindings/go/llvm/ir_test.go (PR40561)

The test started failing for me recently. I don't see any changes around
this code, so maybe it's my local go version that changed or something.

The error seems real to me: we're trying to print an Attribute with %d.
The test talks about "attribute masks" I'm not sure what that refers to,
but I suppose we could print the raw pointer value, since that's
what the test seems to be comparing.

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

llvm-svn: 353155

5 years ago[X86][AVX] Attempt to share broadcasts of different widths (PR39454)
Simon Pilgrim [Tue, 5 Feb 2019 10:58:43 +0000 (10:58 +0000)]
[X86][AVX] Attempt to share broadcasts of different widths (PR39454)

If we have broadcasts of different vector widths, keep the longest vector width and extract subvectors for the shorter vectors (which should be free).

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

llvm-svn: 353154

5 years ago[CostModel][X86] Add UMUL fixed point cost tests
Simon Pilgrim [Tue, 5 Feb 2019 10:55:38 +0000 (10:55 +0000)]
[CostModel][X86] Add UMUL fixed point cost tests

llvm-svn: 353153

5 years ago[CGP] Add support for sinking operands to their users, if they are free.
Florian Hahn [Tue, 5 Feb 2019 10:27:40 +0000 (10:27 +0000)]
[CGP] Add support for sinking operands to their users, if they are free.

This patch improves code generation for some AArch64 ACLE intrinsics. It adds
support to CGP to duplicate and sink operands to their user, if they can be
folded into a target instruction, like zexts and sub into usubl. It adds a
TargetLowering hook shouldSinkOperands, which looks at the operands of
instructions to see if sinking is profitable.

I decided to add a new target hook, as for the sinking to be profitable,
at least on AArch64, we have to look at multiple operands of an
instruction, instead of looking at the users of a zext for example.

The sinking is done in CGP, because it works around an instruction
selection limitation. If instruction selection is not limited to a
single basic block, this patch should not be needed any longer.

Alternatively this could be done in the LoopSink pass, which tries to
undo LICM for instructions in blocks that are not executed frequently.

Note that we do not force the operands to sink to have a single user,
because we duplicate them before sinking. Therefore this is only
desirable if they really can be done for free. Additionally we could
consider the impact on live ranges later on.

This should fix https://bugs.llvm.org/show_bug.cgi?id=40025.

As for performance, we have internal code that uses intrinsics and can
be speed up by 10% by this change.

Reviewers: SjoerdMeijer, t.p.northover, samparker, efriedma, RKSimon, spatel

Reviewed By: samparker

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

llvm-svn: 353152

5 years ago[ARM GlobalISel] Support G_GEP for Thumb2
Diana Picus [Tue, 5 Feb 2019 10:21:37 +0000 (10:21 +0000)]
[ARM GlobalISel] Support G_GEP for Thumb2

Same as ARM, but use a different opcode in the instruction selection.

llvm-svn: 353151

5 years agoFix the sphinx buildbot after D54429
Kristof Umann [Tue, 5 Feb 2019 10:19:39 +0000 (10:19 +0000)]
Fix the sphinx buildbot after D54429

llvm-svn: 353150

5 years ago[Expressions] Add support of expressions evaluation in some object's context
Aleksandr Urakov [Tue, 5 Feb 2019 09:14:36 +0000 (09:14 +0000)]
[Expressions] Add support of expressions evaluation in some object's context

Summary:
This patch adds support of expression evaluation in a context of some object.
Consider the following example:
```
struct S {
  int a = 11;
  int b = 12;
};

int main() {
  S s;
  int a = 1;
  int b = 2;
  // We have stopped here
  return 0;
}
```
This patch allows to do something like that:
```
lldb.frame.FindVariable("s").EvaluateExpression("a + b")
```
and the result will be `33` (not `3`) because fields `a` and `b` of `s` will be
used (not locals `a` and `b`).

This is achieved by replacing of `this` type and object for the expression. This
has some limitations: an expression can be evaluated only for values located in
the debuggee process memory (they must have an address of `eAddressTypeLoad`
type).

Reviewers: teemperor, clayborg, jingham, zturner, labath, davide, spyffe, serge-sans-paille

Reviewed By: jingham

Subscribers: abidh, lldb-commits, leonid.mashinskiy

Tags: #lldb

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

llvm-svn: 353149

5 years agoPreviously if the user configured their build but then changed
Dan Liew [Tue, 5 Feb 2019 08:47:28 +0000 (08:47 +0000)]
Previously if the user configured their build but then changed
LLVM_ENABLED_PROJECT and reconfigured it had no effect on what
projects were actually built. This was very confusing behaviour. The
reason for this is that the value of the `LLVM_TOOL_<PROJECT>_BUILD`
variables are already set.

The problem here is that we have two sources of truth:

* The projects listed in LLVM_ENABLE_PROJECTS.
* The projects enabled/disabled with LLVM_TOOL_<PROJECT>_BUILD.

At configure time we have no real way of knowing which source of truth
the user wants so we apply the following heuristic:

If the user ever sets `LLVM_ENABLE_PROJECTS` in the CMakeCache then that
is used as the single source of truth and we force the
`LLVM_TOOL_<PROJECT>_BUILD` CMake cache variables to have the
appropriate values that match the contents of the
`LLVM_ENABLE_PROJECTS`. If the user never sets `LLVM_ENABLE_PROJECTS`
then they can continue to use and set the `LLVM_TOOL_<PROJECT>_BUILD`
variables as the "source of truth".

The problem with this approach is that if the user ever tries to use
both `LLVM_ENABLE_PROJECTS` and `LLVM_TOOL_<PROJECT>_BUILD` for the same
build directory then any user set value for `LLVM_TOOL_<PROJECT>_BUILD`
variables will get overwriten, likely without the user noticing.

Hopefully the above shouldn't matter in practice because the
LLVM_TOOL_<PROJECT>_BUILD variables are not documented, but
LLVM_ENABLE_PROJECTS is.

We should probably deprecate the `LLVM_TOOL_<PROJECT>_BUILD`
variables at some point by turning them into to regular CMake
variables that don't live in the CMake cache.

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

llvm-svn: 353148

5 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Tue, 5 Feb 2019 08:30:48 +0000 (08:30 +0000)]
[NFC] fix trivial typos in comments

llvm-svn: 353147

5 years ago[COFF] Avoid O(n^2) accesses into PartialSections
Martin Storsjo [Tue, 5 Feb 2019 08:16:10 +0000 (08:16 +0000)]
[COFF] Avoid O(n^2) accesses into PartialSections

For MinGW, unique partial sections are much more common, e.g.
comdat functions get sections named e.g. text$symbol.

A moderate sized example of this contains over 200K Chunks
which create 174K unique PartialSections. Prior to SVN r352928
(D57574), linking this took around 1,5 seconds for me, while
it afterwards takes around 13 minutes. After this patch, the
linking time is back to what it was before.

The std::find_if in findPartialSection will do a linear scan of
the whole container until a match is found. To use something like
binary_search or the std::set container's own methods, we'd need
to already have a PartialSection*.

Reinstate a proper map instead of having a set with a custom sorting
comparator.

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

llvm-svn: 353146

5 years ago[MinGW] Hook up the --no-insert-timestamp option
Martin Storsjo [Tue, 5 Feb 2019 08:16:06 +0000 (08:16 +0000)]
[MinGW] Hook up the --no-insert-timestamp option

This fixes PR40582.

Patch by Georg Koppen!

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

llvm-svn: 353145

5 years ago[DAG][NFC] Add unit tests.
Clement Courbet [Tue, 5 Feb 2019 08:00:17 +0000 (08:00 +0000)]
[DAG][NFC] Add unit tests.

In preparation for D57541.

llvm-svn: 353144

5 years ago[DAG] BaseIndexOffset: FrameIndexSDNodes with the same FrameIndex compare equal.
Clement Courbet [Tue, 5 Feb 2019 07:36:20 +0000 (07:36 +0000)]
[DAG] BaseIndexOffset: FrameIndexSDNodes with the same FrameIndex compare equal.

Reviewers: niravd

Subscribers: arphaman, llvm-commits

Tags: #llvm

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

llvm-svn: 353143

5 years ago[X86] Change MS inline asm clobber list filter to check for 'fpsr' instead of 'fpsw...
Craig Topper [Tue, 5 Feb 2019 06:13:14 +0000 (06:13 +0000)]
[X86] Change MS inline asm clobber list filter to check for 'fpsr' instead of 'fpsw' after D57641.

Summary: The backend used to print the x87 FPSW register as 'fpsw', but gcc inline asm uses 'fpsr'. After D57641, the backend now uses 'fpsr' to match.

Reviewers: rnk

Reviewed By: rnk

Subscribers: eraman, cfe-commits, llvm-commits

Tags: #clang

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

llvm-svn: 353142

5 years ago[X86] Connect the default fpsr and dirflag clobbers in inline assembly to the registe...
Craig Topper [Tue, 5 Feb 2019 06:13:06 +0000 (06:13 +0000)]
[X86] Connect the default fpsr and dirflag clobbers in inline assembly to the registers we have defined for them.

Summary:
We don't currently map these constraints to physical register numbers so they don't make it to the MachineIR representation of inline assembly.

This could have problems for proper dependency tracking in the machine schedulers though I don't have a test case that shows that.

Reviewers: rnk

Reviewed By: rnk

Subscribers: eraman, llvm-commits

Tags: #llvm

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

llvm-svn: 353141

5 years agoFix double curlies
JF Bastien [Tue, 5 Feb 2019 05:34:12 +0000 (05:34 +0000)]
Fix double curlies

Pointed out by Arthur in D57624.

llvm-svn: 353140

5 years agogn build: Upgrade to NDK r19.
Peter Collingbourne [Tue, 5 Feb 2019 05:10:19 +0000 (05:10 +0000)]
gn build: Upgrade to NDK r19.

NDK r19 includes a sysroot that can be used directly by the compiler
without creating a standalone toolchain, so we just need a handful
of flags to point Clang there.

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

llvm-svn: 353139

5 years ago[X86] Add test case from PR40529. NFC
Craig Topper [Tue, 5 Feb 2019 04:48:23 +0000 (04:48 +0000)]
[X86] Add test case from PR40529. NFC

llvm-svn: 353138

5 years ago[CMake] Update lit test configuration
Petr Hosek [Tue, 5 Feb 2019 04:44:03 +0000 (04:44 +0000)]
[CMake] Update lit test configuration

There are several changes:
- Don't stringify Pythonized bools (that's why we're Pythonizing them)
- Support specifying target and sysroot via CMake variables
- Use consistent spelling for --target, --sysroot, --gcc-toolchain

llvm-svn: 353137

5 years ago[LSR] Check SCEV on isZero() after extend. PR40514
Max Kazantsev [Tue, 5 Feb 2019 04:30:37 +0000 (04:30 +0000)]
[LSR] Check SCEV on isZero() after extend. PR40514

When LSR first adds SCEVs to BaseRegs, it only does it if `isZero()` has
returned false. In the end, in invocation of `InsertFormula`, it asserts that
all values there are still not zero constants. However between these two
points, it makes some transformations, in particular extends them to wider
type.

SCEV does not give us guarantee that if `S` is not a constant zero, then
`sext(S)` is also not a constant zero. It might have missed some optimizing
transforms when it was calculating `S` and then made them when it took `sext`.
For example, it may happen if previously optimizing transforms were limited
by depth or somehow else.

This patch adds a bailout when we may end up with a zero SCEV after extension.

Differential Revision: https://reviews.llvm.org/D57565
Reviewed By: samparker

llvm-svn: 353136

5 years ago[SamplePGO] More pipeline changes when flattened profile used in ThinLTO postlink
Teresa Johnson [Tue, 5 Feb 2019 04:09:19 +0000 (04:09 +0000)]
[SamplePGO] More pipeline changes when flattened profile used in ThinLTO postlink

Summary:
Follow on to D54819/r351476.

We also don't need to perform extra InstCombine pass when we aren't
loading the sample profile in the ThinLTO backend because we have a
flattened sample profile.

Additionally, for consistency and clarity, when we aren't reloading the
sample profile, perform ICP in the same location as non-sample PGO
backends. To this end I have moved the ICP invocation for non-SamplePGO
ThinLTO down into buildModuleSimplificationPipeline (partly addresses
the FIXME where we were previously setting this up).

Reviewers: wmi

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 353135

5 years agoFix narrowing issue from r353129
Richard Trieu [Tue, 5 Feb 2019 02:26:03 +0000 (02:26 +0000)]
Fix narrowing issue from r353129

llvm-svn: 353134

5 years ago[WebAssembly] Fix indentation after adding IsCanonical property (NFC)
Heejin Ahn [Tue, 5 Feb 2019 01:59:49 +0000 (01:59 +0000)]
[WebAssembly] Fix indentation after adding IsCanonical property (NFC)

llvm-svn: 353132

5 years ago[WebAssembly] Make disassembler always emit most canonical name.
Wouter van Oortmerssen [Tue, 5 Feb 2019 01:19:45 +0000 (01:19 +0000)]
[WebAssembly] Make disassembler always emit most canonical name.

Summary:
There are a few instructions that all map to the same opcode, so
when disassembling, we have to pick one. That was just the first one
before (the except_ref variant in the case of "call"), now it is the
one marked as IsCanonical in tablegen, or failing that, the shortest
name (which is typically the "canonical" one).

Also introduced a canonical "end" instruction for this purpose.

Reviewers: dschuff, tlively

Subscribers: sbc100, jgravelle-google, aheejin, llvm-commits, sunfish

Tags: #llvm

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

llvm-svn: 353131

5 years ago[Python2 to Python 3] Fix print -> print().
Davide Italiano [Tue, 5 Feb 2019 00:59:57 +0000 (00:59 +0000)]
[Python2 to Python 3] Fix print -> print().

llvm-svn: 353130