platform/upstream/llvm.git
6 years agomath.h: Set HAVE_HW_FMA32 based on compiler provided macro
Jan Vesely [Mon, 29 Jan 2018 19:05:08 +0000 (19:05 +0000)]
math.h: Set HAVE_HW_FMA32 based on compiler provided macro

Fixes sin/cos piglits on non-FMA capable asics.
Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=35983

Reviewer: Tom Stellard
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 323677

6 years ago[MachineVerifier] Add check that renamable operands aren't reserved registers.
Geoff Berry [Mon, 29 Jan 2018 18:57:07 +0000 (18:57 +0000)]
[MachineVerifier] Add check that renamable operands aren't reserved registers.

Summary:

Reviewers: qcolombet, MatzeB

Subscribers: arsenm, sdardis, nhaehnle, mcrosier, llvm-commits

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

llvm-svn: 323676

6 years ago[AMDGPU][X86][Mips] Make sure renamable bit not set for reserved regs
Geoff Berry [Mon, 29 Jan 2018 18:47:48 +0000 (18:47 +0000)]
[AMDGPU][X86][Mips] Make sure renamable bit not set for reserved regs

Summary:
Fix a few places that were modifying code after register
allocation to set the renamable bit correctly to avoid failing the
validation added in D42449.

llvm-svn: 323675

6 years agoMove getPlatformFlags to ELFObjectFileBase and simplify.
Rafael Espindola [Mon, 29 Jan 2018 18:27:30 +0000 (18:27 +0000)]
Move getPlatformFlags to ELFObjectFileBase and simplify.

This removes a few std::error_code results that were ignored on every
call.

llvm-svn: 323674

6 years ago[Host] Respect LLVM_LIBDIR_SUFFIX when looking for LLDB plugins on Linux
Michal Gorny [Mon, 29 Jan 2018 18:25:06 +0000 (18:25 +0000)]
[Host] Respect LLVM_LIBDIR_SUFFIX when looking for LLDB plugins on Linux

Fix the Linux plugin lookup path to include appropriate libdir suffix
for the system. To accomplish this, store the value of
LLVM_LIBDIR_SUFFIX in lldb/Host/Config.h as LLDB_LIBDIR_SUFFIX,
and use this variable when defining the plugin path.

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

llvm-svn: 323673

6 years ago[X86] Don't create SHRUNKBLEND when the condition is used by the true or false operan...
Craig Topper [Mon, 29 Jan 2018 17:56:57 +0000 (17:56 +0000)]
[X86] Don't create SHRUNKBLEND when the condition is used by the true or false operand of the vselect.

Fixes PR34592.

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

llvm-svn: 323672

6 years ago[X86] Add test case for pr34592
Craig Topper [Mon, 29 Jan 2018 17:56:55 +0000 (17:56 +0000)]
[X86] Add test case for pr34592

llvm-svn: 323671

6 years ago[DWARF] Recommitting a test reverted in r323560. Moved to x86 directory with explicit...
Wolfgang Pieb [Mon, 29 Jan 2018 17:49:10 +0000 (17:49 +0000)]
[DWARF] Recommitting a test reverted in r323560. Moved to x86 directory with explicit triple.
ELF support is required for type units.

llvm-svn: 323670

6 years ago[globalisel] Make LegalizerInfo::LegalizeAction available outside of LegalizerInfo...
Daniel Sanders [Mon, 29 Jan 2018 17:37:29 +0000 (17:37 +0000)]
[globalisel] Make LegalizerInfo::LegalizeAction available outside of LegalizerInfo. NFC

Summary:
The improvements to the LegalizerInfo discussed in D42244 require that
LegalizerInfo::LegalizeAction be available for use in other classes. As such,
it needs to be moved out of LegalizerInfo. This has been done separately to the
next patch to minimize the noise in that patch.

llvm-svn: 323669

6 years ago[clang-format] Fix bug where -dump-config failed on ObjC header
Ben Hamilton [Mon, 29 Jan 2018 17:36:43 +0000 (17:36 +0000)]
[clang-format] Fix bug where -dump-config failed on ObjC header

Summary:
`clang-format -dump-config path/to/file.h` never passed
anything for the Code parameter to clang::format::getStyle().

This meant the logic to guess Objective-C from the contents
of a .h file never worked, because LibFormat didn't have the
code to work with.

With this fix, we now correctly read in the contents of the
file if possible with -dump-config.

I had to update the lit config for test/Format/ because
the default config ignores .h files.

Test Plan: make -j12 check-clang

Reviewers: jolesiak, krasimir

Reviewed By: jolesiak, krasimir

Subscribers: Wizard, klimek, cfe-commits, djasper

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

llvm-svn: 323668

6 years ago[AccelTable] Workaround for MSVC bug
Jonas Devlieghere [Mon, 29 Jan 2018 17:28:51 +0000 (17:28 +0000)]
[AccelTable] Workaround for MSVC bug

Microsoft Visual Studio rejects the static constexpr static list of
atoms even though it's valid C++. This provides a workaround to unbreak
the bots.

llvm-svn: 323667

6 years agoAdd myself to CREDITS.txt
Tony Jiang [Mon, 29 Jan 2018 17:02:34 +0000 (17:02 +0000)]
Add myself to CREDITS.txt

llvm-svn: 323666

6 years ago[scan-build] Add an option to skip overriding CC and CXX make vars
Jonathan Roelofs [Mon, 29 Jan 2018 16:49:34 +0000 (16:49 +0000)]
[scan-build] Add an option to skip overriding CC and CXX make vars

Autoconf and some other systems tend to add essential compilation
options to CC (e.g. -std=gnu99). When running such an auto-generated
makefile, scan-build does not need to change CC and CXX as they are
already set to use ccc-analyzer by a configure script.

Implement a new option --keep-cc as was proposed in this discussion:
http://lists.llvm.org/pipermail/cfe-dev/2013-September/031832.html

Patch by Paul Fertser!

llvm-svn: 323665

