platform/upstream/llvm.git
7 years ago[ThinLTO] Fix crash when importing an opaque type
Mehdi Amini [Sat, 19 Nov 2016 18:44:16 +0000 (18:44 +0000)]
[ThinLTO] Fix crash when importing an opaque type

It seems that because ThinLTO does not import the full module,
some invariant of the type mapper are broken.

In Monolithic LTO, we import every globals: when calling
IRLinker::copyFunctionProto() on @foo(), we end-up calling
TypeMapTy::get(FTy) on the type of @foo(), which will map
%0 and record the destination as opaque.

ThinLTO skips this because @foo is not imported and goes directly
to the next stage.

Next we call computeTypeMapping() that map the types for each
globals, and ends up checking for type isomorphism, and may add
type mapping. However it doesn't record if there was an opaque
destination type that was resolved.

Instead of lazily "discovering" opaque type in the destination
module on the go, we change the TypeFinder to eagerly record all
types and not only the named ones.

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

llvm-svn: 287453

7 years agoSplit getFdeEncoding.
Rui Ueyama [Sat, 19 Nov 2016 18:44:09 +0000 (18:44 +0000)]
Split getFdeEncoding.

llvm-svn: 287452

7 years agoFix typo in error message.
Rui Ueyama [Sat, 19 Nov 2016 18:34:55 +0000 (18:34 +0000)]
Fix typo in error message.

llvm-svn: 287451

7 years ago[ThinLTO] Implement -pass-remarks-output in ThinLTOCodeGenerator
Mehdi Amini [Sat, 19 Nov 2016 18:20:05 +0000 (18:20 +0000)]
[ThinLTO] Implement -pass-remarks-output in ThinLTOCodeGenerator

Summary:
This will also be added to the LTO API, right now this will
bring ThinLTO on par with Monolithic LTO on Darwin.

Reviewers: anemet

Subscribers: tejohnson, llvm-commits

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

llvm-svn: 287450

7 years agoChange setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC)
Mehdi Amini [Sat, 19 Nov 2016 18:19:41 +0000 (18:19 +0000)]
Change setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC)

Summary:
This makes it explicit that ownership is taken. Also replace all `new`
with make_unique<> at call sites.

Reviewers: anemet

Subscribers: llvm-commits

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

llvm-svn: 287449

7 years ago[ELF] - Exit on --version call.
George Rimar [Sat, 19 Nov 2016 18:14:24 +0000 (18:14 +0000)]
[ELF] - Exit on --version call.

GNU linkers disagree here.
Though both -version and -v are mentioned
in help to print the version information, GNU ld just normally exits,
while gold can continue linking. We are compatible with ld.bfd here.

This fixes PR31057.

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

llvm-svn: 287448

7 years ago[X86][AVX512] Add avx512vbmi tests
Simon Pilgrim [Sat, 19 Nov 2016 18:12:48 +0000 (18:12 +0000)]
[X86][AVX512] Add avx512vbmi tests

llvm-svn: 287447

7 years agoSimplify. NFC.
Rui Ueyama [Sat, 19 Nov 2016 18:05:58 +0000 (18:05 +0000)]
Simplify. NFC.

llvm-svn: 287446

7 years agoChange filler type from ArrayRef<uint8_t> to uint32_t.
Rui Ueyama [Sat, 19 Nov 2016 18:05:56 +0000 (18:05 +0000)]
Change filler type from ArrayRef<uint8_t> to uint32_t.

Filler expressions in linker script "=fillexp" are always handled
as 32-bit integers. Thus the new type is more natural.

llvm-svn: 287445

7 years ago[X86][AVX512] Added some more complex v64i8 shuffles
Simon Pilgrim [Sat, 19 Nov 2016 17:50:14 +0000 (17:50 +0000)]
[X86][AVX512] Added some more complex v64i8 shuffles

llvm-svn: 287444

7 years ago[X86] Simplify some code a little by removing a dulicate variable and combinining...
Craig Topper [Sat, 19 Nov 2016 17:33:17 +0000 (17:33 +0000)]
[X86] Simplify some code a little by removing a dulicate variable and combinining two if statements. NFCI

llvm-svn: 287443

7 years agoTry again to fix unused variable warning on lld-x86_64-darwin13 after r287439.
Daniel Sanders [Sat, 19 Nov 2016 14:47:41 +0000 (14:47 +0000)]
Try again to fix unused variable warning on lld-x86_64-darwin13 after r287439.

The previous attempt didn't work. I assume LLVM_ATTRIBUTE_UNUSED isn't
available on that machine.

llvm-svn: 287442

7 years agoTry to fix unused variable warning on lld-x86_64-darwin13 after r287439.
Daniel Sanders [Sat, 19 Nov 2016 13:50:32 +0000 (13:50 +0000)]
Try to fix unused variable warning on lld-x86_64-darwin13 after r287439.

Whether the variable is used or not depends on NDEBUG.

llvm-svn: 287440

7 years agoCheck that emitted instructions meet their predicates on all targets except ARM,...
Daniel Sanders [Sat, 19 Nov 2016 13:05:44 +0000 (13:05 +0000)]
Check that emitted instructions meet their predicates on all targets except ARM, Mips, and X86.

