platform/upstream/llvm.git
7 years agoTableGen: Use StringInit instead of std::string for DagInit name
Matthias Braun [Mon, 5 Dec 2016 06:00:41 +0000 (06:00 +0000)]
TableGen: Use StringInit instead of std::string for DagInit name

llvm-svn: 288643

7 years agoTableGen: Use more StringInit instead of StringRef
Matthias Braun [Mon, 5 Dec 2016 06:00:36 +0000 (06:00 +0000)]
TableGen: Use more StringInit instead of StringRef

This forces the code to call StringInit::get on the string early and
avoids storing duplicates in std::string and sometimes allows pointer
comparisons instead of string comparisons.

llvm-svn: 288642

7 years ago[AVX-512] Teach fast isel to handle 512-bit vector bitcasts.
Craig Topper [Mon, 5 Dec 2016 05:50:51 +0000 (05:50 +0000)]
[AVX-512] Teach fast isel to handle 512-bit vector bitcasts.

llvm-svn: 288641

7 years agoUse Darwin libtool's -no_warning_for_no_symbols if available to silence the "has...
Kuba Mracek [Mon, 5 Dec 2016 05:21:44 +0000 (05:21 +0000)]
Use Darwin libtool's -no_warning_for_no_symbols if available to silence the "has no symbols" link warning

Building compiler-rt on Darwin produces dozens of meaningless warnings about object files having no symbols during static archive creation. This is very intentional as compiler-rt uses #ifdefs to conditionally compile platform-specific code, and we even have a .cpp source file that only contains static asserts to make sure the environment is configured right. On Linux, this situation is fine and no warning is produced. This patch adds a libtool version detection and if it's new enough, we'll use the -no_warning_for_no_symbols flag that suppresses this warning. Build logs should be much cleaner now!

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

llvm-svn: 288640

7 years agoTableGen: Factor out STRCONCAT constructor, add shortcut.
Matthias Braun [Mon, 5 Dec 2016 05:21:18 +0000 (05:21 +0000)]
TableGen: Factor out STRCONCAT constructor, add shortcut.

Introduce new constructor for STRCONCAT binop with a shortcut that
immediately concatenates if the two arguments are StringInits.
Makes the QualifyName code more readable and tablegen 2-3% faster.

llvm-svn: 288639

7 years agoTableGen/Record: Move PointerIntPair to less used field of RecordVal
Matthias Braun [Mon, 5 Dec 2016 05:21:13 +0000 (05:21 +0000)]
TableGen/Record: Move PointerIntPair to less used field of RecordVal

llvm-svn: 288638

7 years ago[Hexagon] Adding additional tokenization characters in preparation for removing spaci...
Colin LeMahieu [Mon, 5 Dec 2016 04:52:28 +0000 (04:52 +0000)]
[Hexagon] Adding additional tokenization characters in preparation for removing spacing from syntax.

llvm-svn: 288637

7 years ago[AVX-512] Teach fast isel to use masked compare and movss for handling scalar cmp...
Craig Topper [Mon, 5 Dec 2016 04:51:31 +0000 (04:51 +0000)]
[AVX-512] Teach fast isel to use masked compare and movss for handling scalar cmp and select sequence when AVX-512 is enabled. This matches the behavior of normal isel.

llvm-svn: 288636

7 years ago[AVX-512] Add avx512f command lines to fast isel SSE select test.
Craig Topper [Mon, 5 Dec 2016 04:51:28 +0000 (04:51 +0000)]
[AVX-512] Add avx512f command lines to fast isel SSE select test.

Currently the fast isel code emits an avx1 instruction sequence even with avx512. This is different than normal isel. A follow up commit will fix this.

llvm-svn: 288635

7 years ago[Hexagon] Changing from literal numeric value to argument since #-1 will not parse...
Colin LeMahieu [Mon, 5 Dec 2016 04:29:00 +0000 (04:29 +0000)]
[Hexagon] Changing from literal numeric value to argument since #-1 will not parse when '-' is converted to a token.

llvm-svn: 288634

7 years ago[CMake] Use add_llvm_tool_symlink's OUTPUT_DIR option
Chris Bieneman [Mon, 5 Dec 2016 03:29:10 +0000 (03:29 +0000)]
[CMake] Use add_llvm_tool_symlink's OUTPUT_DIR option

This is updating to take r288632 into account.

llvm-svn: 288633

7 years ago[CMake] Refactor add_llvm_tool_symlink for reuse
Chris Bieneman [Mon, 5 Dec 2016 03:28:03 +0000 (03:28 +0000)]
[CMake] Refactor add_llvm_tool_symlink for reuse

The old implementation of add_llvm_tool_symlink could fail in odd ways when building out of tree. This version solves that problem by not using the LLVM_* variables, and instead reaeding the target's properties.

llvm-svn: 288632