6 years ago[analyzer] Fix -x language argument for C preprocessed sources
Jonathan Roelofs [Mon, 29 Jan 2018 16:37:53 +0000 (16:37 +0000)]
[analyzer] Fix -x language argument for C preprocessed sources

clang's -x option doesn't accept c-cpp-output as a language (even though
463eb6ab was merged, the driver still doesn't handle that).

This bug prevents testing C language projects when ccache is used.

Fixes #25851.

Investigation and patch by Dave Rigby.

llvm-svn: 323664

6 years agoAdd test case for truncated and promotion to test. NFC
Amaury Sechet [Mon, 29 Jan 2018 16:13:01 +0000 (16:13 +0000)]
Add test case for truncated and promotion to test. NFC

llvm-svn: 323663

6 years ago[SLP] Fix for PR32086: Count InsertElementInstr of the same elements as shuffle.
Alexey Bataev [Mon, 29 Jan 2018 16:08:52 +0000 (16:08 +0000)]
[SLP] Fix for PR32086: Count InsertElementInstr of the same elements as shuffle.

Summary:
If the same value is going to be vectorized several times in the same
tree entry, this entry is considered to be a gather entry and cost of
this gather is counter as cost of InsertElementInstrs for each gathered
value. But we can consider these elements as ShuffleInstr with
SK_PermuteSingle shuffle kind.

Reviewers: spatel, RKSimon, mkuper, hfinkel

Subscribers: llvm-commits

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

llvm-svn: 323662

6 years ago[SLP] Add a test with extract for PR32086, NFC.
Alexey Bataev [Mon, 29 Jan 2018 15:56:52 +0000 (15:56 +0000)]
[SLP] Add a test with extract for PR32086, NFC.

llvm-svn: 323661

6 years ago[clangd] Use new URI with scheme support in place of the existing LSP URI
Eric Liu [Mon, 29 Jan 2018 15:37:46 +0000 (15:37 +0000)]
[clangd] Use new URI with scheme support in place of the existing LSP URI

Summary:
o Replace the existing clangd::URI with a wrapper of FileURI which also
carries a resolved file path.
o s/FileURI/URI/
o Get rid of the URI hack in vscode extension.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits

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

llvm-svn: 323660

6 years ago[AccelTable] Try making MSVC happy
Jonas Devlieghere [Mon, 29 Jan 2018 15:23:34 +0000 (15:23 +0000)]
[AccelTable] Try making MSVC happy

MSVC complains that the constexpr "expression did not evaluate to a
constant". Trying to make it happy by adding a `const` specifier as
suggested in https://stackoverflow.com/questions/37574343.

llvm-svn: 323659

6 years ago[clangd] Add a fallback directory for collected symbols with relative paths.
Eric Liu [Mon, 29 Jan 2018 15:13:29 +0000 (15:13 +0000)]
[clangd] Add a fallback directory for collected symbols with relative paths.

Reviewers: hokein, sammccall

Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits

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

llvm-svn: 323658

6 years agotsan: deflake a test
Dmitry Vyukov [Mon, 29 Jan 2018 15:10:22 +0000 (15:10 +0000)]
tsan: deflake a test

There was a failure on a bot:
http://lab.llvm.org:8011/builders/clang-cmake-mipsel/builds/1283

strerror test is indeed flaky. We protect all races by a barrier in other tests
to eliminate flakiness. Do the same here.

No idea why tls_race2.cc failed. Add output at the end of the test
as we do in other tests. Sometimes test process crashes somewhere
in the middle (e.g. during race reporting) and it looks like empty output.
Output at the end of test allows to understand if the process has crashed,
or it has finished but produced no race reports.

Reviewed in https://reviews.llvm.org/D42633

llvm-svn: 323657

6 years ago[AccelTable] Fix undefined reference
Jonas Devlieghere [Mon, 29 Jan 2018 15:07:55 +0000 (15:07 +0000)]
[AccelTable] Fix undefined reference

Fixes the missing reference in AppleAccelTableData by making the method
pure virtual as intended.

llvm-svn: 323656

6 years ago[dsymutil] Generate Apple accelerator tables
Jonas Devlieghere [Mon, 29 Jan 2018 14:52:50 +0000 (14:52 +0000)]
[dsymutil] Generate Apple accelerator tables

This patch adds support for generating accelerator tables in dsymutil.
This feature was already present in our internal repository but not yet
upstreamed because it requires changes to the Apple accelerator table
implementation.

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

llvm-svn: 323655

6 years ago[NFC] Rename DwarfAccelTable and move header.
Jonas Devlieghere [Mon, 29 Jan 2018 14:52:41 +0000 (14:52 +0000)]
[NFC] Rename DwarfAccelTable and move header.

This patch renames DwarfAccelTable.{h,cpp} to AccelTable.{h,cpp} and
moves the header to the include dir so it is accessible by the
dsymutil implementation.

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

llvm-svn: 323654

6 years ago[NFC] Refactor Apple Accelerator Tables
Jonas Devlieghere [Mon, 29 Jan 2018 14:52:34 +0000 (14:52 +0000)]
[NFC] Refactor Apple Accelerator Tables

This patch refactors the way data is stored in the accelerator table and
makes them truly generic. There have been several attempts to do this in
the past:

 - D8215 & D8216: Using a union and partial hardcoding.
 - D11805: Using inheritance.
 - D42246: Using a callback.

In the end I didn't like either of them, because for some reason or
another parts of it felt hacky or decreased runtime performance. I
didn't want to completely rewrite them as I was hoping that we could
reuse parts for the successor in the DWARF standard. However, it seems
less and less likely that there will be a lot of opportunities for
sharing code and/or an interface.

Originally I choose to template the whole class, because it introduces
no performance overhead compared to the original implementation.

We ended up settling on a hybrid between a templated method and a
virtual call to emit the data. The motivation is that we don't want to
increase code size for a feature that should soon be superseded by the
DWARFv5 accelerator tables. While the code will continue to be used for
compatibility, it won't be on the hot path. Furthermore this does not
regress performance compared to Apple's internal implementation that
already uses virtual calls for this.

A quick summary for why these changes are necessary: dsymutil likes to
reuse the current implementation of the Apple accelerator tables.
However, LLDB expects a slightly different interface than what is
currently emitted. Additionally, in dsymutil we only have offsets and no
actual DIEs.

Although the patch suggests a lot of code has changed, this change is
pretty straightforward:

 - We created an abstract class `AppleAccelTableData` to serve as an
   interface for the different data classes.
 - We created two implementations of this class, one for type tables and
   one for everything else. There will be a third one for dsymutil that
   takes just the offset.
 - We use the supplied class to deduct the atoms for the header which
   makes the structure of the table fully self contained, although not
   enforced by the interface as was the case for the fully templated
   approach.
 - We renamed the prefix from DWARF- to Apple- to make space for the
   future implementation of .debug_names.

This change is NFC and relies on the existing tests.

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

llvm-svn: 323653

6 years ago[clangd] Fixed null deference on invalid compile commands.
Ilya Biryukov [Mon, 29 Jan 2018 14:30:28 +0000 (14:30 +0000)]
[clangd] Fixed null deference on invalid compile commands.

Code building the AST expected that construction of CompilerInstance
always succeeds. This is not the case.

llvm-svn: 323652

6 years ago[AMDGPU][MC] Corrected parsing of image opcode modifiers r128 and d16
Dmitry Preobrazhensky [Mon, 29 Jan 2018 14:20:42 +0000 (14:20 +0000)]
[AMDGPU][MC] Corrected parsing of image opcode modifiers r128 and d16

See bugs 36092, 36093:
    https://bugs.llvm.org/show_bug.cgi?id=36092
    https://bugs.llvm.org/show_bug.cgi?id=36093

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

Reviewers: vpykhtin, artem.tamazov, arsenm
llvm-svn: 323651

6 years ago[ELF][MIPS] Rename function to be consistent with other names. NFC
Simon Atanasyan [Mon, 29 Jan 2018 14:00:51 +0000 (14:00 +0000)]
[ELF][MIPS] Rename function to be consistent with other names. NFC

llvm-svn: 323650

6 years ago[OpenMP] Initial implementation of OpenMP offloading library - libomptarget device...
George Rokos [Mon, 29 Jan 2018 13:59:35 +0000 (13:59 +0000)]
[OpenMP] Initial implementation of OpenMP offloading library - libomptarget device RTLs.

This patch implements the device runtime library whose interface is used in the code generation for OpenMP offloading devices.
Currently there is a single device RTL written in CUDA meant to CUDA enabled GPUs.
The interface is a variation of the kmpc interface that includes some extra calls to do thread and storage management that only make sense for a GPU target.

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

llvm-svn: 323649

6 years agoFix windows test failure caused by r323638
Pavel Labath [Mon, 29 Jan 2018 13:53:48 +0000 (13:53 +0000)]
Fix windows test failure caused by r323638

The test was failing because of an incorrect sizeof check in the name
index parsing code. This code was meant to check that we have enough
input to parse the fixed-size part of the dwarf header, which it did by
comparing the input to sizeof(Header). Originally struct Header only
contained the fixed-size part, but during review, we've moved additional
members into it, which rendered the sizeof check invalid.

I resolve this by moving the fixed-size part to a separate struct and
updating the sizeof-expression to use that.

llvm-svn: 323648

6 years ago[Lexer] Support adding working directory to relative search dir for #include shorteni...
Eric Liu [Mon, 29 Jan 2018 13:21:23 +0000 (13:21 +0000)]
[Lexer] Support adding working directory to relative search dir for #include shortening in HeaderSearch.

Reviewers: bkramer

Subscribers: mgorny, hintonda, cfe-commits

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

llvm-svn: 323647

6 years ago[AArch64][AsmParser] NFC: Generalize LogicalImm[Not](32|64) code
Sander de Smalen [Mon, 29 Jan 2018 13:05:38 +0000 (13:05 +0000)]
[AArch64][AsmParser] NFC: Generalize LogicalImm[Not](32|64) code

Summary:
All variants of isLogicalImm[Not](32|64) can be combined into a single templated function, same for printLogicalImm(32|64).
By making it use a template instead, further SVE patches can use it for other data types as well (e.g. 8, 16 bits).

Reviewers: fhahn, rengolin, aadg, echristo, kristof.beyls, samparker

Reviewed By: samparker

Subscribers: aemerson, javed.absar, llvm-commits

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

llvm-svn: 323646

6 years ago[lldb] Silence signed <-> unsigned integer comparison warning
Kirill Bobyrev [Mon, 29 Jan 2018 12:59:07 +0000 (12:59 +0000)]
[lldb] Silence signed <-> unsigned integer comparison warning

`num_args` is unsigned integer, declared as below:

```
uint32_t num_args = arg_enum->getChildCount();
```

Comparison with the signed `arg_idx` produces a warning when compiled with
-Wsign-compare flag, this patch addresses this simple issue without affecting
any functionality.

Reviewers: davide, asmith
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D42620

llvm-svn: 323645

6 years ago[DebugInfo] Fix fragment offset emission order for symbol locations
Mikael Holmen [Mon, 29 Jan 2018 12:37:30 +0000 (12:37 +0000)]
[DebugInfo] Fix fragment offset emission order for symbol locations

Summary:
When emitting the location for a global variable with fragmented debug
expressions, make sure that the offset pieces, which represent
optimized-out parts of the variable, are emitted before their succeeding
fragments' expressions. Previously, if the succeeding fragment's
location was a symbol, the offset piece was emitted after, rather than
before, that symbol's expression. This effectively meant that the symbols
were associated with the wrong parts of the variable.

This fixes PR36085.

Patch by: David Stenberg

Reviewers: aprantl, probinson, dblaikie

Reviewed By: aprantl

Subscribers: JDevlieghere, llvm-commits

Tags: #debug-info

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

llvm-svn: 323644

6 years ago[Sparc] Account for bias in stack readjustment
Jonas Devlieghere [Mon, 29 Jan 2018 12:10:32 +0000 (12:10 +0000)]
[Sparc] Account for bias in stack readjustment

Summary: This was broken long ago in D12208, which failed to account for
the fact that 64-bit SPARC uses a stack bias of 2047, and it is the
*unbiased* value which should be aligned, not the biased one. This was
seen to be an issue with Rust.

Patch by: jrtc27 (James Clarke)

Reviewers: jyknight, venkatra

Reviewed By: jyknight

Subscribers: jacob_hansen, JDevlieghere, fhahn, fedor.sergeev, llvm-commits

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

llvm-svn: 323643

6 years agoFix build broken by r323641
Pavel Labath [Mon, 29 Jan 2018 11:53:46 +0000 (11:53 +0000)]
Fix build broken by r323641

The call to ScopedPrinter::printNumber with size_t argument was
ambiguous (I think) on 32-bit builds. Explicitly cast to a 64-bit int to
avoid this.

llvm-svn: 323642

6 years agoRefactor dwarfdump -apple-names output
Pavel Labath [Mon, 29 Jan 2018 11:33:17 +0000 (11:33 +0000)]
Refactor dwarfdump -apple-names output

Summary:
This modifies the dwarfdump output to align it with the new .debug_names
dump. It also renames two header fields to match similar fields in the
dwarf5 header.

A couple of tests needed to be updated to match new output. The changes
were fairly straight-forward, although not really automatable.

Reviewers: JDevlieghere, aprantl

Subscribers: llvm-commits

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

llvm-svn: 323641

6 years ago[ARM] FP16Pat and FullFP16Pat patterns. NFC.
Sjoerd Meijer [Mon, 29 Jan 2018 11:28:06 +0000 (11:28 +0000)]
[ARM] FP16Pat and FullFP16Pat patterns. NFC.

Create and use FP16Pat FullFP16Pat helper patterns to make the difference
explicit.

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

llvm-svn: 323640

6 years agoFix NetBsd build broken by r323637
Pavel Labath [Mon, 29 Jan 2018 11:10:21 +0000 (11:10 +0000)]
Fix NetBsd build broken by r323637

llvm-svn: 323639

6 years ago[DebugInfo] Basic .debug_names dumping support
Pavel Labath [Mon, 29 Jan 2018 11:08:32 +0000 (11:08 +0000)]
[DebugInfo] Basic .debug_names dumping support

Summary:
This commit renames DWARFAcceleratorTable to AppleAcceleratorTable to free up
the first name as an interface for the different accelerator tables.
Then I add a DWARFDebugNames class for the dwarf5 table.

Presently, the only common functionality of the two classes is the dump()
method, because this is the only method that was necessary to implement
dwarfdump -debug-names; and because the rest of the
AppleAcceleratorTable interface does not directly transfer to the dwarf5
tables (the main reason for that is that the present interface assumes
the tables are homogeneous, but the dwarf5 tables can have different
keys associated with each entry).

I expect to make the common interface richer as I add more functionality
to the new class (and invent a way to represent it in generic way).

In terms of sharing the implementation, I found the format of the two
tables sufficiently different to frustrate any attempts to have common
parsing or dumping code, so presently the implementations share just low
level code for formatting dwarf constants.

Reviewers: vleschuk, JDevlieghere, clayborg, aprantl, probinson, echristo, dblaikie

Subscribers: llvm-commits

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

llvm-svn: 323638

6 years agoRemove ObjectFile usage from HostLinux::GetProcessInfo
Pavel Labath [Mon, 29 Jan 2018 10:46:00 +0000 (10:46 +0000)]
Remove ObjectFile usage from HostLinux::GetProcessInfo

Summary:
The ObjectFile class was used to determine the architecture of a running
process by inspecting it's main executable. There were two issues with
this:
- it's in the wrong layer
- the call can be very expensive (it can end up computing the crc of the
  whole file).

Since the process is running on the host, ideally we would be able to
just query the data straight from the OS like darwin does, but there
doesn't seem to be a reasonable way to do that. So, this fixes the
layering issue by using the llvm object library to inspect the file.
Since we know the process is already running on the host, we just need
to peek at a few bytes of the elf header to determine whether it's 32-
or 64-bit (which should make this faster as well).

Pretty much the same logic was implemented in
NativeProcessProtocol::ResolveProcessArchitecture, so I delete this
logic and replace calls with GetProcessInfo.

Reviewers: eugene, krytarowski

Subscribers: mgorny, hintonda, lldb-commits

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

llvm-svn: 323637

6 years ago[lldb] Generic base for testing gdb-remote behavior
Pavel Labath [Mon, 29 Jan 2018 10:02:40 +0000 (10:02 +0000)]
[lldb] Generic base for testing gdb-remote behavior

Summary:
Adds new utilities that make it easier to write test cases for lldb acting as a client over a gdb-remote connection.

- A GDBRemoteTestBase class that starts a mock GDB server and provides an easy way to check client packets
- A MockGDBServer that, via MockGDBServerResponder, can be made to issue server responses that test client behavior.
- Utility functions for handling common data encoding/decoding
- Utility functions for creating dummy targets from YAML files

----

Split from the review at https://reviews.llvm.org/D42145, which was a new feature that necessitated the new testing capabilities.

Reviewers: clayborg, labath

Reviewed By: clayborg, labath

Subscribers: hintonda, davide, jingham, krytarowski, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D42195
Patch by Owen Shaw <llvm@owenpshaw.net>

llvm-svn: 323636

6 years ago[X86FixupBWInsts] Fix miscompilation if sibling sub-register is live.
Andrei Elovikov [Mon, 29 Jan 2018 09:26:04 +0000 (09:26 +0000)]
[X86FixupBWInsts] Fix miscompilation if sibling sub-register is live.

Summary: The issues was found during D40524.

Reviewers: andrew.w.kaylor, craig.topper, MatzeB

Reviewed By: andrew.w.kaylor

Subscribers: aivchenk, llvm-commits

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

llvm-svn: 323635

6 years ago[AArch64] Generate the CASP instruction for 128-bit cmpxchg
Oliver Stannard [Mon, 29 Jan 2018 09:18:37 +0000 (09:18 +0000)]
[AArch64] Generate the CASP instruction for 128-bit cmpxchg

The Large System Extension added an atomic compare-and-swap instruction
that operates on a pair of 64-bit registers, which we can use to
implement a 128-bit cmpxchg.

Because i128 is not a legal type for AArch64 we have to do all of the
instruction selection in C++, and the instruction requires even/odd
register pairs, so we have to wrap it in REG_SEQUENCE and EXTRACT_SUBREG
nodes. This is very similar to what we do for 64-bit cmpxchg in the ARM
backend.

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

llvm-svn: 323634

6 years ago[ThinLTO] - Stop internalizing and drop non-prevailing symbols.
George Rimar [Mon, 29 Jan 2018 08:03:30 +0000 (08:03 +0000)]
[ThinLTO] - Stop internalizing and drop non-prevailing symbols.

Implementation marks non-prevailing symbols as not live in the summary.
Then them are dropped in backends.

Fixes https://bugs.llvm.org/show_bug.cgi?id=35938

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

llvm-svn: 323633

6 years ago[X86] Make foldLogicOfSetCCs work better for vectors pre legal types/operations
Craig Topper [Mon, 29 Jan 2018 07:52:55 +0000 (07:52 +0000)]
[X86] Make foldLogicOfSetCCs work better for vectors pre legal types/operations

Summary:
There's a check in the code to only check getSetCCResultType after LegalOperations or if the type is MVT::i1. But the i1 check is only allowing scalar types through. I think it should check that the scalar type is MVT::i1 so that it will work for vectors.

The changed test already does this combine with AVX512VL where getSetCCResultType returns vXi1. But with avx512f and no VLX getSetCCResultType returns a type matching the width of the input type.

Reviewers: spatel, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 323631

6 years ago[CVP] Don't Replace incoming values from unreachable blocks with undef.
Davide Italiano [Mon, 29 Jan 2018 05:59:55 +0000 (05:59 +0000)]
[CVP] Don't Replace incoming values from unreachable blocks with undef.

This pretty much reverts r322006, except that we keep the test,
because we work around the issue exposed in a different way (a
recursion limit in value tracking). There's still probably some
sequence that exposes this problem, and the proper way to fix that
for somebody who has time is outlined in the code review.

llvm-svn: 323630

6 years agoRevert: [compiler-rt] r323626 - [cmake] [compiler-rt] Remove duplicate CMAKE_CXX_FLAGS.
Don Hinton [Mon, 29 Jan 2018 05:32:21 +0000 (05:32 +0000)]
Revert: [compiler-rt] r323626 - [cmake] [compiler-rt] Remove duplicate CMAKE_CXX_FLAGS.

Looks like it broke a bot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/7195
Reverting until I have a chance to investigate.

llvm-svn: 323629

6 years ago[NFC] fix trivial typos in comments and documents
Hiroshi Inoue [Mon, 29 Jan 2018 05:17:03 +0000 (05:17 +0000)]
[NFC] fix trivial typos in comments and documents

"to to" -> "to"

llvm-svn: 323628

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Mon, 29 Jan 2018 05:15:18 +0000 (05:15 +0000)]
[NFC] fix trivial typos in comments