Summary:
* ARM is omitted from this patch because this check appears to expose bugs in this target.
* Mips is omitted from this patch because this check either detects bugs or deliberate
  emission of instructions that don't satisfy their predicates. One deliberate
  use is the SYNC instruction where the version with an operand is correctly
  defined as requiring MIPS32 while the version without an operand is defined
  as an alias of 'SYNC 0' and requires MIPS2.
* X86 is omitted from this patch because it doesn't use the tablegen-erated
  MCCodeEmitter infrastructure.

Patches for ARM and Mips will follow.

Depends on D25617

Reviewers: tstellarAMD, jmolloy

Subscribers: wdng, jmolloy, aemerson, rengolin, arsenm, jyknight, nemanjai, nhaehnle, tstellarAMD, llvm-commits

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

llvm-svn: 287439

7 years ago[tablegen] Merge duplicate definitions of getMinimalTypeForRange. NFC.
Daniel Sanders [Sat, 19 Nov 2016 12:21:34 +0000 (12:21 +0000)]
[tablegen] Merge duplicate definitions of getMinimalTypeForRange. NFC.

Summary: Depends on D25614

Reviewers: qcolombet

Subscribers: qcolombet, beanz, mgorny, llvm-commits

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

llvm-svn: 287438

7 years agoIntroduce a helper class for building complex constant initializers. NFC.
John McCall [Sat, 19 Nov 2016 08:17:24 +0000 (08:17 +0000)]
Introduce a helper class for building complex constant initializers.  NFC.

I've adopted this in most of the places it makes sense, but v-tables
and CGObjCMac will need a second pass.

llvm-svn: 287437

7 years agoDoxygen comments for avxintrin.h.
Ekaterina Romanova [Sat, 19 Nov 2016 04:59:08 +0000 (04:59 +0000)]
Doxygen comments for avxintrin.h.

Added doxygen comments to avxintrin.h's intrinsics. As of now, all the intrinsics in this file that were documented by Sony's intrinsics guide should have corresponding doxygen comments.

Note: The doxygen comments are automatically generated based on Sony's intrinsic
s document.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream.

Reviewed by Wolfgang Pieb.

llvm-svn: 287436

7 years agoFix stdint/cstdint modules
Eric Fiselier [Sat, 19 Nov 2016 03:29:03 +0000 (03:29 +0000)]
Fix stdint/cstdint modules

llvm-svn: 287435

7 years ago[CMake] llvm-lto2 depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 03:19:58 +0000 (03:19 +0000)]
[CMake] llvm-lto2 depends on intrinsics_gen

llvm-lto2.cpp has the following include chain:

llvm/LTO/Caching.h
llvm/LTO/LTO.h
llvm/CodeGen/Analysis.h
llvm/IR/CallSite.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-lto2 needs to depend on intrinsics_gen.

llvm-svn: 287434

7 years ago[CMake] opt depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 03:18:50 +0000 (03:18 +0000)]
[CMake] opt depends on intrinsics_gen

AnalysisWrappers.cpp has the following include chain:

llvm/Analysis/CallGraph.h
llvm/IR/CallSite.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means opt needs to depend on intrinsics_gen.

llvm-svn: 287433

7 years ago[CMake] llvm-nm depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 03:16:33 +0000 (03:16 +0000)]
[CMake] llvm-nm depends on intrinsics_gen

llvm-nm.cpp has the following include chain:

llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-nm needs to depend on intrinsics_gen.

llvm-svn: 287432

7 years ago[CMake] llvm-link depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 02:36:28 +0000 (02:36 +0000)]
[CMake] llvm-link depends on intrinsics_gen

llvm-link.cpp has the following include chain:

llvm/Bitcode/BitcodeWriter.h
llvm/IR/ModuleSummaryIndex.h
llvm/IR/Module.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-link needs to depend on intrinsics_gen.

llvm-svn: 287431

7 years ago[CMake] llvm-extract depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 02:33:57 +0000 (02:33 +0000)]
[CMake] llvm-extract depends on intrinsics_gen

llvm-extract.cpp has the following include chain:

llvm/Bitcode/BitcodeWriterPass.h
llvm/IR/PassManager.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-extract needs to depend on intrinsics_gen.

llvm-svn: 287430

7 years ago[CMake] llvm-dwp depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 02:33:42 +0000 (02:33 +0000)]
[CMake] llvm-dwp depends on intrinsics_gen

llvm-dwp.cpp has the following include chain:

llvm/CodeGen/AsmPrinter.h
llvm/CodeGen/MachineFunctionPass.h
llvm/CodeGen/MachineFunction.h
llvm/CodeGen/MachineBasicBlock.h
llvm/CodeGen/MachineInstr.h
llvm/Analysis/AliasAnalysis.h
llvm/IR/CallSite.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-dwp needs to depend on intrinsics_gen.

llvm-svn: 287429

7 years ago[CMake] llvm-dis depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 02:31:14 +0000 (02:31 +0000)]
[CMake] llvm-dis depends on intrinsics_gen

llvm-dis.cpp has the following include chain:

llvm/Bitcode/BitcodeReader.h
llvm/IR/ModuleSummaryIndex.h
llvm/IR/Module.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-dis needs to depend on intrinsics_gen.

