platform/upstream/llvm.git
6 years agoRestrict a test using named file descriptors to using the system shell
David Blaikie [Tue, 3 Apr 2018 18:22:14 +0000 (18:22 +0000)]
Restrict a test using named file descriptors to using the system shell

llvm-svn: 329097

6 years agoDisable a test using environment variables that requires a real shell
David Blaikie [Tue, 3 Apr 2018 18:19:52 +0000 (18:19 +0000)]
Disable a test using environment variables that requires a real shell

llvm-svn: 329096

6 years ago[CodeGen]Add NoVRegs property on PostRASink and ShrinkWrap
Jun Bum Lim [Tue, 3 Apr 2018 18:17:34 +0000 (18:17 +0000)]
[CodeGen]Add NoVRegs property on PostRASink and ShrinkWrap

Summary:
This change declare that PostRAMachineSinking and ShrinkWrap require NoVRegs
property, so now the MachineFunctionPass can enforce this check.
These passes are disabled in NVPTX & WebAssembly.

Reviewers: dschuff, jlebar, tra, jgravelle-google, MatzeB, sebpop, thegameg, mcrosier

Reviewed By: dschuff, thegameg

Subscribers: jholewinski, jfb, sbc100, aheejin, sunfish, llvm-commits

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

llvm-svn: 329095

6 years ago[sanitizer] Remove empty Symbolizer PrepareForSandboxing
Kostya Kortchinsky [Tue, 3 Apr 2018 18:07:22 +0000 (18:07 +0000)]
[sanitizer] Remove empty Symbolizer PrepareForSandboxing

Summary:
`Symbolizer::PrepareForSandboxing` is empty for all platforms and apparently
has been for a while (D10213). Remove it, and shuffle things around so that the
platform specific code is now in `PlatformPrepareForSandboxing`.

This allows to have one less symbolizer dependency in a common file, which
helps for the upcoming split.

Also remove `SymbolizerPrepareForSandboxing` in tsan_go which appears to not
be used anywhere.

Reviewers: alekseyshl, eugenis, dvyukov, mcgrathr

Reviewed By: alekseyshl

Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers

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

llvm-svn: 329094

6 years ago[dsymutil] Apply recursion workaround for threading
Jonas Devlieghere [Tue, 3 Apr 2018 18:01:18 +0000 (18:01 +0000)]
[dsymutil] Apply recursion workaround for threading

The DwarfLinker can have some very deep recursion that can max out the
(significantly smaller) stack when using threads. We don't want this
limitation when we only have a single thread. We already have this
workaround for the architecture-related threading. This patch applies
the same workaround to the parallel analysis and cloning.

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

llvm-svn: 329093

6 years agoMake fetchIfLazy only fetch an object file. NFC.
Rui Ueyama [Tue, 3 Apr 2018 18:01:18 +0000 (18:01 +0000)]
Make fetchIfLazy only fetch an object file. NFC.

Previously, fetchIfLazy did more than the name says. Now, setting
to UsedInRegularObj is moved to another function.

llvm-svn: 329092

6 years ago[SLP] Fixed formatting, NFC.
Alexey Bataev [Tue, 3 Apr 2018 17:48:14 +0000 (17:48 +0000)]
[SLP] Fixed formatting, NFC.

llvm-svn: 329091

6 years ago[clangd] synthesize fix message when the diagnostic doesn't provide one.
Sam McCall [Tue, 3 Apr 2018 17:35:57 +0000 (17:35 +0000)]
[clangd] synthesize fix message when the diagnostic doesn't provide one.

Summary:
Currently if a fix is attached directly to a diagnostic, we repeat the
diagnostic message as the fix message. From eyeballing the top diagnostics,
it seems describing the textual replacement would be much clearer.

e.g.
error: use of undeclared identifier 'goo'; did you mean 'foo'?
action before: use of undeclared identifier 'goo'; did you mean 'foo'?
action after: change 'goo' to 'foo'

Reviewers: ilya-biryukov

Subscribers: klimek, jkorous-apple, ioeric, MaskRay, cfe-commits

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

llvm-svn: 329090

6 years ago[DEBUGINFO] Add option that allows to disable emission of flags in .loc directives.
Alexey Bataev [Tue, 3 Apr 2018 17:28:55 +0000 (17:28 +0000)]
[DEBUGINFO] Add option that allows to disable emission of flags in .loc directives.

Summary:
Some targets do not support extended format of .loc directive and
support only simple format: .loc <FileID> <Line> <Column>. Patch adds
MCAsmInfo flag and option that allows emit .loc directive without
additional flags.

Reviewers: echristo

Subscribers: llvm-commits

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

llvm-svn: 329089

6 years ago[lld] fix data race in ELF/ICF.cpp
Bob Haarman [Tue, 3 Apr 2018 17:27:39 +0000 (17:27 +0000)]
[lld] fix data race in ELF/ICF.cpp

Summary:
r328610 fixed a data race in the COFF linker. This change makes a
similar fix to the ELF linker.

Reviewers: ruiu, pcc, rnk

Reviewed By: ruiu

Subscribers: emaste, llvm-commits, arichardson

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

llvm-svn: 329088

6 years ago[InstCombine] Fold compare of int constant against a splatted vector of ints
Daniel Neilson [Tue, 3 Apr 2018 17:26:20 +0000 (17:26 +0000)]
[InstCombine] Fold compare of int constant against a splatted vector of ints

Summary:
Folding patterns like:
  %vec = shufflevector <4 x i8> %insvec, <4 x i8> undef, <4 x i32> zeroinitializer
  %cast = bitcast <4 x i8> %vec to i32
  %cond = icmp eq i32 %cast, 0
into:
  %ext = extractelement <4 x i8> %insvec, i32 0
  %cond = icmp eq i32 %ext, 0

Combined with existing rules, this allows us to fold patterns like:
  %insvec = insertelement <4 x i8> undef, i8 %val, i32 0
  %vec = shufflevector <4 x i8> %insvec, <4 x i8> undef, <4 x i32> zeroinitializer
  %cast = bitcast <4 x i8> %vec to i32
  %cond = icmp eq i32 %cast, 0
into:
  %cond = icmp eq i8 %val, 0

When we construct a splat vector via a shuffle, and bitcast the vector into an integer type for comparison against an integer constant. Then we can simplify the the comparison to compare the splatted value against the integer constant.

Reviewers: spatel, anna, mkazantsev

Reviewed By: spatel

Subscribers: efriedma, rengolin, llvm-commits

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

llvm-svn: 329087