"to to" -> "to"

llvm-svn: 323627

6 years ago[cmake] [compiler-rt] Remove duplicate CMAKE_CXX_FLAGS.
Don Hinton [Mon, 29 Jan 2018 05:07:20 +0000 (05:07 +0000)]
[cmake] [compiler-rt] Remove duplicate CMAKE_CXX_FLAGS.

`set_target_compile_flags()` ultimately sets COMPILE_FLAGS which is
added to CMAKE_CXX_FLAGS in the compile rule, so passing
CMAKE_CXX_FLAGS causes them to be duplicated.

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

llvm-svn: 323626

6 years agoPut the header in the first PT_LOAD even if that PT_LOAD has a LMAExpr.
Rafael Espindola [Mon, 29 Jan 2018 03:44:44 +0000 (03:44 +0000)]
Put the header in the first PT_LOAD even if that PT_LOAD has a LMAExpr.

This should fix PR36017.

The root problem is that we were creating a PT_LOAD just for the
header. That was technically valid, but inconvenient: we should not be
making the ELF discontinuous.

The solution is to allow a section with LMAExpr to be added to a
PT_LOAD if that PT_LOAD doesn't already have a LMAExpr.

llvm-svn: 323625

6 years ago[WebAssembly] Sort options in `Options.td`. NFC.
Sam Clegg [Sun, 28 Jan 2018 19:57:04 +0000 (19:57 +0000)]
[WebAssembly] Sort options in `Options.td`. NFC.

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