llvm-svn: 287428

7 years ago[CMake] llvm-diff depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 02:28:18 +0000 (02:28 +0000)]
[CMake] llvm-diff depends on intrinsics_gen

llvm-diff.cpp has the following include chain:

llvm/IR/Module.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-diff needs to depend on intrinsics_gen.

llvm-svn: 287427

7 years ago[CMake] llvm-stress depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 02:25:54 +0000 (02:25 +0000)]
[CMake] llvm-stress depends on intrinsics_gen

llvm-stress.cpp has the following include chain:

llvm/Analysis/CallGraphSCCPass.h
llvm/Analysis/CallGraph.h
llvm/IR/CallSite.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-stress needs to depend on intrinsics_gen.

llvm-svn: 287426

7 years ago[CMake] bugpoint-passes depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 02:20:59 +0000 (02:20 +0000)]
[CMake] bugpoint-passes depends on intrinsics_gen

TestPasses.cpp has the following include chain:

llvm/IR/InstVisitor.h
llvm/IR/CallSite.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means bugpoint-passes needs to depend on intrinsics_gen.

llvm-svn: 287425

7 years ago[CMake] llvm-bcanalyzer depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 02:17:12 +0000 (02:17 +0000)]
[CMake] llvm-bcanalyzer depends on intrinsics_gen

llvm-bcanalyzer.cpp has the following include chain:

llvm/Bitcode/BitcodeReader.h
llvm/IR/ModuleSummaryIndex.h
llvm/IR/Module.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-bcanalyzer needs to depend on intrinsics_gen.

llvm-svn: 287424

7 years ago[CMake] llvm-as depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 02:15:04 +0000 (02:15 +0000)]
[CMake] llvm-as depends on intrinsics_gen

llvm-as.cpp has the following include chain:

llvm/Bitcode/BitcodeWriter.h
llvm/IR/ModuleSummaryIndex.h
llvm/IR/Module.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-as needs to depend on intrinsics_gen.

llvm-svn: 287423

7 years ago[CMake] llc depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 02:12:03 +0000 (02:12 +0000)]
[CMake] llc depends on intrinsics_gen

llc.cpp has the following include chain:

llvm/Analysis/TargetLibraryInfo.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llc needs to depend on intrinsics_gen.

llvm-svn: 287422

7 years ago[CMake] lli-child-target depends on intrinsics gen
Chris Bieneman [Sat, 19 Nov 2016 02:09:51 +0000 (02:09 +0000)]
[CMake] lli-child-target depends on intrinsics gen

Messed up in r287420, it isn't just lli, but also but lli-child-target that need to depend on intrinsics_gen.

llvm-svn: 287421

7 years ago[CMake] lli depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 02:05:19 +0000 (02:05 +0000)]
[CMake] lli depends on intrinsics_gen

ChildTarget.cpp has the following include chain:

llvm/ExecutionEngine/Orc/OrcABISupport.h
llvm/ExecutionEngine/Orc/IndirectionUtils.h
llvm/IR/IRBuilder.h
llvm/IR/ConstantFolder.h
llvm/IR/InstrTypes.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means lli needs to depend on intrinsics_gen.

llvm-svn: 287420

7 years ago[CMake] llvm-dsymutil depends on intrinsics_gen
Chris Bieneman [Sat, 19 Nov 2016 02:02:46 +0000 (02:02 +0000)]
[CMake] llvm-dsymutil depends on intrinsics_gen

DwarfLinker.cpp has the following include chain:

llvm/CodeGen/AsmPrinter.h
llvm/CodeGen/MachineFunctionPass.h
llvm/CodeGen/MachineFunction.h
llvm/CodeGen/MachineBasicBlock.h
llvm/CodeGen/MachineInstr.h
llvm/Analysis/AliasAnalysis.h
llvm/IR/CallSite.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-dsymutil needs to depend on intrinsics_gen.

llvm-svn: 287419

7 years agoMark test as unsupported in C++03
Eric Fiselier [Sat, 19 Nov 2016 01:38:00 +0000 (01:38 +0000)]
Mark test as unsupported in C++03

llvm-svn: 287417

7 years ago[AVR] Remove a bunch of unused variables
Dylan McKay [Sat, 19 Nov 2016 01:33:42 +0000 (01:33 +0000)]
[AVR] Remove a bunch of unused variables

llvm-svn: 287416

7 years ago[CMake] Apply sandbox profile to target not directory
Chris Bieneman [Sat, 19 Nov 2016 01:32:09 +0000 (01:32 +0000)]
[CMake] Apply sandbox profile to target not directory

When LLVM_DEPENDENCY_DEBUGGING=On we should apply the sandbox only on the target, not the directory. This is important for directories that create more than one target, or for nested directories.

llvm-svn: 287415

7 years ago[AVR] Remove a variable which was unused in release mode
Dylan McKay [Sat, 19 Nov 2016 01:14:44 +0000 (01:14 +0000)]
[AVR] Remove a variable which was unused in release mode

In release mode where assertions are not enabled, this caused an 'unused
variable' warning.

llvm-svn: 287414