7 years agoRun the last iteration of parallel_for_loop using a threadpool.
Rui Ueyama [Mon, 5 Dec 2016 02:07:29 +0000 (02:07 +0000)]
Run the last iteration of parallel_for_loop using a threadpool.

Remainders of tasks were ran in the main thread, so parallel_for_each
could theoretically take 2x time than the ideal.

llvm-svn: 288631

7 years agoSimplify ICF alignment handling.
Rui Ueyama [Mon, 5 Dec 2016 01:31:39 +0000 (01:31 +0000)]
Simplify ICF alignment handling.

llvm-svn: 288630

7 years agoIRGen: Remove an unused overload of CreateAlignedLoad.
Peter Collingbourne [Mon, 5 Dec 2016 00:02:18 +0000 (00:02 +0000)]
IRGen: Remove an unused overload of CreateAlignedLoad.

llvm-svn: 288629

7 years ago[X86][XOP] Add target shuffle tests showing missing UNPCKL combine.
Simon Pilgrim [Sun, 4 Dec 2016 22:55:57 +0000 (22:55 +0000)]
[X86][XOP] Add target shuffle tests showing missing UNPCKL combine.

llvm-svn: 288628

7 years ago[X86][AVX512] Add target shuffle tests showing missing UNPCK combines.
Simon Pilgrim [Sun, 4 Dec 2016 22:54:21 +0000 (22:54 +0000)]
[X86][AVX512] Add target shuffle tests showing missing UNPCK combines.

llvm-svn: 288627

7 years agoRevert "Recover better from an incompatible .pcm file being provided by -fmodule...
Daniel Jasper [Sun, 4 Dec 2016 22:34:37 +0000 (22:34 +0000)]
Revert "Recover better from an incompatible .pcm file being provided by -fmodule-file=. We try to include the headers of the module textually in this case, still enforcing the modules semantic rules. In order to make that work, we need to still track that we're entering and leaving the module. Also, if the module was also marked as unavailable (perhaps because it was missing a file), we shouldn't mark the module unavailable -- we don't need the module to be complete if we're going to enter it textually."

This reverts commit r288449.

I believe that this is currently faulty wrt. modules being imported
inside namespaces. Adding these lines to the new test:

  namespace n {
  #include "foo.h"
  }

Makes it break with

  fatal error: import of module 'M' appears within namespace 'n'

However, I believe it should fail with

  error: redundant #include of module 'M' appears within namespace 'n'

I have tracked this down to us now inserting a tok::annot_module_begin
instead of a tok::annot_module_include in
Preprocessor::HandleIncludeDirective() and then later in
Parser::parseMisplacedModuleImport(), we hit the code path for
tok::annot_module_begin, which doesn't set FromInclude of
checkModuleImportContext to true (thus leading to the "wrong"
diagnostic).

llvm-svn: 288626

7 years agoUpdate status page for variant implementation
Eric Fiselier [Sun, 4 Dec 2016 22:14:53 +0000 (22:14 +0000)]
Update status page for variant implementation

llvm-svn: 288625

7 years ago[sanitizer] Make atos stdin a non-tty pipe to make sure it's not stuck waiting for...
Kuba Mracek [Sun, 4 Dec 2016 21:52:21 +0000 (21:52 +0000)]
[sanitizer] Make atos stdin a non-tty pipe to make sure it's not stuck waiting for user input

On macOS, we often symbolicate using atos (when llvm-symbolizer is not found). The current way we invoke atos involves creating a pseudo-terminal to make sure atos doesn't buffer its output. This however also makes atos think that it's stdin is interactive and in some error situations it will ask the user to enter some input instead of just printing out an error message. For example, when Developer Mode isn't enabled on a machine, atos cannot examine processes, and it will ask the user to enter an administrator's password, which will make the sanitized process get stuck. This patch only connects the pseudo-terminal to the stdout of atos, and uses a regular pipe as its stdin.

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

llvm-svn: 288624

7 years agoChoose better hash values for std::monostate and valueless variants.
Eric Fiselier [Sun, 4 Dec 2016 21:37:37 +0000 (21:37 +0000)]
Choose better hash values for std::monostate and valueless variants.

Previously these hashes were 0 and -1 respectively. These seem like common
sentinel values and should be avoided to prevent needless collisions.

This patch changes those values to different arbitrary numbers, which should
hopefully cause less collisions. Because I couldn't help myself I choose the
fundamental constants for gravity and the speed of light.

llvm-svn: 288623

7 years ago[X86] Mark 256-bit DPPS intrinsic as commutable to increase load matching opportunities.
Craig Topper [Sun, 4 Dec 2016 21:13:05 +0000 (21:13 +0000)]
[X86] Mark 256-bit DPPS intrinsic as commutable to increase load matching opportunities.

llvm-svn: 288622