llvm-svn: 323624

6 years ago[WebAssembly] Add getName and getFileName methods to InputChunk base class. NFC.
Sam Clegg [Sun, 28 Jan 2018 19:57:03 +0000 (19:57 +0000)]
[WebAssembly] Add getName and getFileName methods to InputChunk base class. NFC.

Summary: These are useful to upcoming addition of --gc-sections support.

Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

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

llvm-svn: 323623

6 years agoclang format
Sam Clegg [Sun, 28 Jan 2018 19:57:02 +0000 (19:57 +0000)]
clang format

llvm-svn: 323622

6 years ago[WebAssemly] Associate symbol with InputChunk in which they are defined. NFC.
Sam Clegg [Sun, 28 Jan 2018 19:57:01 +0000 (19:57 +0000)]
[WebAssemly] Associate symbol with InputChunk in which they are defined. NFC.

Summary:
Rather than explicit Function or InputSegment points store a
pointer to the base class (InputChunk) and use llvm dynamic
casts when we need a subtype.

This change is useful for add the upcoming gc-section support
wants to deal with all input chunks.

Subscribers: aheejin, llvm-commits

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

llvm-svn: 323621

6 years ago[WebAssembly] Remove unneeded include. NFC.
Sam Clegg [Sun, 28 Jan 2018 19:33:00 +0000 (19:33 +0000)]
[WebAssembly] Remove unneeded include. NFC.