7 years ago[libcxx] Implement locale.h to fix modules build
Eric Fiselier [Sat, 19 Nov 2016 01:14:15 +0000 (01:14 +0000)]
[libcxx] Implement locale.h to fix modules build

Summary:
Because `locale.h` isn't part of the libc++ modules the class definitions it provides are exported as part of `__locale` (since it happens to be build first). This breaks `<clocale>` which exports `std::lconv` without including `<__locale>`.

This patch implements `locale.h` to fix this issue, it also adds support for testing libc++ with modules.

Reviewers: mclow.lists, rsmith, EricWF

Subscribers: cfe-commits

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

llvm-svn: 287413

7 years agoFix some accidental Prints of StringRefs that snuck in.
Zachary Turner [Sat, 19 Nov 2016 00:50:29 +0000 (00:50 +0000)]
Fix some accidental Prints of StringRefs that snuck in.

llvm-svn: 287412

7 years agoSema: As of MSVC 2015, a user-declared move operation causes the deletion of both...
Peter Collingbourne [Sat, 19 Nov 2016 00:30:56 +0000 (00:30 +0000)]
Sema: As of MSVC 2015, a user-declared move operation causes the deletion of both copy operations.

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

llvm-svn: 287411

7 years ago[Sema] Don't allow applying address-of operator to a call to a function
Akira Hatanaka [Sat, 19 Nov 2016 00:13:03 +0000 (00:13 +0000)]
[Sema] Don't allow applying address-of operator to a call to a function
with __unknown_anytype return type.

When the following code is compiled, Sema infers that the type of
__unknown_anytype is double:

extern __unknown_anytype func();
double *d = (double*)&func();

This triggers an assert in CodeGenFunction::EmitCallExprLValue because
it doesn't expect to see a call to a function with a non-reference
scalar return type.

This commit prevents the assert by making VisitUnaryAddrOf error out if
the address-of operator is applied to a call to a function with
__unknown_anytype return type.

rdar://problem/20287610

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

llvm-svn: 287410

7 years agoFix some build errors.
Zachary Turner [Fri, 18 Nov 2016 23:32:37 +0000 (23:32 +0000)]
Fix some build errors.

llvm-svn: 287409

7 years ago[CMake] NFC. Updating CMake dependency specifications
Chris Bieneman [Fri, 18 Nov 2016 23:31:53 +0000 (23:31 +0000)]
[CMake] NFC. Updating CMake dependency specifications

This patch updates a bunch of places where add_dependencies was being explicitly called to add dependencies on intrinsics_gen to instead use the DEPENDS named parameter. This cleanup is needed for a patch I'm working on to add a dependency debugging mode to the build system.

llvm-svn: 287408

7 years ago[CMake] clang depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:31:16 +0000 (23:31 +0000)]
[CMake] clang depends on intrinsics_gen

cc1_main.cpp has the following include chain:

llvm/LinkAllPasses.h
llvm/Analysis/AliasSetTracker.h
llvm/Analysis/AliasAnalysis.h
llvm/IR/CallSite.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means clang needs to depend on intrinsics_gen.

llvm-svn: 287407

7 years ago[CMake] clang-offload-bundler depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:31:14 +0000 (23:31 +0000)]
[CMake] clang-offload-bundler depends on intrinsics_gen

ClangOffloadBundler.cpp has the following include chain:

llvm/Bitcode/BitcodeWriter.h
llvm/IR/ModuleSummaryIndex.h
llvm/IR/Module.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means clang-offload-bundler needs to depend on intrinsics_gen.

llvm-svn: 287406

7 years ago[CMake] verify-uselistorder depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:30:58 +0000 (23:30 +0000)]
[CMake] verify-uselistorder depends on intrinsics_gen

verify-uselistorder.cpp has the following include chain:

llvm/Bitcode/BitcodeReader.h
llvm/IR/ModuleSummaryIndex.h
llvm/IR/Module.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means verify-uselistorder needs to depend on intrinsics_gen.

llvm-svn: 287405

7 years ago[CMake] sanstats depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:30:39 +0000 (23:30 +0000)]
[CMake] sanstats depends on intrinsics_gen

sanstats.cpp has the following include chain:

llvm/Transforms/Utils/SanitizerStats.h
llvm/IR/IRBuilder.h
llvm/IR/ConstantFolder.h
llvm/IR/InstrTypes.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means sanstats needs to depend on intrinsics_gen.

llvm-svn: 287404

7 years ago[lit] When setting SDKROOT on Darwin, use '--sdk macosx' to find the right SDK path.
Kuba Mracek [Fri, 18 Nov 2016 23:25:57 +0000 (23:25 +0000)]
[lit] When setting SDKROOT on Darwin, use '--sdk macosx' to find the right SDK path.

This will make sure that we find an actual path in case you have Command Line Tools installed.

llvm-svn: 287403

7 years ago[CMake] bugpoint depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:25:30 +0000 (23:25 +0000)]
[CMake] bugpoint depends on intrinsics_gen

CrashDebugger.cpp has the following include chain:

llvm/Analysis/TargetTransformInfo.h
llvm/IR/IntrinsicInst.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means bugpoint needs to depend on intrinsics_gen.

llvm-svn: 287402