7 years ago[X86] Add Commutative property to several MMX arithmetic and logic intrinsics.
Craig Topper [Sun, 4 Dec 2016 21:13:01 +0000 (21:13 +0000)]
[X86] Add Commutative property to several MMX arithmetic and logic intrinsics.

I think these intrinsics were added after the Commutative was added to most of the rest of the intrinsics and it must have been forgotten.

llvm-svn: 288621

7 years agoRe-implement the optimization that I removed in r288527.
Rui Ueyama [Sun, 4 Dec 2016 16:33:13 +0000 (16:33 +0000)]
Re-implement the optimization that I removed in r288527.

I removed a wrong optimization for ICF in r288527. Sean Silva suggested
in a post commit review that the correct algorithm can be implemented
easily. So is this patch.

llvm-svn: 288620

7 years ago[stl-extras] Provide an adaptor of std::count for ranges.
Michael Gottesman [Sun, 4 Dec 2016 10:26:53 +0000 (10:26 +0000)]
[stl-extras] Provide an adaptor of std::count for ranges.

llvm-svn: 288619

7 years ago[AVR] Remove 'XFAIL' from a CodeGen test
Dylan McKay [Sun, 4 Dec 2016 09:50:42 +0000 (09:50 +0000)]
[AVR] Remove 'XFAIL' from a CodeGen test

This seems to be fixed as of r288052.

llvm-svn: 288618

7 years agoDon't discard .L symbol with -r.
Rafael Espindola [Sun, 4 Dec 2016 08:34:17 +0000 (08:34 +0000)]
Don't discard .L symbol with -r.

They might be used by relocations.

Fixes pr31252.

llvm-svn: 288617

7 years agoAlways use / as the path separator.
Rafael Espindola [Sun, 4 Dec 2016 07:27:02 +0000 (07:27 +0000)]
Always use / as the path separator.

It is not clear if it is worth the complexity to use \ on
windows. This should fix the bots.

llvm-svn: 288616

7 years agoPrefix path when displaying thin archives.
Rafael Espindola [Sun, 4 Dec 2016 06:52:30 +0000 (06:52 +0000)]
Prefix path when displaying thin archives.

Patch by Mark Santaniello.

llvm-svn: 288615

7 years agoTableGen: Adapt to llvm r288612
Matthias Braun [Sun, 4 Dec 2016 05:55:09 +0000 (05:55 +0000)]
TableGen: Adapt to llvm r288612

llvm-svn: 288614

7 years agoTableGen: Store Records on a BumpPtrAllocator
Matthias Braun [Sun, 4 Dec 2016 05:48:20 +0000 (05:48 +0000)]
TableGen: Store Records on a BumpPtrAllocator

All these records are internalized and will live until exit.  This makes
them perfect candidates for a fast BumpPtrAllocator.

llvm-svn: 288613

7 years agoTableGen: Use StringRef instead of const std::string& in return vals.
Matthias Braun [Sun, 4 Dec 2016 05:48:16 +0000 (05:48 +0000)]
TableGen: Use StringRef instead of const std::string& in return vals.

This will allow to switch to a different string storage in an upcoming
commit.

llvm-svn: 288612

7 years agoTableGen: Optimize common string concatenation with SmallString
Matthias Braun [Sun, 4 Dec 2016 05:48:06 +0000 (05:48 +0000)]
TableGen: Optimize common string concatenation with SmallString

llvm-svn: 288611

7 years agoTableGen: Use StringRef instead of const std::string& for parameters
Matthias Braun [Sun, 4 Dec 2016 05:48:03 +0000 (05:48 +0000)]
TableGen: Use StringRef instead of const std::string& for parameters

This avoid an extra construction of a std::string (and a heap
allocation) when the caller only has a StringRef but no std::string at
hand.

llvm-svn: 288610

7 years agoUpdate comment to clarify the machine spec.
Rui Ueyama [Sun, 4 Dec 2016 02:34:29 +0000 (02:34 +0000)]
Update comment to clarify the machine spec.

llvm-svn: 288609

7 years ago[Object][MachO] Reference-ify some helper function arguments. NFC.
Lang Hames [Sun, 4 Dec 2016 01:56:10 +0000 (01:56 +0000)]
[Object][MachO] Reference-ify some helper function arguments. NFC.

Changes all static helper functions in MachOObjectFile.cpp that expect a
non-null MachOObjectFile pointer to take a reference instead.

llvm-svn: 288608

7 years ago[MC] Generalize MCContext's SectionSymbols field.
Dan Gohman [Sat, 3 Dec 2016 23:55:57 +0000 (23:55 +0000)]
[MC] Generalize MCContext's SectionSymbols field.

Change SectionSymbols so that it doesn't hard-code ELF types, so that
it can be used for non-ELF targets.

llvm-svn: 288607