llvm-svn: 323620

6 years ago[InlineCost] Mark functions accessing varargs as not viable.
Florian Hahn [Sun, 28 Jan 2018 19:11:49 +0000 (19:11 +0000)]
[InlineCost] Mark functions accessing varargs as not viable.

This prevents functions accessing varargs from being inlined if they
have the alwaysinline attribute.

Reviewers: efriedma, rnk, davide

Reviewed By: efriedma

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

llvm-svn: 323619

6 years agoChange memcpy/memove/memset to have dest and source alignment attributes.
Daniel Neilson [Sun, 28 Jan 2018 18:13:57 +0000 (18:13 +0000)]
Change memcpy/memove/memset to have dest and source alignment attributes.

Summary:
  This change is step four in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. Steps:

Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API.
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead.
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

Reviewers: jdoerfert, grosser, bollu

Subscribers: llvm-commits

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

llvm-svn: 323618

6 years agoChange memcpy/memove/memset to have dest and source alignment attributes.
Daniel Neilson [Sun, 28 Jan 2018 17:27:45 +0000 (17:27 +0000)]
Change memcpy/memove/memset to have dest and source alignment attributes.

Summary:
  This change is step three in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. Steps:

Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API.
Step 4) Update Polly to use the new IRBuilder API.
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use getDestAlignment()
and getSourceAlignment() instead.
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