7 years agoConvert CommandHistory functions to StringRef.
Zachary Turner [Fri, 18 Nov 2016 23:22:42 +0000 (23:22 +0000)]
Convert CommandHistory functions to StringRef.

llvm-svn: 287401

7 years ago[InstCombine] add tests to show likely unwanted select widening; NFC
Sanjay Patel [Fri, 18 Nov 2016 23:22:00 +0000 (23:22 +0000)]
[InstCombine] add tests to show likely unwanted select widening; NFC

This is a prerequisite patch for D26556:
https://reviews.llvm.org/D26556

...because there was no direct coverage for these folds (which in some cases are adding instructions).

llvm-svn: 287400

7 years ago[CMake] llvm-split depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:20:38 +0000 (23:20 +0000)]
[CMake] llvm-split depends on intrinsics_gen

llvm-split.cpp has the following include chain:

llvm/Bitcode/BitcodeWriter.h
llvm/IR/ModuleSummaryIndex.h
llvm/IR/Module.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-split needs to depend on intrinsics_gen.

llvm-svn: 287399

7 years ago[CMake] llvm-lto depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:20:35 +0000 (23:20 +0000)]
[CMake] llvm-lto depends on intrinsics_gen

llvm-lto.cpp has the following include chain:

llvm/Bitcode/BitcodeReader.h
llvm/IR/ModuleSummaryIndex.h
llvm/IR/Module.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-lto needs to depend on intrinsics_gen.

llvm-svn: 287398

7 years agoRemoving myself from CODE_OWNERS, and distributing those duties among other members...
Enrico Granata [Fri, 18 Nov 2016 23:18:11 +0000 (23:18 +0000)]
Removing myself from CODE_OWNERS, and distributing those duties among other members of the community

That's All, Folks

llvm-svn: 287397

7 years ago[CMake] llvm-ar depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:04:27 +0000 (23:04 +0000)]
[CMake] llvm-ar depends on intrinsics_gen

llvm-ar.cpp has the following include chain:

llvm/IR/Module.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-ar needs to depend on intrinsics_gen.

llvm-svn: 287395

7 years ago[CMake] llvm-profdata depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:04:15 +0000 (23:04 +0000)]
[CMake] llvm-profdata depends on intrinsics_gen

llvm-profdata.cpp has the following include chain:

llvm/ProfileData/SampleProfReader.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means llvm-profdata needs to depend on intrinsics_gen.

llvm-svn: 287394

7 years ago[CMake] LTO depends on intrinsics_gen
Chris Bieneman [Fri, 18 Nov 2016 23:03:51 +0000 (23:03 +0000)]
[CMake] LTO depends on intrinsics_gen

lto.cpp has the following include chain:

llvm/Bitcode/BitcodeReader.h
llvm/IR/ModuleSummaryIndex.h
llvm/IR/Module.h
llvm/IR/Function.h
llvm/IR/Argument.h
llvm/IR/Attributes.h
llvm/IR/Attributes.gen

This means LTO needs to depend on intrinsics_gen.

llvm-svn: 287393

7 years ago[libcxx] [test] D26812: In random tests, use real static_asserts and silence a warning.
Stephan T. Lavavej [Fri, 18 Nov 2016 22:45:32 +0000 (22:45 +0000)]
[libcxx] [test] D26812: In random tests, use real static_asserts and silence a warning.

In C++11 mode and newer, use real static_asserts.
In C++03 mode, min() and max() aren't constexpr, so use plain asserts.

One test triggers MSVC's warning C4310 "cast truncates constant value".
The code is valid, and yet the warning is valid, so I'm silencing it
through push-disable-pop.

llvm-svn: 287391

7 years ago[AMDGPU] Change frexp.exp builtin to return i16 for f16 input
Konstantin Zhuravlyov [Fri, 18 Nov 2016 22:31:51 +0000 (22:31 +0000)]
[AMDGPU] Change frexp.exp builtin to return i16 for f16 input

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

llvm-svn: 287390

7 years ago[AMDGPU] Change frexp.exp intrinsic to return i16 for f16 input
Konstantin Zhuravlyov [Fri, 18 Nov 2016 22:31:08 +0000 (22:31 +0000)]
[AMDGPU] Change frexp.exp intrinsic to return i16 for f16 input

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

llvm-svn: 287389

7 years agoAllow using libsupc++ with LIBCXX_ENABLE_STATIC_ABI_LIBRARY. Patch from Michael Daniels.
Eric Fiselier [Fri, 18 Nov 2016 22:25:41 +0000 (22:25 +0000)]
Allow using libsupc++ with LIBCXX_ENABLE_STATIC_ABI_LIBRARY. Patch from Michael Daniels.

The code cannot currently link when using libsupc++ with the
LIBCXX_ENABLE_STATIC_ABI_LIBRARY option.

This change ifdef's out the the destructor and 'what' function for
bad_array_length and bad_array_new_length when GLIBCXX is defined.
The constructors that are left in are the only functions not being provided by
libsupc++ itself, and follows the same pattern that was used to ifdef bad_alloc.