7 years agoAdd comments about the use of threads in LLD.
Rui Ueyama [Sat, 3 Dec 2016 23:35:22 +0000 (23:35 +0000)]
Add comments about the use of threads in LLD.

llvm-svn: 288606

7 years agoAdd the --no-color option to the git call in the doc when using clang-format-diff
Sylvestre Ledru [Sat, 3 Dec 2016 23:22:45 +0000 (23:22 +0000)]
Add the --no-color option to the git call in the doc when using clang-format-diff

llvm-svn: 288605

7 years ago[WebAssembly] Revert r288447.
Dan Gohman [Sat, 3 Dec 2016 23:03:52 +0000 (23:03 +0000)]
[WebAssembly] Revert r288447.

Revert r288447 which introduced -mdirect. It turns out we don't need a
custom flag for this, as the information we need is in the target triple.

llvm-svn: 288604

7 years agoDAG: Fold out out of bounds insert_vector_elt
Matt Arsenault [Sat, 3 Dec 2016 23:03:26 +0000 (23:03 +0000)]
DAG: Fold out out of bounds insert_vector_elt

getNode already prevents formation of out of bounds constant
extract_vector_elts. Do the same for insert_vector_elt.

llvm-svn: 288603

7 years ago[WebAssembly] Eliminate an ad-hoc command-line argument.
Dan Gohman [Sat, 3 Dec 2016 23:00:12 +0000 (23:00 +0000)]
[WebAssembly] Eliminate an ad-hoc command-line argument.

Use the target triple to determine whether to run the explicit-locals
pass, rather than using a separate command-line argument.

llvm-svn: 288602

7 years agoAMDGPU: remove a couple of unused variables
Saleem Abdulrasool [Sat, 3 Dec 2016 22:25:21 +0000 (22:25 +0000)]
AMDGPU: remove a couple of unused variables

lib/Target/AMDGPU/SIRegisterInfo.cpp: In member function 'void llvm::SIRegisterInfo::spillSGPR(llvm::MachineBasicBlock::iterator, int, llvm::RegScavenger*) const':
lib/Target/AMDGPU/SIRegisterInfo.cpp:572:30: warning: variable 'SubRC' set but not used [-Wunused-but-set-variable]
   const TargetRegisterClass *SubRC = nullptr;
                              ^
lib/Target/AMDGPU/SIRegisterInfo.cpp: In member function 'void llvm::SIRegisterInfo::restoreSGPR(llvm::MachineBasicBlock::iterator, int, llvm::RegScavenger*) const':
lib/Target/AMDGPU/SIRegisterInfo.cpp:723:30: warning: variable 'SubRC' set but not used [-Wunused-but-set-variable]
   const TargetRegisterClass *SubRC = nullptr;
                              ^

The variable was assigned to, but never used.  The functions called did not
mutate state.  Simplify the logic and remove the variable.  Identified by gcc
5.4.0.

llvm-svn: 288601

7 years agobuild: allow specifying the component to `llvm_install_symlink`
Saleem Abdulrasool [Sat, 3 Dec 2016 22:03:24 +0000 (22:03 +0000)]
build: allow specifying the component to `llvm_install_symlink`

Add an optional parameter to `llvm_install_symlink` which allows the symlink
installation to be placed into a specific component rather than the default
value.

llvm-svn: 288600

7 years agoFactor out common code to a header.
Rui Ueyama [Sat, 3 Dec 2016 21:24:51 +0000 (21:24 +0000)]
Factor out common code to a header.

llvm-svn: 288599

7 years ago[PM] Rename lookupPass to lookUpPass.
Justin Lebar [Sat, 3 Dec 2016 19:49:35 +0000 (19:49 +0000)]
[PM] Rename lookupPass to lookUpPass.