Reviewers: rjmccall

Subscribers: jyknight, nemanjai, nhaehnle, javed.absar, sbc100, aheejin, kbarton, fedor.sergeev, cfe-commits

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

llvm-svn: 323617

6 years ago[Support] Move DJB hash to support. NFC
Jonas Devlieghere [Sun, 28 Jan 2018 11:05:10 +0000 (11:05 +0000)]
[Support] Move DJB hash to support. NFC

This patch moves the DJB hash to support. This is consistent with other
hashing algorithms living there. The hash is used by the DWARF
accelerator tables. We're doing this now because the hashing function is
needed by dsymutil and we don't want to link against libBinaryFormat.

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

llvm-svn: 323616

6 years ago[git-clang-format] Process CUDA files
Jonas Hahnfeld [Sun, 28 Jan 2018 10:11:25 +0000 (10:11 +0000)]
[git-clang-format] Process CUDA files

Clang supports compiling CUDA source files for some time,
format them by default as well.

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

llvm-svn: 323615

6 years ago[X86] Fix a crash that can occur in combineExtractVectorElt due to not checking the...
Craig Topper [Sun, 28 Jan 2018 07:29:35 +0000 (07:29 +0000)]
[X86] Fix a crash that can occur in combineExtractVectorElt due to not checking the width of a ConstantSDNode before calling getConstantOperandVal.

llvm-svn: 323614

6 years ago[xray] Don't try to run XRay unit tests on Darwin
Kuba Mracek [Sun, 28 Jan 2018 03:11:25 +0000 (03:11 +0000)]
[xray] Don't try to run XRay unit tests on Darwin

This gets rid of a lit warning (input './projects/compiler-rt/test/xray/Unit' contained no tests).

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

llvm-svn: 323613

6 years ago[X86] Remove VPTESTM/VPTESTNM ISD opcodes. Use isel patterns matching cmpm eq/ne...
Craig Topper [Sun, 28 Jan 2018 00:56:30 +0000 (00:56 +0000)]
[X86] Remove VPTESTM/VPTESTNM ISD opcodes. Use isel patterns matching cmpm eq/ne with immallzeros.

llvm-svn: 323612

6 years ago[sanitizer] Update from zx_time_get to zx_clock_get
Petr Hosek [Sat, 27 Jan 2018 23:58:23 +0000 (23:58 +0000)]
[sanitizer] Update from zx_time_get to zx_clock_get

This Zircon syscall was renamed.

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

llvm-svn: 323611

6 years ago[X86] Add patterns for using masked vptestnmd for 256-bit vectors without VLX.
Craig Topper [Sat, 27 Jan 2018 23:49:14 +0000 (23:49 +0000)]
[X86] Add patterns for using masked vptestnmd for 256-bit vectors without VLX.

We can widen the mask and extract it back down.

llvm-svn: 323610

6 years ago[X86] Add test to demonstrate missed opportunity to merge kand into testnm when using...
Craig Topper [Sat, 27 Jan 2018 23:49:11 +0000 (23:49 +0000)]
[X86] Add test to demonstrate missed opportunity to merge kand into testnm when using 512-bit instruction due to lack of VLX.

llvm-svn: 323609

6 years agoAdd triples or specify REQUIRES: default_triple to some tests
Justin Bogner [Sat, 27 Jan 2018 23:31:09 +0000 (23:31 +0000)]
Add triples or specify REQUIRES: default_triple to some tests

These were all failing when building the X86 backend but specifying
LLVM_DEFAULT_TARGET_TRIPLE=''.

llvm-svn: 323608

6 years ago[X86][AVX512] Add avx512dq fp2int/int2fp tests (PR31630)
Simon Pilgrim [Sat, 27 Jan 2018 22:08:27 +0000 (22:08 +0000)]
[X86][AVX512] Add avx512dq fp2int/int2fp tests (PR31630)

llvm-svn: 323607

6 years ago[cmake] [compiler-rt] Call llvm_setup_rpath() when adding shared libraries.
Don Hinton [Sat, 27 Jan 2018 21:14:17 +0000 (21:14 +0000)]
[cmake] [compiler-rt] Call llvm_setup_rpath() when adding shared libraries.

Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.

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

llvm-svn: 323606