Testing was done on a Linux x86_64 host using GCC 5.4 and libc++ from ToT.
I see no change to the test results when using libsup++ or libstdc++ without
LIBCXX_ENABLE_STATIC_ABI_LIBRARY. When using libsupc++ with
LIBCXX_ENABLE_STATIC_ABI_LIBRARY it will now build and test results are the
same as those without the option specified.

Reviewed as https://reviews.llvm.org/D26186

llvm-svn: 287388

7 years ago[SelectionDAG] Add knowbits support for CONCAT_VECTOR opcode
Simon Pilgrim [Fri, 18 Nov 2016 22:21:22 +0000 (22:21 +0000)]
[SelectionDAG] Add knowbits support for CONCAT_VECTOR opcode

llvm-svn: 287387

7 years agoFix "thread step until" handling of multiple line inputs.
Jim Ingham [Fri, 18 Nov 2016 22:06:10 +0000 (22:06 +0000)]
Fix "thread step until" handling of multiple line inputs.

Also document that it handles same, and add some tests.

llvm-svn: 287386

7 years ago[X86] Add knownbits concat_vector test
Simon Pilgrim [Fri, 18 Nov 2016 21:59:38 +0000 (21:59 +0000)]
[X86] Add knownbits concat_vector test

Support coming in a future patch

llvm-svn: 287385

7 years ago[Examples] Fix some Clang-tidy modernize-use-default and Include What You Use warning...
Eugene Zelenko [Fri, 18 Nov 2016 21:57:58 +0000 (21:57 +0000)]
[Examples] Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes.

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

llvm-svn: 287384

7 years ago[libcxx] [test] D26816: Fix non-Standard assumptions when testing sample().
Stephan T. Lavavej [Fri, 18 Nov 2016 21:54:43 +0000 (21:54 +0000)]
[libcxx] [test] D26816: Fix non-Standard assumptions when testing sample().

sample() isn't specified with a reproducible algorithm, so expecting
exact output is non-Standard. Mark those tests with LIBCPP_ASSERT.