Summary:
"Lookup" is a noun ("lookup table"), "look up" is a verb ("look up
'table' in the dictionary").

Reviewers: chandlerc

Subscribers: silvas, llvm-commits, mehdi_amini

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

llvm-svn: 288598

7 years ago[PM] Get rid of an unused variable in AnalysisManager::clear(IRUnitT&).
Justin Lebar [Sat, 3 Dec 2016 19:49:31 +0000 (19:49 +0000)]
[PM] Get rid of an unused variable in AnalysisManager::clear(IRUnitT&).

Reviewers: chandlerc

Subscribers: silvas, llvm-commits, mehdi_amini

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

llvm-svn: 288597

7 years ago[PM] Consistently use curly braces rather than std::make_pair in AnalysisResults...
Justin Lebar [Sat, 3 Dec 2016 19:49:27 +0000 (19:49 +0000)]
[PM] Consistently use curly braces rather than std::make_pair in AnalysisResults.find().

Reviewers: chandlerc

Subscribers: silvas, llvm-commits, mehdi_amini

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

llvm-svn: 288596

7 years ago[PM] Don't walk the AM's ResultsList if nothing was invalidated.
Justin Lebar [Sat, 3 Dec 2016 19:49:23 +0000 (19:49 +0000)]
[PM] Don't walk the AM's ResultsList if nothing was invalidated.

Summary:
Previously in AnalysisManager::invalidate(), we would walk the full
ResultsList even if we knew that nothing was invalidated.

Reviewers: chandlerc

Subscribers: silvas, llvm-commits, mehdi_amini

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

llvm-svn: 288595

7 years ago[PM] Make AnalysisManager::registerPass take its parameter by universal reference.
Justin Lebar [Sat, 3 Dec 2016 19:49:19 +0000 (19:49 +0000)]
[PM] Make AnalysisManager::registerPass take its parameter by universal reference.

Summary:
Previously, we were forcing a copy if you passed an lvalue argument; now
we'll take it by reference.

Reviewers: chandlerc

Subscribers: mehdi_amini, silvas, llvm-commits

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

llvm-svn: 288594

7 years ago[PM] Make PassManager's constructor explicit.
Justin Lebar [Sat, 3 Dec 2016 19:49:15 +0000 (19:49 +0000)]
[PM] Make PassManager's constructor explicit.

Reviewers: chandlerc

Subscribers: silvas, llvm-commits, mehdi_amini

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

llvm-svn: 288593

7 years ago[PM] Make PreservedAnalyses::preserved take its parameter by const ref.
Justin Lebar [Sat, 3 Dec 2016 19:49:12 +0000 (19:49 +0000)]
[PM] Make PreservedAnalyses::preserved take its parameter by const ref.

Summary: Previously we were unnecessarily copying the argument.

Reviewers: chandlerc

Subscribers: mehdi_amini, silvas, llvm-commits

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

llvm-svn: 288592

7 years ago[AVX-512] Add many of the VPERM instructions to the load folding table. Move VPERMPDZ...
Craig Topper [Sat, 3 Dec 2016 19:37:39 +0000 (19:37 +0000)]
[AVX-512] Add many of the VPERM instructions to the load folding table. Move VPERMPDZri to the correct table.

llvm-svn: 288591

7 years agoAMDGPU: Clean up struct initializers
Matt Arsenault [Sat, 3 Dec 2016 18:22:49 +0000 (18:22 +0000)]
AMDGPU: Clean up struct initializers

llvm-svn: 288590

7 years ago[InstSimplify] add more helper functions for SimplifyICmpInst; NFCI
Sanjay Patel [Sat, 3 Dec 2016 18:03:53 +0000 (18:03 +0000)]
[InstSimplify] add more helper functions for SimplifyICmpInst; NFCI

llvm-svn: 288589

7 years ago[InstSimplify] add helper functions for SimplifyICmpInst; NFCI
Sanjay Patel [Sat, 3 Dec 2016 17:30:22 +0000 (17:30 +0000)]
[InstSimplify] add helper functions for SimplifyICmpInst; NFCI

llvm-svn: 288588

7 years ago[AVX-512] Add EVEX VPMADDUBSW and VPMADDWD to the load folding tables.
Craig Topper [Sat, 3 Dec 2016 17:19:15 +0000 (17:19 +0000)]
[AVX-512] Add EVEX VPMADDUBSW and VPMADDWD to the load folding tables.

llvm-svn: 288587

7 years ago[clang-move] don't miss ',' in json output when there are duplicate elements.
Eric Liu [Sat, 3 Dec 2016 15:28:03 +0000 (15:28 +0000)]
[clang-move] don't miss ',' in json output when there are duplicate elements.

llvm-svn: 288586

7 years agoIgnone SHF_INFO_LINK.
Rafael Espindola [Sat, 3 Dec 2016 15:26:18 +0000 (15:26 +0000)]
Ignone SHF_INFO_LINK.

Some elf producers (dtrace) put this flag in relocation sections and
some (MC) don't. If we don't ignore the flag we end up with multiple
relocation sections poiting to the same section, which we don't
support.

llvm-svn: 288585

7 years ago[InstCombine] change select type to eliminate bitcasts
Sanjay Patel [Sat, 3 Dec 2016 15:25:16 +0000 (15:25 +0000)]
[InstCombine] change select type to eliminate bitcasts

This solves a secondary problem seen in PR6137:
https://llvm.org/bugs/show_bug.cgi?id=6137#c6

This is similar to the bitwise logic op fold added with:
https://reviews.llvm.org/rL287707

And like that patch, I'm artificially restricting the
transform from vector <-> scalar types until we're sure
that the backend can handle that.

llvm-svn: 288584

7 years ago[libclang] Fix python tests
Sergey Kalinichev [Sat, 3 Dec 2016 12:53:06 +0000 (12:53 +0000)]
[libclang] Fix python tests

It was broken in r286421

llvm-svn: 288582

7 years ago[ELF] - Implemented R_386_16 and R_386PC16 relocations
George Rimar [Sat, 3 Dec 2016 07:30:30 +0000 (07:30 +0000)]
[ELF] - Implemented R_386_16 and R_386PC16 relocations

A program or object file using R_386_8, R_386_16, R_386_PC16 or R_386_PC8
relocations is not conformant to latest ABI. The R_386_16, and R_386_8
relocations truncate the computed value to 16 - bits and 8 - bits
respectively. R_386_PC16 and R_386_16 are used by some
applications, for example by FreeBSD loaders.

Previously we did not take addend in account for these relocation,
counting it as 0, what is wrong and was a reason of hangs.

This patch needed for example for FreeBSD pmbr (protective mbr).

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

llvm-svn: 288581

7 years ago[ELF] - Change the way how we compute offsets for binary output.
George Rimar [Sat, 3 Dec 2016 07:23:30 +0000 (07:23 +0000)]
[ELF] - Change the way how we compute offsets for binary output.

Binary output feature is a bit confuzing. bfd and gold output differs a lot sometimes,
though it is important for FreeBSD mbr loaders.

Patch change the way how we compute file offsets for binary output.
This fixes PR31196.

Previously offsets were calculated basing on offsets and addresses of sections
from the same loads:
if (Sec == First)
  return alignTo(Off, Target->MaxPageSize, Sec->Addr);
return First->Offset + Sec->Addr - First->Addr;

bfd assigns offsets for each section to VA - MinVA:
https://github.com/redox-os/binutils-gdb/blob/master/bfd/binary.c#L27
https://github.com/redox-os/binutils-gdb/blob/master/bfd/binary.c#L255
(LMA == VA usually)

This patch for now just stops creating phdrs for binary output.
An effect from this that no any additional calculation for offset is performed:

uintX_t getFileAlignment(uintX_t Off, OutputSectionBase *Sec) {
OutputSectionBase *First = Sec->FirstInPtLoad;
// If the section is not in a PT_LOAD, we have no other constraint.
if (!First)
  return Off; //**First is always null, condition always happens**

That is enough now with combination of another patch to generate output
that is similar to what bfd produce for mbr loader.

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

llvm-svn: 288580

7 years ago[ELF] - Disable relro when -omagic specified.
George Rimar [Sat, 3 Dec 2016 07:09:28 +0000 (07:09 +0000)]
[ELF] - Disable relro when -omagic specified.

--omagic is an option to create old-fashioned executables in which
.text segments are writable. Today, the option is still in use to
create special-purpose programs such as boot loaders. It doesn't
make sense to create PT_GNU_RELRO for such executables.

DIfferential revision: https://reviews.llvm.org/D27297

llvm-svn: 288579

7 years ago[X86] Fix VEX encoded VPMADDUBSW to not be marked commutable.
Craig Topper [Sat, 3 Dec 2016 05:35:44 +0000 (05:35 +0000)]
[X86] Fix VEX encoded VPMADDUBSW to not be marked commutable.

This was accidentallly broken in r285515 when we started lowering the intrinsic to an ISD node. Should fix PR31241.

llvm-svn: 288578

7 years ago[X86] Add test cases demonstrating where we incorrectly commute VEX VPMADDUSBW due...
Craig Topper [Sat, 3 Dec 2016 05:35:38 +0000 (05:35 +0000)]
[X86] Add test cases demonstrating where we incorrectly commute VEX VPMADDUSBW due to a bug introduced in r285515.

I believe this is the cause of PR31241.

llvm-svn: 288577

7 years agoTurn off testsuite warnings by default with GCC
Eric Fiselier [Sat, 3 Dec 2016 03:29:45 +0000 (03:29 +0000)]
Turn off testsuite warnings by default with GCC

llvm-svn: 288576

7 years agoMake make_exception_ptr abort with -fno-exceptions
Eric Fiselier [Sat, 3 Dec 2016 03:22:11 +0000 (03:22 +0000)]
Make make_exception_ptr abort with -fno-exceptions

llvm-svn: 288575

7 years agoMark various <variant> items as complete
Eric Fiselier [Sat, 3 Dec 2016 02:47:40 +0000 (02:47 +0000)]
Mark various <variant> items as complete

llvm-svn: 288574

7 years agoWork around more -Wshadow warnings
Eric Fiselier [Sat, 3 Dec 2016 02:26:28 +0000 (02:26 +0000)]
Work around more -Wshadow warnings

llvm-svn: 288573

7 years agoRemove stale comment. NFC.
Michael Kuperstein [Sat, 3 Dec 2016 01:59:13 +0000 (01:59 +0000)]
Remove stale comment. NFC.

llvm-svn: 288572

7 years agoFix <variant> w/o exception support
Eric Fiselier [Sat, 3 Dec 2016 01:58:07 +0000 (01:58 +0000)]
Fix <variant> w/o exception support

llvm-svn: 288571

7 years agoSema: delay the DLL exported member referencing
Saleem Abdulrasool [Sat, 3 Dec 2016 01:57:47 +0000 (01:57 +0000)]
Sema: delay the DLL exported member referencing

An explicit template specialization can cause the implicit template
specialization of a type which inherits the attributes.  In such a case, we
would end up with a delayed template specialization for a dll exported type
which we would fail to reference.  This would trigger an assertion.

We now propagate the dll storage attributes through the inheritance
chain.  Only after having done so do we reference the delayed template
specializations.  This allows any implicit specializations which inherit dll
storage to also be referenced.

llvm-svn: 288570

7 years ago[TTI/CostModel] Correct the way getGEPCost() calls isLegalAddressingMode()
Haicheng Wu [Sat, 3 Dec 2016 01:57:24 +0000 (01:57 +0000)]
[TTI/CostModel] Correct the way getGEPCost() calls isLegalAddressingMode()

Fix a bug when we call isLegalAddressingMode() from getGEPCost().

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

llvm-svn: 288569

7 years ago[sanitizer-coverage] use IRB.SetCurrentDebugLocation after IRB.SetInsertPoint
Kostya Serebryany [Sat, 3 Dec 2016 01:43:30 +0000 (01:43 +0000)]
[sanitizer-coverage] use IRB.SetCurrentDebugLocation after IRB.SetInsertPoint

llvm-svn: 288568

7 years agotestcase only works in a debug build
Matthias Braun [Sat, 3 Dec 2016 01:42:32 +0000 (01:42 +0000)]
testcase only works in a debug build

llvm-svn: 288567

7 years agoRevert workaround for Clang bug. Thanks to Richard for the quick fix
Eric Fiselier [Sat, 3 Dec 2016 01:28:01 +0000 (01:28 +0000)]
Revert workaround for Clang bug. Thanks to Richard for the quick fix

llvm-svn: 288566

7 years ago[Sema] Don't perform aggregate initialization for types with explicit constructors
Eric Fiselier [Sat, 3 Dec 2016 01:26:47 +0000 (01:26 +0000)]
[Sema] Don't perform aggregate initialization for types with explicit constructors

Summary:
The C++17 rules for aggregate initialization changed to disallow types with explicit constructors [dcl.init.aggr]p1. This patch implements that new rule.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 288565

7 years agoFix -Wshadow warnings and enable warnings by default for C++ >= 11
Eric Fiselier [Sat, 3 Dec 2016 01:21:40 +0000 (01:21 +0000)]
Fix -Wshadow warnings and enable warnings by default for C++ >= 11

llvm-svn: 288564

7 years agoDR616, and part of P0135R1: member access (or pointer-to-member access) on a
Richard Smith [Sat, 3 Dec 2016 01:14:32 +0000 (01:14 +0000)]
DR616, and part of P0135R1: member access (or pointer-to-member access) on a
temporary produces an xvalue, not a prvalue. Support this by materializing the
temporary prior to performing the member access.

llvm-svn: 288563

7 years ago[doc] Add .arcconfig setup to the "how to work with a monorepo" section
Mehdi Amini [Sat, 3 Dec 2016 01:04:40 +0000 (01:04 +0000)]
[doc] Add .arcconfig setup to the "how to work with a monorepo" section

llvm-svn: 288562

7 years agoAArch64CollectLOH: Rewrite as block-local analysis.
Matthias Braun [Sat, 3 Dec 2016 00:52:56 +0000 (00:52 +0000)]
AArch64CollectLOH: Rewrite as block-local analysis.

Previously this pass was using up to 5% compile time in some cases which
is a bit much for what it is doing. The pass featured a full blown
data-flow analysis which in the default configuration was restricted to a
single block.

This rewrites the pass under the assumption that we only ever work on a
single block. This is done in a single pass maintaining a state machine
per general purpose register to catch LOH patterns.

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

llvm-svn: 288561

7 years ago[ppc] Correctly compute the cost of loading 32/64 bit memory into VSR
Guozhi Wei [Sat, 3 Dec 2016 00:41:43 +0000 (00:41 +0000)]
[ppc] Correctly compute the cost of loading 32/64 bit memory into VSR

VSX has instructions lxsiwax/lxsdx that can load 32/64 bit value into VSX register cheaply. That patch makes it known to memory cost model, so the vectorization of the test case in pr30990 is beneficial.

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

llvm-svn: 288560

7 years agoXFAIL variant tests for apple-clang
Eric Fiselier [Sat, 3 Dec 2016 00:33:03 +0000 (00:33 +0000)]
XFAIL variant tests for apple-clang

llvm-svn: 288559

7 years agoPR31244: Use the exception specification from the callee's type directly to
Richard Smith [Sat, 3 Dec 2016 00:29:06 +0000 (00:29 +0000)]
PR31244: Use the exception specification from the callee's type directly to
compute whether a call is noexcept, even if we can't map the callee expression
to a called declaration.

llvm-svn: 288558

7 years agoEnable warnings by default for C++ >= 11 and fix -Wshadow occurances
Eric Fiselier [Sat, 3 Dec 2016 00:27:13 +0000 (00:27 +0000)]
Enable warnings by default for C++ >= 11 and fix -Wshadow occurances

llvm-svn: 288557

7 years agoWork around Clang 3.8 bugs
Eric Fiselier [Sat, 3 Dec 2016 00:13:33 +0000 (00:13 +0000)]
Work around Clang 3.8 bugs

llvm-svn: 288556

7 years agoFix C++03 build
Eric Fiselier [Fri, 2 Dec 2016 23:41:18 +0000 (23:41 +0000)]
Fix C++03 build

llvm-svn: 288555

7 years agoMake variant's index part of the hash value
Eric Fiselier [Fri, 2 Dec 2016 23:38:31 +0000 (23:38 +0000)]
Make variant's index part of the hash value

llvm-svn: 288554

7 years agoSupport escaping in TrigramIndex.
Ivan Krasin [Fri, 2 Dec 2016 23:30:16 +0000 (23:30 +0000)]
Support escaping in TrigramIndex.

Summary:
This is a follow up to r288303, where I have introduced TrigramIndex
to speed up SpecialCaseList for the cases when all rules are
simple wildcards, like *hello*wor.d*.

Here, I add support for escaping, so that it's possible to
specify rules like *c\+\+abi*.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 288553

7 years agoFix generated warnings in <variant>
Eric Fiselier [Fri, 2 Dec 2016 23:17:33 +0000 (23:17 +0000)]
Fix generated warnings in <variant>

llvm-svn: 288552

7 years agoUpdate darwin ABI list for <variant>
Eric Fiselier [Fri, 2 Dec 2016 23:14:18 +0000 (23:14 +0000)]
Update darwin ABI list for <variant>

llvm-svn: 288551

7 years agoUpdate ABI lists for <variant>
Eric Fiselier [Fri, 2 Dec 2016 23:11:28 +0000 (23:11 +0000)]
Update ABI lists for <variant>

llvm-svn: 288550

7 years agoResubmit "[LibFuzzer] Split FuzzerUtil for Posix and Windows."
Zachary Turner [Fri, 2 Dec 2016 23:02:01 +0000 (23:02 +0000)]
Resubmit "[LibFuzzer] Split FuzzerUtil for Posix and Windows."

This resubmits r288529, which was resubmitted because it broke a
fuzzer bot.  According to kcc@ the test that broke was flakey
and it is unlikely to be a result of this patch.

llvm-svn: 288549

7 years agoMore diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_.
Richard Smith [Fri, 2 Dec 2016 23:00:28 +0000 (23:00 +0000)]
More diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_.
In passing, add a warning group for "ignored qualifier in inline assembly" warnings.

llvm-svn: 288548

7 years agoImplement C++17 <variant>. Patch from Michael Park!
Eric Fiselier [Fri, 2 Dec 2016 23:00:05 +0000 (23:00 +0000)]
Implement C++17 <variant>. Patch from Michael Park!

This patch was reviewed as https://reviews.llvm.org/D23263.

llvm-svn: 288547

7 years agoCodeGen: export typeinfo and typeinfo name on itanium
Saleem Abdulrasool [Fri, 2 Dec 2016 22:46:18 +0000 (22:46 +0000)]
CodeGen: export typeinfo and typeinfo name on itanium

When a C++ record is marked with dllexport mark both the typeinfo and the
typeinfo name as being exported.  Handle dllimport as the inverse.  This applies
to the itanium environment and not the MinGW environment.

llvm-svn: 288546

7 years agoMass-rename the handful of error_* diagnostics to err_*.
Richard Smith [Fri, 2 Dec 2016 22:38:31 +0000 (22:38 +0000)]
Mass-rename the handful of error_* diagnostics to err_*.

llvm-svn: 288545

7 years agoWork around a bug in Clang's implementation of noexcept function types
Eric Fiselier [Fri, 2 Dec 2016 22:30:52 +0000 (22:30 +0000)]
Work around a bug in Clang's implementation of noexcept function types

llvm-svn: 288544

7 years agoCheck for SD-6 feature test macro when determining which tests should be
Richard Smith [Fri, 2 Dec 2016 22:14:59 +0000 (22:14 +0000)]
Check for SD-6 feature test macro when determining which tests should be
available, rather than #ifdef'ing away the relevant tests if it's unavailable.

llvm-svn: 288543