6 years ago[ELF] - Eliminate Lazy class.
George Rimar [Tue, 3 Apr 2018 17:16:52 +0000 (17:16 +0000)]
[ELF] - Eliminate Lazy class.

Patch removes Lazy class which
is just an excessive layer.

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

llvm-svn: 329086

6 years ago[SLP] Fix PR36481: vectorize reassociated instructions.
Alexey Bataev [Tue, 3 Apr 2018 17:14:47 +0000 (17:14 +0000)]
[SLP] Fix PR36481: vectorize reassociated instructions.

Summary:
If the load/extractelement/extractvalue instructions are not originally
consecutive, the SLP vectorizer is unable to vectorize them. Patch
allows reordering of such instructions.

Patch does not support reordering of the repeated instruction, this must
be handled in the separate patch.

Reviewers: RKSimon, spatel, hfinkel, mkuper, Ayal, ashahid

Subscribers: llvm-commits

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

llvm-svn: 329085

6 years agoRemove a stale comment cut and pasted from another file.
Eric Christopher [Tue, 3 Apr 2018 17:07:05 +0000 (17:07 +0000)]
Remove a stale comment cut and pasted from another file.

llvm-svn: 329084

6 years ago[llvm-mca] Move the logic that prints register file statistics to its own view. NFCI
Andrea Di Biagio [Tue, 3 Apr 2018 16:46:23 +0000 (16:46 +0000)]
[llvm-mca] Move the logic that prints register file statistics to its own view. NFCI

Before this patch, the "BackendStatistics" view was responsible for printing the
register file usage (as well as many other statistics).

Now users can enable register file usage statistics using the command line flag
`-register-file-stats`. By default, the tool doesn't print register file
statistics.

llvm-svn: 329083

6 years agoRecommit "[SLP] Fix issues with debug output in the SLP vectorizer."
Alexey Bataev [Tue, 3 Apr 2018 16:40:33 +0000 (16:40 +0000)]
Recommit "[SLP] Fix issues with debug output in the SLP vectorizer."

The primary issue here is that using NDEBUG alone isn't enough to guard
debug printing -- instead the DEBUG() macro needs to be used so that the
specific pass debug logging check is employed. Without this, every
asserts-enabled build was printing out information when it hit this.

I also fixed another place where we had multiple statements in a DEBUG
macro to use {}s to be a bit cleaner. And I fixed a place that used
errs() rather than dbgs().

llvm-svn: 329082

6 years ago[LoopInterchange] Update tests so DA can handle access after D35430.
Florian Hahn [Tue, 3 Apr 2018 16:37:58 +0000 (16:37 +0000)]
[LoopInterchange] Update tests so DA can handle access after D35430.

I have taken the opportunity to simplify some tests slightly and move
parts around.

It also brings back a few IR checks for interchangable loops.

Reviewers: karthikthecool, sebpop, grosser

Reviewed By: sebpop

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

llvm-svn: 329081

6 years ago[SLP] Added tests for checks of reordering of the repeated instructions,
Alexey Bataev [Tue, 3 Apr 2018 16:31:26 +0000 (16:31 +0000)]
[SLP] Added tests for checks of reordering of the repeated instructions,
NFC.

llvm-svn: 329080

6 years ago[Hexagon] Remove -mhvx-double and the corresponding subtarget feature
Krzysztof Parzyszek [Tue, 3 Apr 2018 16:06:36 +0000 (16:06 +0000)]
[Hexagon] Remove -mhvx-double and the corresponding subtarget feature

Specifying the HVX vector length should be done via the -mhvx-length
option.

llvm-svn: 329079

6 years ago[Hexagon] Remove unneeded attributes from lit test
Krzysztof Parzyszek [Tue, 3 Apr 2018 16:05:20 +0000 (16:05 +0000)]
[Hexagon] Remove unneeded attributes from lit test

llvm-svn: 329078

6 years ago[Hexagon] Remove -mhvx-double and the corresponding subtarget feature
Krzysztof Parzyszek [Tue, 3 Apr 2018 15:59:10 +0000 (15:59 +0000)]
[Hexagon] Remove -mhvx-double and the corresponding subtarget feature

Specifying the HVX vector length should be done via the -mhvx-length
option.

llvm-svn: 329077

6 years agoAdding optional Name parameter to createVirtualRegister and createGenericVirtualRegister.
Puyan Lotfi [Tue, 3 Apr 2018 15:53:49 +0000 (15:53 +0000)]
Adding optional Name parameter to createVirtualRegister and createGenericVirtualRegister.

llvm-svn: 329076

6 years agoImplement P0754R2: The <version> header.
Marshall Clow [Tue, 3 Apr 2018 15:48:24 +0000 (15:48 +0000)]
Implement P0754R2: The <version> header.

llvm-svn: 329075

6 years ago[llvm-mca] Remove redundant include from BackendStatistics.h. NFC
Andrea Di Biagio [Tue, 3 Apr 2018 15:36:15 +0000 (15:36 +0000)]
[llvm-mca] Remove redundant include from BackendStatistics.h. NFC

Also use llvm::DenseMap for Histograms (instead of std::map).

llvm-svn: 329074

6 years ago[clang-tidy] Check for sizeof that call functions
Haojian Wu [Tue, 3 Apr 2018 15:10:24 +0000 (15:10 +0000)]
[clang-tidy] Check for sizeof that call functions

Summary:
A common mistake that I have found in our codebase is calling a function to get an integer or enum that represents the type such as:

```
int numBytes = numElements * sizeof(x.GetType());
```

So this extends the `sizeof` check to check for these cases. There is also a `WarnOnSizeOfCall` option so it can be disabled.

Patch by Paul Fultz II!

Reviewers: hokein, alexfh, aaron.ballman, ilya-biryukov

Reviewed By: alexfh

Subscribers: lebedev.ri, xazax.hun, jkorous-apple, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 329073

6 years ago[OpenMP] enable bc file compilation using the latest clang
Guansong Zhang [Tue, 3 Apr 2018 15:01:34 +0000 (15:01 +0000)]
[OpenMP] enable bc file compilation using the latest clang

Summary: adding cuda-rdc flag to allow extern global data

Reviewers: grokos

Reviewed By: grokos

Subscribers: gregrodgers, mgorny, openmp-commits

Tags: #openmp

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

llvm-svn: 329072

6 years agoRevert "[SLP] Fix PR36481: vectorize reassociated instructions."
Benjamin Kramer [Tue, 3 Apr 2018 14:40:33 +0000 (14:40 +0000)]
Revert "[SLP] Fix PR36481: vectorize reassociated instructions."