6 years ago[X86] Use vptestm/vptestnm for comparisons with zero to avoid creating a zero vector.
Craig Topper [Sat, 27 Jan 2018 20:19:09 +0000 (20:19 +0000)]
[X86] Use vptestm/vptestnm for comparisons with zero to avoid creating a zero vector.

We can use the same input for both operands to get a free compare with zero.

We already use this trick in a couple places where we explicitly create PTESTM with the same input twice. This generalizes it.

I'm hoping to remove the ISD opcodes and move this to isel patterns like we do for scalar cmp/test.

llvm-svn: 323605

6 years ago[X86] Remove X86ISD::PCMPGTM/PCMPEQM and instead just use X86ISD::PCMPM and pattern...
Craig Topper [Sat, 27 Jan 2018 20:19:02 +0000 (20:19 +0000)]
[X86] Remove X86ISD::PCMPGTM/PCMPEQM and instead just use X86ISD::PCMPM and pattern match the immediate value during isel.

Legalization is still biased to turn LT compares in to GT by swapping operands to avoid needing extra isel patterns to commute.

I'm hoping to remove TESTM/TESTNM next and this should simplify that by making EQ/NE more similar.

llvm-svn: 323604

6 years agoRegenerate test. NFCI
Simon Pilgrim [Sat, 27 Jan 2018 19:49:46 +0000 (19:49 +0000)]
Regenerate test. NFCI

llvm-svn: 323603

6 years ago[X86][SSE] Simplify demanded elements from BROADCAST shuffle source.
Simon Pilgrim [Sat, 27 Jan 2018 19:48:13 +0000 (19:48 +0000)]
[X86][SSE] Simplify demanded elements from BROADCAST shuffle source.

If broadcasting from another shuffle, attempt to simplify it.

We can probably generalize this a lot more (embedding in combineX86ShufflesRecursively), but BROADCAST is one of the more troublesome as it accepts inputs of different sizes to the result.

llvm-svn: 323602

6 years ago[cmake] [libunwind] LLVM_FOUND isn't always set, so just test if
Don Hinton [Sat, 27 Jan 2018 19:31:44 +0000 (19:31 +0000)]
[cmake] [libunwind] LLVM_FOUND isn't always set, so just test if
llvm_setup_rpath() is available instead.

llvm-svn: 323601

6 years ago[cmake] [libcxxabi] LLVM_FOUND isn't always set, so just test if
Don Hinton [Sat, 27 Jan 2018 19:18:04 +0000 (19:18 +0000)]
[cmake] [libcxxabi] LLVM_FOUND isn't always set, so just test if
llvm_setup_rpath() is available instead.

llvm-svn: 323600

6 years agoLLVM_FOUND isn't always set, so just test if llvm_setup_rpath() is
Don Hinton [Sat, 27 Jan 2018 18:55:30 +0000 (18:55 +0000)]
LLVM_FOUND isn't always set, so just test if llvm_setup_rpath() is
available instead.

llvm-svn: 323599

6 years ago[COFF] Update comment to reflect link.exe behavior. NFC
Shoaib Meenai [Sat, 27 Jan 2018 18:17:08 +0000 (18:17 +0000)]
[COFF] Update comment to reflect link.exe behavior. NFC

In my experimentation with link.exe from both VS 2015 and 2017, it
always produces images with truncated section names. Update the comment
accordingly.

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

llvm-svn: 323598

6 years agoAdd IRBuilder API to create memcpy/memmove calls with differing source and dest align...
Daniel Neilson [Sat, 27 Jan 2018 17:59:10 +0000 (17:59 +0000)]
Add IRBuilder API to create memcpy/memmove calls with differing source and dest alignments

Summary:
  This change is step two in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. Steps:

Step 1) Remove alignment parameter and create alignment parameter attributes for
   memcpy/memmove/memset. ( rL322965 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
   source and dest alignments.
Step 3) Update Clang to use the new IRBuilder API.
Step 4) Update Polly to use the new IRBuilder API.
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
        and those that use use MemIntrinsicInst::[get|set]Alignment() to use
        getDestAlignment() and getSourceAlignment() instead.
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
        MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

llvm-svn: 323597

6 years agoRegenerate test result for vastart-defs-eflags.ll. NFC.
Amaury Sechet [Sat, 27 Jan 2018 17:52:32 +0000 (17:52 +0000)]
Regenerate test result for vastart-defs-eflags.ll. NFC.

llvm-svn: 323596

6 years agoRegenerate test result for testb-je-fusion.ll. NFC.
Amaury Sechet [Sat, 27 Jan 2018 17:19:16 +0000 (17:19 +0000)]
Regenerate test result for testb-je-fusion.ll. NFC.

llvm-svn: 323595

6 years agoRegenerate test result for stateppint-vector.ll. NFC.
Amaury Sechet [Sat, 27 Jan 2018 17:16:26 +0000 (17:16 +0000)]
Regenerate test result for stateppint-vector.ll. NFC.

llvm-svn: 323594

6 years agoRegenrate brcond.ll test results. NFC
Amaury Sechet [Sat, 27 Jan 2018 16:57:15 +0000 (16:57 +0000)]
Regenrate brcond.ll test results. NFC

llvm-svn: 323593

6 years agoRegenrate test results for avx-brcond.ll . NFC
Amaury Sechet [Sat, 27 Jan 2018 16:44:00 +0000 (16:44 +0000)]
Regenrate test results for avx-brcond.ll . NFC

llvm-svn: 323592

6 years ago[X86][SSE] Regenerate fp2int/int2fp tests
Simon Pilgrim [Sat, 27 Jan 2018 16:39:12 +0000 (16:39 +0000)]
[X86][SSE] Regenerate fp2int/int2fp tests

Cleanup check prefixes and check full codegen

llvm-svn: 323591

6 years agoAttempt to make the PS4 build bot happy.
Gabor Horvath [Sat, 27 Jan 2018 16:38:56 +0000 (16:38 +0000)]
Attempt to make the PS4 build bot happy.

llvm-svn: 323590