In test_small_population(), we're guaranteed to get all of the elements,
but not necessarily in their original order. When PopulationCategory is
forward, we're guaranteed stability (and can therefore test equal()).
Otherwise, we can only test is_permutation(). (As it happens, both libcxx
and MSVC's STL provide stability in this scenario for input-only iterators.)

llvm-svn: 287383

7 years ago[libcxx] [test] D26815: Fix an assumption about the state of moved-from std::functions.
Stephan T. Lavavej [Fri, 18 Nov 2016 21:54:38 +0000 (21:54 +0000)]
[libcxx] [test] D26815: Fix an assumption about the state of moved-from std::functions.

The Standard doesn't provide any guarantees beyond "valid but unspecified" for
moved-from std::functions. libcxx moves from small targets and leaves them
there, while MSVC's STL empties out the source. Mark these assertions as
libcxx-specific.

llvm-svn: 287382

7 years ago[libcxx] [test] D26813: allocator<const T> is non-Standard.
Stephan T. Lavavej [Fri, 18 Nov 2016 21:54:31 +0000 (21:54 +0000)]
[libcxx] [test] D26813: allocator<const T> is non-Standard.

N4582 17.6.3.5 [allocator.requirements] says that allocators are given
cv-unqualified object types, and N4582 20.9.9 [default.allocator]
implies that allocator<const T> is ill-formed (due to colliding
address() overloads). Therefore, tests for allocator<const T>
should be marked as libcxx-specific (if not removed outright).

llvm-svn: 287381

7 years ago[analyzer] Refactor recursive symbol reachability check to use symbol_iterator
Dominic Chen [Fri, 18 Nov 2016 21:07:03 +0000 (21:07 +0000)]
[analyzer] Refactor recursive symbol reachability check to use symbol_iterator

Reviewers: zaks.anna, dcoughlin

Subscribers: cfe-commits

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

llvm-svn: 287380

7 years ago[LoopSimplify] Preserve LCSSA when removing edges from unreachable blocks.
Michael Zolotukhin [Fri, 18 Nov 2016 21:01:12 +0000 (21:01 +0000)]
[LoopSimplify] Preserve LCSSA when removing edges from unreachable blocks.

This fixes PR30454.

llvm-svn: 287379

7 years ago[ARM] Fix sema check of ARM special register names
Oleg Ranevskyy [Fri, 18 Nov 2016 21:00:08 +0000 (21:00 +0000)]
[ARM] Fix sema check of ARM special register names

Summary:
This is a simple sema check patch for arguments of `__builtin_arm_rsr` and the related builtins, which currently do not allow special registers with indexes >7.

Some of the possible register name formats these builtins accept are:
```
{c}p<coprocessor>:<op1>:c<CRn>:c<CRm>:<op2>
```
```
o0:op1:CRn:CRm:op2
```
where `op1` / `op2` are integers in the range [0, 7] and `CRn` / `CRm` are integers in the range [0, 15].

The current sema check does not allow `CRn` > 7 and accepts `op2` up to 15.

Reviewers: LukeCheeseman, rengolin

Subscribers: asl, aemerson, rengolin, cfe-commits

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

llvm-svn: 287378

7 years agorename InternalBinarySearch to InternalLowerBound
Mike Aizatsky [Fri, 18 Nov 2016 20:48:52 +0000 (20:48 +0000)]
rename InternalBinarySearch to InternalLowerBound

Summary: The new name better corresponds to its logic.

Reviewers: kcc

Subscribers: kubabrecka

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

llvm-svn: 287377

7 years agoChange CreateTarget and dependents to accept StringRef.
Zachary Turner [Fri, 18 Nov 2016 20:44:46 +0000 (20:44 +0000)]
Change CreateTarget and dependents to accept StringRef.

llvm-svn: 287376

7 years ago[MIRPrinter] XFAIL test for powerpc
Geoff Berry [Fri, 18 Nov 2016 20:08:05 +0000 (20:08 +0000)]
[MIRPrinter] XFAIL test for powerpc

This test introduced in r287368 is failing on powerpc for reasons
unrelated to branch probabilities.  See PR31062.

llvm-svn: 287375

7 years agoRevert "Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch"
Mehdi Amini [Fri, 18 Nov 2016 20:02:34 +0000 (20:02 +0000)]
Revert "Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch"

This reverts commit r287352, LLDB CI is broken.

llvm-svn: 287374

7 years agoMake LIBCXX_ENABLE_STATIC_ABI_LIBRARY merge libc++.a and libc++abi.a
Eric Fiselier [Fri, 18 Nov 2016 19:53:45 +0000 (19:53 +0000)]
Make LIBCXX_ENABLE_STATIC_ABI_LIBRARY merge libc++.a and libc++abi.a

llvm-svn: 287373

7 years agoSimplify. NFC.
Rui Ueyama [Fri, 18 Nov 2016 19:45:04 +0000 (19:45 +0000)]
Simplify. NFC.

llvm-svn: 287372

7 years agoAdapt to llvm NamedRegionTimer changes
Matthias Braun [Fri, 18 Nov 2016 19:43:25 +0000 (19:43 +0000)]
Adapt to llvm NamedRegionTimer changes

We have to specify a name and description for the timers and groups now.

llvm-svn: 287371

7 years agoStatistic/Timer: Include timers in PrintStatisticsJSON().
Matthias Braun [Fri, 18 Nov 2016 19:43:24 +0000 (19:43 +0000)]
Statistic/Timer: Include timers in PrintStatisticsJSON().

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

llvm-svn: 287370

7 years agoTimer: Track name and description.
Matthias Braun [Fri, 18 Nov 2016 19:43:18 +0000 (19:43 +0000)]
Timer: Track name and description.

The previously used "names" are rather descriptions (they use multiple
words and contain spaces), use short programming language identifier
like strings for the "names" which should be used when exporting to
machine parseable formats.

Also removed a unused TimerGroup from Hexxagon.

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

llvm-svn: 287369

7 years ago[MIRPrinter] Print raw branch probabilities as expected by MIRParser
Geoff Berry [Fri, 18 Nov 2016 19:37:24 +0000 (19:37 +0000)]
[MIRPrinter] Print raw branch probabilities as expected by MIRParser

Fixes PR28751.

Reviewers: MatzeB, qcolombet

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 287368

7 years agoRe-add the StringRef interface changes for Variable.
Zachary Turner [Fri, 18 Nov 2016 19:23:39 +0000 (19:23 +0000)]
Re-add the StringRef interface changes for Variable.

This concludes the changes I originally tried to make and then
had to back out.  This way if anything is still broken, it
should be easier to bisect it back to a more specific changeset.

llvm-svn: 287367

7 years ago[CMake] Fixing variable names that were mistyped
Chris Bieneman [Fri, 18 Nov 2016 19:20:39 +0000 (19:20 +0000)]
[CMake] Fixing variable names that were mistyped

This is a silly bug that I'm sure I caused...

llvm-svn: 287366

7 years agoSimplify handling of SHF_LINK_ORDER.
Rafael Espindola [Fri, 18 Nov 2016 19:02:15 +0000 (19:02 +0000)]
Simplify handling of SHF_LINK_ORDER.

It seems a lot simpler to just sort the sections and let the
relocations do the rest.

llvm-svn: 287365

7 years ago__cxa_demangle: use default member initialization
Saleem Abdulrasool [Fri, 18 Nov 2016 19:01:53 +0000 (19:01 +0000)]
__cxa_demangle: use default member initialization

Sink the Db initialization into the structure rather than out-of-line at the
declaration size.  This just makes it easier to see what initialization is being
performed.  NFC.

llvm-svn: 287364

7 years agoAMDGPU: Fix unused variable warning
Matt Arsenault [Fri, 18 Nov 2016 18:33:36 +0000 (18:33 +0000)]
AMDGPU: Fix unused variable warning

llvm-svn: 287362

7 years agoFix test from r287353: don't use /dev/null
Hans Wennborg [Fri, 18 Nov 2016 18:27:31 +0000 (18:27 +0000)]
Fix test from r287353: don't use /dev/null

llvm-svn: 287360

7 years agobuiltins: repair the builtins build with clang 3.8
Saleem Abdulrasool [Fri, 18 Nov 2016 18:21:06 +0000 (18:21 +0000)]
builtins: repair the builtins build with clang 3.8

When the C unwinding personality was corrected to match the ARM EHABI
specification, the unwind header in clang was updated with necessary
declarations.  However, when building with an older compiler, we would not have
the necessary declarations.  This would result in a build failure.  Provide a
supplementary header to ensure that the necessary declarations are present for
the build of the C unwinding personality.

Note that this is NOT an ABI break.  It merely is a compile time failure due to
the constants not being present.  The constants here are reproduced
equivalently.  This header should permit building with clang[<3.9] as well as
gcc.

Addresses PR31035!

llvm-svn: 287359

7 years agoLTO support for -fsave-optimization-record on Darwin
Adam Nemet [Fri, 18 Nov 2016 18:17:36 +0000 (18:17 +0000)]
LTO support for -fsave-optimization-record on Darwin

I guess this would have to be added for each linker.

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

llvm-svn: 287358

7 years agoFix a comment for -fsave-optimization-record
Adam Nemet [Fri, 18 Nov 2016 18:17:33 +0000 (18:17 +0000)]
Fix a comment for -fsave-optimization-record

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

llvm-svn: 287357

7 years ago[LTO] Add option to generate optimization records
Adam Nemet [Fri, 18 Nov 2016 18:06:28 +0000 (18:06 +0000)]
[LTO] Add option to generate optimization records

It is used to drive this from the clang driver via -mllvm.

Same option name is used as in opt.

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

llvm-svn: 287356

7 years ago[DebugInfo] Fix some Clang-tidy modernize-use-default, modernize-use-equal-delete...
Eugene Zelenko [Fri, 18 Nov 2016 18:00:19 +0000 (18:00 +0000)]
[DebugInfo] Fix some Clang-tidy modernize-use-default, modernize-use-equal-delete and Include What You Use warnings; other minor fixes (NFC).

Per Zachary Turner and Mehdi Amini suggestion to make only post-commit reviews.

llvm-svn: 287355

7 years agoResubmit "Remove an output-parameter from Variable function".
Zachary Turner [Fri, 18 Nov 2016 17:55:04 +0000 (17:55 +0000)]
Resubmit "Remove an output-parameter from Variable function".

The scanning algorithm had a few little subtleties that I
overlooked, but this patch should fix everything.

I still haven't changed the function to take a StringRef since
that has some trickle down effect and is mostly mechanical,
I just wanted to get the tricky part as isolated as possible.

llvm-svn: 287354

7 years agoIRMover: Avoid accidentally mapping types from the destination module (PR30799)
Hans Wennborg [Fri, 18 Nov 2016 17:33:05 +0000 (17:33 +0000)]
IRMover: Avoid accidentally mapping types from the destination module (PR30799)

During Module linking, it's possible for SrcM->getIdentifiedStructTypes();
to return types that are actually defined in the destination module
(DstM). Depending on how the bitcode file was read,
getIdentifiedStructTypes() might do a walk over all values, including
metadata nodes, looking for types. In my case, a debug info metadata
node was shared between the two modules, and it referred to a type
defined in the destination module (see test case).

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

llvm-svn: 287353

7 years agoAdd link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch
Mehdi Amini [Fri, 18 Nov 2016 17:28:10 +0000 (17:28 +0000)]
Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch

Summary:
LLVM will define a symbol, either EnableABIBreakingChecks or
DisableABIBreakingChecks depending on the configuration setting for
LLVM_ABI_BREAKING_CHECKS.

The llvm-config.h header will add weak references to these symbols in
every clients that includes this header. This should ensure that
a mismatch triggers a link failure (or a load time failure for DSO).

On MSVC, the pragma "detect_mismatch" is used instead.

Reviewers: rnk, jroelofs

Subscribers: llvm-commits, mgorny

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

llvm-svn: 287352

7 years ago[PPC] limit line width to 80 characters
Ehsan Amiri [Fri, 18 Nov 2016 16:24:27 +0000 (16:24 +0000)]
[PPC] limit line width to 80 characters

NFC. Forgot to fix this in the original commit.

llvm-svn: 287350

7 years ago[mips][msa] Implement f16 support
Simon Dardis [Fri, 18 Nov 2016 16:17:44 +0000 (16:17 +0000)]
[mips][msa] Implement f16 support

The MIPS MSA ASE provides instructions to convert to and from half precision
floating point. This patch teaches the MIPS backend to treat f16 as a legal
type and how to promote such values to f32 for the usual set of operations.

As a result of this, the fexup[lr].w intrinsics no longer crash LLVM during
type legalization.

Reviewers: zoran.jovanvoic, vkalintiris

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

llvm-svn: 287349

7 years ago[X86][AVX512] Split AVX512F/AVX512VL tests to demonstrate missed int2fp opportunities...
Simon Pilgrim [Fri, 18 Nov 2016 15:31:36 +0000 (15:31 +0000)]
[X86][AVX512] Split AVX512F/AVX512VL tests to demonstrate missed int2fp opportunities without AVX512VL

llvm-svn: 287348

7 years ago[NFC] Adjust naming scheme of statistic variables
Johannes Doerfert [Fri, 18 Nov 2016 14:37:08 +0000 (14:37 +0000)]
[NFC] Adjust naming scheme of statistic variables

Suggested-by: Tobias Grosser <tobias@grosser.es>
llvm-svn: 287347