This reverts commit r328980 and r329046. Makes the vectorizer crash.

llvm-svn: 329071

6 years ago[clang-format/ObjC] Do not detect "[]" as ObjC method expression
Ben Hamilton [Tue, 3 Apr 2018 14:07:11 +0000 (14:07 +0000)]
[clang-format/ObjC] Do not detect "[]" as ObjC method expression

Summary:
The following C++ code was being detected by
`guessLanguage()` as Objective-C:

  #define FOO(...) auto bar = [] __VA_ARGS__;

This was because `[] __VA_ARGS__` is not currently detected as a C++
lambda expression (it has no parens or braces), so
`TokenAnnotator::parseSquare()` incorrectly treats the opening square
as an ObjC method expression.

We have two options to fix this:

1. Parse `[] __VA_ARGS__` explicitly as a C++ lambda
2. Make it so `[]` is never parsed as an Objective-C method expression

This diff implements option 2, which causes the `[` to be parsed
as `TT_ArraySubscriptLSquare` instead of `TT_ObjCMethodExpr`.

Note that when I fixed this, it caused one change in formatting
behavior, where the following was implicitly relying on the `[`
being parsed as `TT_ObjCMethodExpr`:

  A<int * []> a;

becomes:

  A<int *[]> a;

with `Style.PointerAlignment = Middle`.

I don't really know what the desired format is for this syntax; the
test was added by Janusz Sobczak and integrated by @djasper in
https://github.com/llvm-mirror/clang/commit/b511fe9818829d7ece0cc0b2ce1fbe04a1f0739a
.

I went ahead and changed the test for now.

Test Plan: New tests added. Ran tests with:
  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

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

Reviewers: djasper, jolesiak

Reviewed By: djasper

Subscribers: klimek, cfe-commits, djasper

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

llvm-svn: 329070

6 years ago[clang-format/ObjC] Do not insert space after opening brace of ObjC dict literal
Ben Hamilton [Tue, 3 Apr 2018 14:07:09 +0000 (14:07 +0000)]
[clang-format/ObjC] Do not insert space after opening brace of ObjC dict literal

Summary:
D44816 attempted to fix a few cases where `clang-format` incorrectly
inserted a space before the closing brace of an Objective-C dictionary
literal.

This revealed there were still a few cases where we inserted a space
after the opening brace of an Objective-C dictionary literal.

This fixes the formatting to be consistent and adds more tests.

Test Plan: New tests added. Confirmed tests failed before
  diff and passed after diff.
  Ran tests with:
  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: djasper, jolesiak, krasimir

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 329069

6 years ago[MC] Fix -Wmissing-field-initializer warning after r329067.
Andrea Di Biagio [Tue, 3 Apr 2018 13:52:26 +0000 (13:52 +0000)]
[MC] Fix -Wmissing-field-initializer warning after r329067.

This should fix the problem reported by the lld buildbots:
 - Builder lld-x86_64-darwin13, Build #19782
 - Builder lld-perf-testsuite, Build #1419

llvm-svn: 329068

6 years ago[MC][Tablegen] Allow the definition of processor register files in the scheduling...
Andrea Di Biagio [Tue, 3 Apr 2018 13:36:24 +0000 (13:36 +0000)]
[MC][Tablegen] Allow the definition of processor register files in the scheduling model for llvm-mca

This patch allows the description of register files in processor scheduling
models. This addresses PR36662.

A new tablegen class named 'RegisterFile' has been added to TargetSchedule.td.
Targets can optionally describe register files for their processors using that
class. In particular, class RegisterFile allows to specify:
 - The total number of physical registers.
 - Which target registers are accessible through the register file.
 - The cost of allocating a register at register renaming stage.

Example (from this patch - see file X86/X86ScheduleBtVer2.td)

  def FpuPRF : RegisterFile<72, [VR64, VR128, VR256], [1, 1, 2]>

Here, FpuPRF describes a register file for MMX/XMM/YMM registers. On Jaguar
(btver2), a YMM register definition consumes 2 physical registers, while MMX/XMM
register definitions only cost 1 physical register.

The syntax allows to specify an empty set of register classes.  An empty set of
register classes means: this register file models all the registers specified by
the Target.  For each register class, users can specify an optional register
cost. By default, register costs default to 1.  A value of 0 for the number of
physical registers means: "this register file has an unbounded number of
physical registers".

This patch is structured in two parts.

* Part 1 - MC/Tablegen *

A first part adds the tablegen definition of RegisterFile, and teaches the
SubtargetEmitter how to emit information related to register files.

Information about register files is accessible through an instance of
MCExtraProcessorInfo.
The idea behind this design is to logically partition the processor description
which is only used by external tools (like llvm-mca) from the processor
information used by the llvm machine schedulers.
I think that this design would make easier for targets to get rid of the extra
processor information if they don't want it.

* Part 2 - llvm-mca related *

The second part of this patch is related to changes to llvm-mca.

The main differences are:
 1) class RegisterFile now needs to take into account the "cost of a register"
when allocating physical registers at register renaming stage.
 2) Point 1. triggered a minor refactoring which lef to the removal of the
"maximum 32 register files" restriction.
 3) The BackendStatistics view has been updated so that we can print out extra
details related to each register file implemented by the processor.

The effect of point 3. is also visible in tests register-files-[1..5].s.

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

llvm-svn: 329067

6 years ago[LangRef] fix description and examples of fptrunc
Sanjay Patel [Tue, 3 Apr 2018 13:05:20 +0000 (13:05 +0000)]
[LangRef] fix description and examples of fptrunc

As noted in PR36966:
https://bugs.llvm.org/show_bug.cgi?id=36966

The old description doesn't match what we do in code,
so this just fixes the documentation to avoid confusion.

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

llvm-svn: 329065

6 years ago[PowerPC] reorder entries in P9InstrResources.td in alphabetical order; NFC
Hiroshi Inoue [Tue, 3 Apr 2018 12:49:42 +0000 (12:49 +0000)]
[PowerPC] reorder entries in P9InstrResources.td in alphabetical order; NFC

Reorder entries added in my previous commit (rL328969) to keep alphabetical order.

llvm-svn: 329064

6 years ago[ELF] - Check that output sections fit in address space.
George Rimar [Tue, 3 Apr 2018 12:39:28 +0000 (12:39 +0000)]
[ELF] - Check that output sections fit in address space.

Added checks to test that we do not produce
output where VA of sections overruns the address
space available.

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