6 years ago[ASTImporter] Add support to import some AST nodes:
Gabor Horvath [Sat, 27 Jan 2018 16:11:45 +0000 (16:11 +0000)]
[ASTImporter] Add support to import some AST nodes:

* CXXOperatorCallExpr
* SizeOfPackExpr
* DependentTemplateSpecializationType
* DependentSizedArray
* CXXTypeidExpr
* Fix importing CXXTemporaryObjectExpr

Some of the changes are based on
https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/AST/ASTImporter.cpp

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

llvm-svn: 323589

6 years agoRegenerate test results for and-su.ll . NFC
Amaury Sechet [Sat, 27 Jan 2018 16:00:10 +0000 (16:00 +0000)]
Regenerate test results for and-su.ll . NFC

llvm-svn: 323588

6 years ago[X86][SSE] Add broadcast from v2i32 memory tests (PR34394)
Simon Pilgrim [Sat, 27 Jan 2018 15:54:57 +0000 (15:54 +0000)]
[X86][SSE] Add broadcast from v2i32 memory tests (PR34394)

llvm-svn: 323587

6 years agoRemove unused class declarations
Jan Kratochvil [Sat, 27 Jan 2018 14:35:33 +0000 (14:35 +0000)]
Remove unused class declarations

Simplification by removing excessive DWARFCompileUnit references for D40466 .

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

llvm-svn: 323586

6 years ago[TargetLowering] Teach TargetLowering::SimplifySetCC to simplify setcc of vXi1 vector...
Craig Topper [Sat, 27 Jan 2018 09:10:58 +0000 (09:10 +0000)]
[TargetLowering] Teach TargetLowering::SimplifySetCC to simplify setcc of vXi1 vectors into logic ops.

This transform was already being done for setcc of scalar i1. This extends it to vectors.

llvm-svn: 323585

6 years ago[ELF] - Extend lto/asmundef.ll testcase.
George Rimar [Sat, 27 Jan 2018 09:04:47 +0000 (09:04 +0000)]
[ELF] - Extend lto/asmundef.ll testcase.

Patch adds one more module with non-prevailing
version of asm symbol, defined in main module

This is for D42107, which is under review.
Extended version of testcase would fail with the
diff 9 version of patch posted.

llvm-svn: 323584

6 years ago[SelectionDAG] Make DAGTypeLegalizer::PromoteSetCCOperands handle SETEQ/SETNE correct...
Craig Topper [Sat, 27 Jan 2018 08:41:03 +0000 (08:41 +0000)]
[SelectionDAG] Make DAGTypeLegalizer::PromoteSetCCOperands handle SETEQ/SETNE correctly for vector types.

The code was using getValueSizeInBits and combining with the result of a call to DAG.ComputeNumSignBits. But for vector types getValueSizeInBits returns the width of the full vector while ComputeNumSignBits is going to give a number no larger than the width of a single element. So we should be using getScalarValueSizeInBits to get the element width.

llvm-svn: 323583

6 years ago[GlobalISel][Legalizer] Convert the FP constants to the right APFloat type for G_FCON...
Amara Emerson [Sat, 27 Jan 2018 07:07:20 +0000 (07:07 +0000)]
[GlobalISel][Legalizer] Convert the FP constants to the right APFloat type for G_FCONSTANT.

We weren't converting the immediate ConstantFP during legalization, which caused
the wrong bit patterns to be emitted for half type FP constants.

Fixes PR36106.

llvm-svn: 323582

6 years agoRevert "[SLP] Fix for PR32086: Count InsertElementInstr of the same elements as shuffle."
Alexey Bataev [Sat, 27 Jan 2018 02:42:21 +0000 (02:42 +0000)]
Revert "[SLP] Fix for PR32086: Count InsertElementInstr of the same elements as shuffle."

This reverts commit r323530 to fix possible problems in users code.

llvm-svn: 323581

6 years agoRevert "[SLP] Removed the warning about unused variable, NFC."
Alexey Bataev [Sat, 27 Jan 2018 02:42:17 +0000 (02:42 +0000)]
Revert "[SLP] Removed the warning about unused variable, NFC."

This reverts commit r323533 to fix possible problems in users code.

llvm-svn: 323580

6 years agoAdd the /order option.
Rui Ueyama [Sat, 27 Jan 2018 00:34:46 +0000 (00:34 +0000)]
Add the /order option.

With the /order option, you can give an order file. An order file
contains symbol names, one per line, and the linker places comdat
sections in that given order. The option is used often to optimize
an output binary for (in particular, startup) speed by improving
locality.

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

llvm-svn: 323579

6 years ago[CodeGen] Use the non-virtual alignment when emitting the base
Akira Hatanaka [Sat, 27 Jan 2018 00:34:09 +0000 (00:34 +0000)]
[CodeGen] Use the non-virtual alignment when emitting the base
constructor.

Previously, clang would emit an over-aligned (16-byte) store to
initialize B::x in B's base constructor when compiling the following
code:

struct A {
  __attribute__((aligned(16))) double data1;
};

struct B : public virtual A {
  B() : x(123) {}
  double a;
  int x;
};

struct C : public virtual B {};

void test() { B b; C c; }

This was happening because the code in IRGen that does member
initialization was using the alignment of a complete object instead of
the non-virtual alignment.

This commit fixes the bug.

rdar://problem/36382481

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

llvm-svn: 323578

6 years agoAlways allow "#pragma region".
Matt Davis [Sat, 27 Jan 2018 00:25:29 +0000 (00:25 +0000)]
Always allow "#pragma region".

Summary:
Both MS and PS4 targets are capable of recognizing the
existence of:  #pragma region, #pragma endregion.

Since this pragma is only a hint for certain editors, and has no logic,
it seems helpful to permit this pragma in all cases, not just MS compatibility mode.

Reviewers: rnk, rsmith, majnemer

Reviewed By: majnemer

Subscribers: Quuxplusone, probinson, majnemer, cfe-commits

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

llvm-svn: 323577