llvm-svn: 329063

6 years ago[ELF] - Fix the comment. NFC.
George Rimar [Tue, 3 Apr 2018 12:28:53 +0000 (12:28 +0000)]
[ELF] - Fix the comment. NFC.

llvm-svn: 329062

6 years ago[ELF] - Relax checks for R_386_8/R_386_16 relocations.
George Rimar [Tue, 3 Apr 2018 12:19:04 +0000 (12:19 +0000)]
[ELF] - Relax checks for R_386_8/R_386_16 relocations.

This fixes PR36927.

The issue is next. Imagine we have -Ttext 0x7c and code below.

.code16
.global _start
_start:
movb $_start+0x83,%ah

So we have R_386_8 relocation and _start at 0x7C.
Addend is 0x83 == 131. We will sign extend it to 0xffffffffffffff83.

Now, 0xffffffffffffff83 + 0x7c gives us 0xFFFFFFFFFFFFFFFF.
Techically 0x83 + 0x7c == 0xFF, we do not exceed 1 byte value, but
currently LLD errors out, because we use checkUInt<8>.

Let's try to use checkInt<8> now and the following code to see if it can help (no):
main.s:
.byte foo

input.s:
.globl foo
.hidden foo
foo = 0xff

Here, foo is 0xFF. And addend is 0x0. Final value is 0x00000000000000FF.
Again, it fits one byte well, but with checkInt<8>,
we would error out it, so we can't use it.

What we want to do is to check that the result fits 1 byte well.
Patch changes the check to checkIntUInt to fix the issue.

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

llvm-svn: 329061

6 years ago[ELF] - Simplify createFiles. NFCI.
George Rimar [Tue, 3 Apr 2018 12:06:29 +0000 (12:06 +0000)]
[ELF] - Simplify createFiles. NFCI.

Groups paired options together.

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

llvm-svn: 329060

6 years ago[ELF] - X86_64: don't allow 8/16 bit dynamic relocations.
George Rimar [Tue, 3 Apr 2018 11:58:23 +0000 (11:58 +0000)]
[ELF] - X86_64: don't allow 8/16 bit dynamic relocations.

Having 8/16 bits dynamic relocations is incorrect.

Both gold and bfd (built from latest sources) disallow
that too.

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

llvm-svn: 329059

6 years ago[ELF] - Remove dead declaration. NFC.
George Rimar [Tue, 3 Apr 2018 10:40:39 +0000 (10:40 +0000)]
[ELF] - Remove dead declaration. NFC.

llvm-svn: 329058

6 years ago[x86] Fix a pretty obvious think-o with my asm scrubbing. You have to in
Chandler Carruth [Tue, 3 Apr 2018 10:28:56 +0000 (10:28 +0000)]
[x86] Fix a pretty obvious think-o with my asm scrubbing. You have to in
fact use regular expression syntax to use regular expressions.

Should restore the bots. Sorry for the noise on this test.

Thanks to Philip for spotting the bug!

llvm-svn: 329057

6 years ago[x86] Clean up and enhance a test around eflags copying.
Chandler Carruth [Tue, 3 Apr 2018 10:04:37 +0000 (10:04 +0000)]
[x86] Clean up and enhance a test around eflags copying.

This adds the basic test cases from all the EFLAGS bugs in more direct
forms. It also switches to generated check lines, and includes both
32-bit and 64-bit variations.

No functionality changing here, just setting things up to have a nice
clean asm diff in my EFLAGS patch.

llvm-svn: 329056

6 years ago[x86] Extend my goofy SP offset scrubbing for llc test cases to actually
Chandler Carruth [Tue, 3 Apr 2018 09:57:05 +0000 (09:57 +0000)]
[x86] Extend my goofy SP offset scrubbing for llc test cases to actually
do explicit scrubbing of the offsets of stack spills and reloads.

You can always turn this off in order to test specific stack slot usage.
We were already hiding most of this, but the new logic hides it more
generically. Notably, we should effectively hide stack slot churn in
functions that have a frame pointer now, and should also hide it when
changing a function from stack pointer to frame pointer. That transition
already changes enough to be clearly noticed in the test case diff,
showing *every* spill and reload is really noisy without benefit. See
the test case I ran this on as a classic example.

llvm-svn: 329055

6 years agoMSan: introduce the conservative assembly handling mode.
Alexander Potapenko [Tue, 3 Apr 2018 09:50:06 +0000 (09:50 +0000)]
MSan: introduce the conservative assembly handling mode.

The default assembly handling mode may introduce false positives in the
cases when MSan doesn't understand that the assembly call initializes
the memory pointed to by one of its arguments.

We introduce the conservative mode, which initializes the first
|sizeof(type)| bytes for every |type*| pointer passed into the
assembly statement.

llvm-svn: 329054

6 years ago[clangd][cmake] Provide libatomic when there is no native support for 64bit atomics
Simon Dardis [Tue, 3 Apr 2018 09:40:07 +0000 (09:40 +0000)]
[clangd][cmake] Provide libatomic when there is no native support for 64bit atomics

This addresses a persistent failure on clang-cmake-mips buildbot.

Reviewers: ioeric

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

llvm-svn: 329053

6 years agoUsersManual.rst: update text for /GX- to match r328708
Hans Wennborg [Tue, 3 Apr 2018 09:28:21 +0000 (09:28 +0000)]
UsersManual.rst: update text for /GX- to match r328708

llvm-svn: 329052

6 years ago[SCEV] Fix PR36974.
Serguei Katkov [Tue, 3 Apr 2018 07:29:00 +0000 (07:29 +0000)]
[SCEV] Fix PR36974.

The patch changes the usage of dominate to properlyDominate
to satisfy the condition !(a < a) while using std::max.

It is actually NFC due to set data structure is used to keep
the Loops and no two identical loops can be in collection.
So in reality there is no difference between usage of
dominate and properlyDominate in this particular case.
However it might be changed so it is better to fix it.

llvm-svn: 329051

6 years agoAdd a wrapper around llvm-objdump to look for indirect calls/jmps in x86 assembly.
Eric Christopher [Tue, 3 Apr 2018 07:01:33 +0000 (07:01 +0000)]
Add a wrapper around llvm-objdump to look for indirect calls/jmps in x86 assembly.

Useful when looking for indirect calls/jmps the need mitigation
via retpoline or other mitigations for Spectre v2.

Feedback, extension, additional patches welcome.

llvm-svn: 329050

6 years ago[X86] Reduce number of OpPrefix bits in TSFlags to 2. NFCI
Craig Topper [Tue, 3 Apr 2018 06:37:04 +0000 (06:37 +0000)]
[X86] Reduce number of OpPrefix bits in TSFlags to 2. NFCI

TSFlag doesn't need to disambiguate NoPrfx from PS. So shift the encodings so PS is NoPrfx|0x4.

llvm-svn: 329049

6 years ago[X86][TableGen] Add a missing error check to make sure EVEX instructions use one...
Craig Topper [Tue, 3 Apr 2018 06:37:01 +0000 (06:37 +0000)]
[X86][TableGen] Add a missing error check to make sure EVEX instructions use one PS/PD/XS/XD prefixes.

llvm-svn: 329048

6 years ago[SCEV] Make computeExitLimit more simple and more powerful
Max Kazantsev [Tue, 3 Apr 2018 05:57:19 +0000 (05:57 +0000)]
[SCEV] Make computeExitLimit more simple and more powerful

Current implementation of `computeExitLimit` has a big piece of code
the only purpose of which is to prove that after the execution of this
block the latch will be executed. What it currently checks is actually a
subset of situations where the exiting block dominates latch.

This patch replaces all these checks for simple particular cases with
domination check over loop's latch which is the only necessary condition
of taking the exiting block into consideration. This change allows to
calculate exact loop taken count for simple loops like

  for (int i = 0; i < 100; i++) {
    if (cond) {...} else {...}
    if (i > 50) break;
    . . .
  }

Differential Revision: https://reviews.llvm.org/D44677
Reviewed By: efriedma

llvm-svn: 329047

6 years ago[SLP] Fix issues with debug output in the SLP vectorizer.
Chandler Carruth [Tue, 3 Apr 2018 05:27:28 +0000 (05:27 +0000)]
[SLP] Fix issues with debug output in the SLP vectorizer.

The primary issue here is that using NDEBUG alone isn't enough to guard
debug printing -- instead the DEBUG() macro needs to be used so that the
specific pass debug logging check is employed. Without this, every
asserts-enabled build was printing out information when it hit this.

I also fixed another place where we had multiple statements in a DEBUG
macro to use {}s to be a bit cleaner. And I fixed a place that used
`errs()` rather than `dbgs()`.

llvm-svn: 329046

6 years ago[TableGen] Use llvm::cast instead of static_cast so that the cast will be checked...
Craig Topper [Tue, 3 Apr 2018 05:10:12 +0000 (05:10 +0000)]
[TableGen] Use llvm::cast instead of static_cast so that the cast will be checked. NFC

llvm-svn: 329045

6 years agoUse OffsetMap in getSectionPiece.
Rafael Espindola [Tue, 3 Apr 2018 04:06:14 +0000 (04:06 +0000)]
Use OffsetMap in getSectionPiece.

OffsetMap maps to a SectionPiece index, but we were not taking
advantage of that in getSectionPiece.

With this patch both getOffset and getSectionPiece use OffsetMap and
the binary search is moved to findSectionPiece.

llvm-svn: 329044

6 years agobpf: fix incorrect SELECT_CC lowering
Yonghong Song [Tue, 3 Apr 2018 03:56:37 +0000 (03:56 +0000)]
bpf: fix incorrect SELECT_CC lowering

Commit 37962a331c77 ("bpf: Improve expanding logic in LowerSELECT_CC")
intended to improve code quality for certain jmp conditions. The
commit, however, has a couple of issues:
  (1). In code, just swap is not enough, ConditionalCode CC
       should also be swapped, otherwise incorrect code will
       be generated.
  (2). The ConditionalCode swap should be subject to
       getHasJmpExt(). If getHasJmpExt() is False, certain
       conditional codes will not be supported and swap
       may generate incorrect code.

The original goal for this patch is to optimize jmp operations
which does not have JmpExt turned on. If JmpExt is on,
better code could be generated. For example, the test
select_ri.ll is introduced to demonstrate the optimization.
The same result can be achieved with -mcpu=v2 flag.

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 329043

6 years agopeel loops with runtime small trip counts
Ikhlas Ajbar [Tue, 3 Apr 2018 03:39:43 +0000 (03:39 +0000)]
peel loops with runtime small trip counts

For Hexagon, peeling loops with small runtime trip count is beneficial for our
benchmarks. We set PeelCount in HexagonTargetInfo.cpp and we use PeelCount set
by the target for computing the desired peel count.

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

llvm-svn: 329042

6 years agoRemove utils/makellvm; it doesn't look like it works with cmake builds.
Nico Weber [Tue, 3 Apr 2018 02:37:49 +0000 (02:37 +0000)]
Remove utils/makellvm; it doesn't look like it works with cmake builds.

llvm-svn: 329041

6 years ago[x86] Tidy up test case, generate check lines with script. NFC.
Chandler Carruth [Tue, 3 Apr 2018 02:19:05 +0000 (02:19 +0000)]
[x86] Tidy up test case, generate check lines with script. NFC.

Just adds basic block labels and tidies up where comments go in the test
case and then generates fresh CHECK lines with the script. This way, the
check lines are much easier to maintain. They were already close to this
but not quite there.

llvm-svn: 329040

6 years agoMerge LazyArchive::fetch() and ArchiveFile::getMember(). NFC.
Rui Ueyama [Tue, 3 Apr 2018 02:06:57 +0000 (02:06 +0000)]
Merge LazyArchive::fetch() and ArchiveFile::getMember(). NFC.

They are to pull out an object file for a symbol, but for a historical
reason the code is written in two separate functions. This patch
merges them.

llvm-svn: 329039

6 years agoFix fs::proximate tests on platforms where /net exists.
Eric Fiselier [Tue, 3 Apr 2018 01:52:12 +0000 (01:52 +0000)]
Fix fs::proximate tests on platforms where /net exists.

The proximate tests depended on `/net` not being a valid path,
however, on OS X it is.

Correct the tests to handle this.

llvm-svn: 329038

6 years ago[lit] Prefer opening files with open (Python 2) rather than io.open which requires io.
Aaron Smith [Tue, 3 Apr 2018 00:22:12 +0000 (00:22 +0000)]
[lit] Prefer opening files with open (Python 2) rather than io.open which requires io.

Only rely on Python 3 (io.open) when necessary. This puts TestRunnyer.py closer to how it behaved
before the changes introduced in D43165 and silences a few Windows build bot failures.

Thanks to Stella Stamenova for the patch!

llvm-svn: 329037

6 years ago[AST] Fix some Clang-tidy modernize-use-auto warnings; other minor fixes (NFC).
Eugene Zelenko [Tue, 3 Apr 2018 00:11:50 +0000 (00:11 +0000)]
[AST] Fix some Clang-tidy modernize-use-auto warnings; other minor fixes (NFC).

llvm-svn: 329036

6 years ago[SLP] Distinguish "demanded and shrinkable" from "demanded and not shrinkable" values...
Haicheng Wu [Tue, 3 Apr 2018 00:05:10 +0000 (00:05 +0000)]
[SLP] Distinguish "demanded and shrinkable" from "demanded and not shrinkable" values when determining the minimum bitwidth

We use two approaches for determining the minimum bitwidth.

   * Demanded bits
   * Value tracking

If demanded bits doesn't result in a narrower type, we then try value tracking.
We need this if we want to root SLP trees with the indices of getelementptr
instructions since all the bits of the indices are demanded.

But there is a missing piece though. We need to be able to distinguish "demanded
and shrinkable" from "demanded and not shrinkable". For example, the bits of %i
in

%i = sext i32 %e1 to i64
%gep = getelementptr inbounds i64, i64* %p, i64 %i

are demanded, but we can shrink %i's type to i32 because it won't change the
result of the getelementptr. On the other hand, in

%tmp15 = sext i32 %tmp14 to i64
%tmp16 = insertvalue { i64, i64 } undef, i64 %tmp15, 0

it doesn't make sense to shrink %tmp15 and we can skip the value tracking.

Ideas are from Matthew Simpson!

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

llvm-svn: 329035

6 years agoInline two trivial functions that are called only once. NFC.
Rui Ueyama [Mon, 2 Apr 2018 23:58:50 +0000 (23:58 +0000)]
Inline two trivial functions that are called only once. NFC.

llvm-svn: 329034

6 years ago[Coroutines] Avoid assert splitting hidden coros
Brian Gesiak [Mon, 2 Apr 2018 23:39:40 +0000 (23:39 +0000)]
[Coroutines] Avoid assert splitting hidden coros

Summary:
When attempting to split a coroutine with 'hidden' visibility (for
example, a C++ coroutine that is inlined when compiled with the option
'-fvisibility-inlines-hidden'), LLVM would hit an assertion in
include/llvm/IR/GlobalValue.h:240: "local linkage requires default
visibility". The issue is that the visibility is copied from the source
of the function split in the `CloneFunctionInto` function, but the linkage
is not. To fix, create the new function first with external linkage,
then copy the linkage from the original function *after* `CloneFunctionInto`
is called.

Since `GlobalValue::setLinkage` in turn calls `maybeSetDsoLocal`, the
explicit call to `setDSOLocal` can be removed in CoroSplit.cpp.

Test Plan: check-llvm

Reviewers: GorNishanov, lewissbaker, EricWF, majnemer, rnk

Reviewed By: rnk

Subscribers: llvm-commits, eric_niebler

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

llvm-svn: 329033

6 years ago[Driver] Wire up the -f[no-]rtlib-add-rpath flag and tests
Petr Hosek [Mon, 2 Apr 2018 23:36:14 +0000 (23:36 +0000)]
[Driver] Wire up the -f[no-]rtlib-add-rpath flag and tests

D30700 added the -f[no-]rtlib-add-rpath flag, but that flag was never
wired up in the driver and tests were updated to check whether it
actually does anything. This patch wires up the flag and updates test.

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

llvm-svn: 329032

6 years agoImplement P0430R2 - File system library on non-POSIX systems.
Eric Fiselier [Mon, 2 Apr 2018 23:35:24 +0000 (23:35 +0000)]
Implement P0430R2 - File system library on non-POSIX systems.

This patch implements P0430R2, who's largest change is adding the path::format
enumeration for supporting path format conversions in path constructors.

However, since libc++'s filesystem only really supports POSIX like systems,
there are no real changes needed. This patch simply adds the format enum
and then ignores it when it's passed to constructors.

llvm-svn: 329031

6 years agoAlign stubs for external and common global variables to pointer size.
Rafael Espindola [Mon, 2 Apr 2018 23:20:30 +0000 (23:20 +0000)]
Align stubs for external and common global variables to pointer size.

This patch fixes PR36885: clang++ generates unaligned stub symbol
holding a pointer.

Patch by Rahul Chaudhry!

llvm-svn: 329030

6 years agoRemove llvm-mcmarkup.
Eric Christopher [Mon, 2 Apr 2018 23:17:55 +0000 (23:17 +0000)]
Remove llvm-mcmarkup.

It was never used and I've checked with the original authors.

llvm-svn: 329029

6 years agoImplement filesystem NB comments, relative paths, and related issues.
Eric Fiselier [Mon, 2 Apr 2018 23:03:41 +0000 (23:03 +0000)]
Implement filesystem NB comments, relative paths, and related issues.

This is a fairly large patch that implements all of the filesystem NB comments
and the relative paths changes (ex. adding weakly_canonical). These issues
and papers are all interrelated so their implementation couldn't be split up
nicely.

This patch upgrades <experimental/filesystem> to match the C++17 spec and not
the published experimental TS spec. Some of the changes in this patch are both
API and ABI breaking, however libc++ makes no guarantee about stability for
experimental implementations.

The major changes in this patch are:

* Implement NB comments for filesystem (P0492R2), including:
  * Implement `perm_options` enum as part of NB comments, and update the
    `permissions` function to match.
  * Implement changes to `remove_filename` and `replace_filename`
  * Implement changes to `path::stem()` and `path::extension()` which support
    splitting examples like `.profile`.
  * Change path iteration to return an empty path instead of '.' for trailing
    separators.
  * Change `operator/=` to handle absolute paths on the RHS.
  * Change `absolute` to no longer accept a current path argument.

* Implement relative paths according to NB comments (P0219r1)

* Combine `path.cpp` and `operations.cpp` since some path functions require
  access to the operations internals, and some fs operations require access
  to the path parser.

llvm-svn: 329028

6 years ago[InstCombine] Don't strip function type casts from musttail calls
Reid Kleckner [Mon, 2 Apr 2018 22:49:44 +0000 (22:49 +0000)]
[InstCombine] Don't strip function type casts from musttail calls

Summary:
The cast simplifications that instcombine does here do not make any
attempt to obey the verifier rules for musttail calls. Therefore we have
to disable them.

Reviewers: efriedma, majnemer, pcc

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 329027

6 years ago[lit] One more try at fixing TestRunner.py for D43165
Aaron Smith [Mon, 2 Apr 2018 22:34:35 +0000 (22:34 +0000)]
[lit] One more try at fixing TestRunner.py for D43165

llvm-svn: 329026

6 years agoCodeGenCXX: support PreserveMostCC in MS ABI
Saleem Abdulrasool [Mon, 2 Apr 2018 22:25:50 +0000 (22:25 +0000)]
CodeGenCXX: support PreserveMostCC in MS ABI

Microsoft has reserved 'U' for the PreserveMostCC which is used in the
swift runtime.  Add support for this.  This allows the swift runtime to
be built for Windows again.

llvm-svn: 329025

6 years ago[lit] Attempt to fix builtin diff code for Python 2
Reid Kleckner [Mon, 2 Apr 2018 22:19:42 +0000 (22:19 +0000)]
[lit] Attempt to fix builtin diff code for Python 2

llvm-svn: 329024

6 years ago[libcxx] Disable testing with system lib for 2 tests verifying debug mode.
Volodymyr Sapsai [Mon, 2 Apr 2018 22:09:57 +0000 (22:09 +0000)]
[libcxx] Disable testing with system lib for 2 tests verifying debug mode.

llvm-svn: 329023

6 years ago[lit] Fix problem in how Python versions open files with different encodings
Aaron Smith [Mon, 2 Apr 2018 22:08:56 +0000 (22:08 +0000)]
[lit] Fix problem in how Python versions open files with different encodings

Reapply D43165 which was reverted because of different versions of python failing.
The one line fix for the different python versions was commited at the same time
that D43165 was reverted. If this change is giving you issues then get in touch
with your python version and we will fix it.

llvm-svn: 329022

6 years agoFix Go IR test for changes in DIBuilder API
Harlan Haskins [Mon, 2 Apr 2018 21:45:35 +0000 (21:45 +0000)]
Fix Go IR test for changes in DIBuilder API

llvm-svn: 329021

6 years ago[lit] Use io.open to compare two files since it supports different encodings while...
Aaron Smith [Mon, 2 Apr 2018 21:44:51 +0000 (21:44 +0000)]
[lit] Use io.open to compare two files since it supports different encodings while older versions of open do not

llvm-svn: 329020

6 years ago[ORC] Add a debugging check to catch dangling references to SymbolStringPools.
Lang Hames [Mon, 2 Apr 2018 21:39:39 +0000 (21:39 +0000)]
[ORC] Add a debugging check to catch dangling references to SymbolStringPools.

llvm-svn: 329019

6 years ago[ORC] Fix a think-o: ExecutionSession should create a SymbolStringPool if none
Lang Hames [Mon, 2 Apr 2018 21:34:48 +0000 (21:34 +0000)]
[ORC] Fix a think-o: ExecutionSession should create a SymbolStringPool if none
is passed in.

llvm-svn: 329018

6 years agoRevert r329012 "[lit] Fix problem in how Python versions open files with different...
Reid Kleckner [Mon, 2 Apr 2018 21:33:46 +0000 (21:33 +0000)]
Revert r329012 "[lit] Fix problem in how Python versions open files with different encodings"

This doesn't work with Python 2. See this build-in-progress:
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/11105

llvm-svn: 329017

6 years ago[profile] Move newly added test to the supported platform
Rong Xu [Mon, 2 Apr 2018 21:24:07 +0000 (21:24 +0000)]
[profile] Move newly added test to the supported platform

Move test/profile/instrprof-value-merge.c from r328987 to Linux directory.

llvm-svn: 329016

6 years agoTreat inlining a notail call as a regular, non-tail call
Reid Kleckner [Mon, 2 Apr 2018 21:23:16 +0000 (21:23 +0000)]
Treat inlining a notail call as a regular, non-tail call

Otherwise, we end up inlining a musttail call into a non-tail position,
which breaks verifier invariants.

Fixes PR31014

llvm-svn: 329015

6 years agoDefine TrapInst for ppc64.
Rafael Espindola [Mon, 2 Apr 2018 21:11:13 +0000 (21:11 +0000)]
Define TrapInst for ppc64.

This is nice for testing since it is the first TrapInst whose bytes
are not all the same.

llvm-svn: 329014

6 years ago[ORC] Create a new SymbolStringPool by default in ExecutionSession constructor.
Lang Hames [Mon, 2 Apr 2018 20:57:56 +0000 (20:57 +0000)]
[ORC] Create a new SymbolStringPool by default in ExecutionSession constructor.

This makes the common case of constructing an ExecutionSession tidier.

llvm-svn: 329013

6 years ago[lit] Fix problem in how Python versions open files with different encodings
Aaron Smith [Mon, 2 Apr 2018 20:57:06 +0000 (20:57 +0000)]
[lit] Fix problem in how Python versions open files with different encodings

Summary:
This issue was found when running the clang unit test on Windows. Python 3.x cannot open some of the files that the tests are using with a simple open because of their encoding. Python 2.7+ and Python 3.x both support io.open which allows for an encoding to be specified.

This change will determine whether two files being compared should be opened (and then compared) as text or binary and whether to use utf-8 or the default encoding before proceeding with a line-by-line comparison.

Patch by Stella Stamenova!

Reviewers: zturner, llvm-commits, rnk, MaggieYi

Reviewed By: zturner

Subscribers: asmith, MatzeB, stella.stamenova, delcypher, llvm-commits

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

llvm-svn: 329012

6 years ago[InstCombine] add folds for icmp + sub (PR36969)
Sanjay Patel [Mon, 2 Apr 2018 20:37:40 +0000 (20:37 +0000)]
[InstCombine] add folds for icmp + sub (PR36969)

(A - B) >u A --> A <u B
C <u (C - D) --> C <u D

https://rise4fun.com/Alive/e7j

Name: ugt
  %sub = sub i8 %x, %y
  %cmp = icmp ugt i8 %sub, %x
=>
  %cmp = icmp ult i8 %x, %y

Name: ult
  %sub = sub i8 %x, %y
  %cmp = icmp ult i8 %x, %sub
=>
  %cmp = icmp ult i8 %x, %y

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

llvm-svn: 329011

6 years ago[InstCombine] add tests for icmp (sub x, y), x (PR36969); NFC
Sanjay Patel [Mon, 2 Apr 2018 20:23:54 +0000 (20:23 +0000)]
[InstCombine] add tests for icmp (sub x, y), x (PR36969); NFC

llvm-svn: 329010

6 years ago[MS] Emit vftable thunks for functions with incomplete prototypes
Reid Kleckner [Mon, 2 Apr 2018 20:20:33 +0000 (20:20 +0000)]
[MS] Emit vftable thunks for functions with incomplete prototypes

Summary:
The following class hierarchy requires that we be able to emit a
this-adjusting thunk for B::foo in C's vftable:

  struct Incomplete;
  struct A {
    virtual A* foo(Incomplete p) = 0;
  };
  struct B : virtual A {
    void foo(Incomplete p) override;
  };
  struct C : B { int c; };

This TU is valid, but lacks a definition of 'Incomplete', which makes it
hard to build a thunk for the final overrider, B::foo.

Before this change, Clang gives up attempting to emit the thunk, because
it assumes that if the parameter types are incomplete, it must be
emitting the thunk for optimization purposes. This is untrue for the MS
ABI, where the implementation of B::foo has no idea what thunks C's
vftable may require. Clang needs to emit the thunk without necessarily
having access to the complete prototype of foo.

This change makes Clang emit a musttail variadic call when it needs such
a thunk. I call these "unprototyped" thunks, because they only prototype
the "this" parameter, which must always come first in the MS C++ ABI.

These thunks work, but they create ugly LLVM IR. If the call to the
thunk is devirtualized, it will be a call to a bitcast of a function
pointer. Today, LLVM cannot inline through such a call, but I want to
address that soon, because we also use this pattern for virtual member
pointer thunks.

This change also implements an old FIXME in the code about reusing the
thunk's computed CGFunctionInfo as much as possible. Now we don't end up
computing the thunk's mangled name and arranging it's prototype up to
around three times.

Fixes PR25641

Reviewers: rjmccall, rsmith, hans

Subscribers: Prazek, cfe-commits

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

llvm-svn: 329009

6 years agoAnother attempt to fix papertrail-warnings.test on Windows bots by making expected...
Douglas Yung [Mon, 2 Apr 2018 20:05:05 +0000 (20:05 +0000)]
Another attempt to fix papertrail-warnings.test on Windows bots by making expected message less case sensitive.

llvm-svn: 329008

6 years agoFix some DenseMap use-after-rehash bugs and hoist MethodVFTableLocation
Reid Kleckner [Mon, 2 Apr 2018 20:00:39 +0000 (20:00 +0000)]
Fix some DenseMap use-after-rehash bugs and hoist MethodVFTableLocation

This re-lands r328845 with fixes for crbug.com/827810.

The initial motiviation was to hoist MethodVFTableLocation to global
scope so it could be forward declared.

In this patch, I noticed that MicrosoftVTableContext uses some risky
patterns. It has methods that return references to data stored in
DenseMaps. I've made some of them return by value for trivial structs
and I've moved some things into separate allocations.

llvm-svn: 329007

6 years ago[PPC64] Minor changes for Plt relocations.
Sean Fertile [Mon, 2 Apr 2018 19:47:21 +0000 (19:47 +0000)]
[PPC64] Minor changes for Plt relocations.

The Plt relative relocations are R_PPC64_JMP_SLOT in the V2 abi, and we only
reserve 2 double words instead of 3 at the start of the array of PLT entries for
lazy linking.

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

llvm-svn: 329006

6 years ago[Attr] [NFC] Revert accidental change from r327405
Joel E. Denny [Mon, 2 Apr 2018 19:43:34 +0000 (19:43 +0000)]
[Attr] [NFC] Revert accidental change from r327405

llvm-svn: 329005

6 years ago[PPC64] Write plt stubs for ElfV2 abi
Sean Fertile [Mon, 2 Apr 2018 19:17:12 +0000 (19:17 +0000)]
[PPC64] Write plt stubs for ElfV2 abi

Add the default version of a plt stub for the V2 Elf abi.

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

llvm-svn: 329004

6 years agoFix header mismatch in DIBuilder Type APIs
Harlan Haskins [Mon, 2 Apr 2018 19:11:44 +0000 (19:11 +0000)]
Fix header mismatch in DIBuilder Type APIs

Some of the headers changed slightly, and the accompanying
implementation didn't change. This caused a silent failure.

llvm-svn: 329003

6 years ago[llvm-pdbutil] Add an export subcommand.
Zachary Turner [Mon, 2 Apr 2018 18:35:21 +0000 (18:35 +0000)]
[llvm-pdbutil] Add an export subcommand.

This command can dump the binary contents of a stream to a file.
This is useful when you want to do side-by-side comparisons of
a specific stream from two PDBs to examine the differences between
them.  You can export both of them to a file, then open them up
side by side in a hex editor (for example), so as to eliminate any
differences that might arise from the contents being on different
blocks in the PDB.

In subsequent patches I plan to improve the "explain" subcommand
so that you can explain the contents of a binary file that isn't
necessarily a full PDB, but one of these dumped streams, by telling
the subcommand how to interpret the contents.

llvm-svn: 329002

6 years agoTemporarily revert r328404:
Eric Christopher [Mon, 2 Apr 2018 18:33:47 +0000 (18:33 +0000)]
Temporarily revert r328404:

commit 519b97132a4c960e8dedbfe4290d86970d92e995
Author: Richard Trieu <rtrieu@google.com>
Date:   Sat Mar 24 00:52:44 2018 +0000

    [ODRHash] Support pointer and reference types.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328404 91177308-0d34-0410-b5e6-96231b3b80d8

As it's breaking some tests. I've communicated with Richard offline about testcases.

llvm-svn: 329001

6 years agoAdd -fclang-abi-compat=6 flag for upcoming ABI changes.
Richard Smith [Mon, 2 Apr 2018 18:29:44 +0000 (18:29 +0000)]
Add -fclang-abi-compat=6 flag for upcoming ABI changes.

llvm-svn: 329000

6 years agoAdd helper to determine if a field is a zero-length bitfield.
Richard Smith [Mon, 2 Apr 2018 18:29:43 +0000 (18:29 +0000)]
Add helper to determine if a field is a zero-length bitfield.

llvm-svn: 328999

6 years agoRemove unused PACKAGE_TARNAME; looks like a remnant of the old autoconf build.
Nico Weber [Mon, 2 Apr 2018 18:13:05 +0000 (18:13 +0000)]
Remove unused PACKAGE_TARNAME; looks like a remnant of the old autoconf build.

llvm-svn: 328998

6 years agoRevert r328932 as it caused Windows and MacOS bot failures.
Mike Edwards [Mon, 2 Apr 2018 18:02:36 +0000 (18:02 +0000)]
Revert r328932 as it caused Windows and MacOS bot failures.

http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/43991/

llvm-svn: 328997