platform/upstream/llvm.git
7 years ago[X86] Add a test case where, due to a bug in selectScalarSSELoad, we fold the same...
Craig Topper [Thu, 17 Nov 2016 05:37:39 +0000 (05:37 +0000)]
[X86] Add a test case where, due to a bug in selectScalarSSELoad, we fold the same load twice.

llvm-svn: 287210

7 years ago[XRay] Support AArch64 in LLVM
Dean Michael Berris [Thu, 17 Nov 2016 05:15:37 +0000 (05:15 +0000)]
[XRay] Support AArch64 in LLVM

This patch adds XRay support in LLVM for AArch64 targets.
This patch is one of a series:

Clang: https://reviews.llvm.org/D26415
compiler-rt: https://reviews.llvm.org/D26413

Author: rSerge

Reviewers: rengolin, dberris

Subscribers: amehsan, aemerson, llvm-commits, iid_iunknown

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

llvm-svn: 287209

7 years agoFix warnings and errors introduced with UUID changes.
Zachary Turner [Thu, 17 Nov 2016 05:14:32 +0000 (05:14 +0000)]
Fix warnings and errors introduced with UUID changes.

llvm-svn: 287208

7 years ago[CMake] [Darwin] Add support for debugging tablegen dependencies
Chris Bieneman [Thu, 17 Nov 2016 04:36:59 +0000 (04:36 +0000)]
[CMake] [Darwin] Add support for debugging tablegen dependencies

This patch adds an option to the build system LLVM_DEPENDENCY_DEBUGGING. Over time I plan to extend this to do more complex verifications, but the initial patch causes compile errors wherever there is missing a dependency on intrinsics_gen.

Because intrinsics_gen is a compile-time dependency not a link-time dependency, everything that relies on the headers generated in intrinsics_gen needs an explicit dependency.

llvm-svn: 287207

7 years ago[CMake] NFC. Updating CMake dependency specifications
Chris Bieneman [Thu, 17 Nov 2016 04:36:50 +0000 (04:36 +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: 287206

7 years ago[CMake] NFC. Updating CMake dependency specifications
Chris Bieneman [Thu, 17 Nov 2016 04:36:35 +0000 (04:36 +0000)]
[CMake] NFC. Updating CMake dependency specifications

This patch updates a couple 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: 287205

7 years ago[AMDGPU] Add missing test for rL287203
Konstantin Zhuravlyov [Thu, 17 Nov 2016 04:33:20 +0000 (04:33 +0000)]
[AMDGPU] Add missing test for rL287203

llvm-svn: 287204

7 years ago[AMDGPU] Custom lower f16 = fp_round f64
Konstantin Zhuravlyov [Thu, 17 Nov 2016 04:28:37 +0000 (04:28 +0000)]
[AMDGPU] Custom lower f16 = fp_round f64

llvm-svn: 287203

7 years agoRename a function so that that starts with a lowercase letter.
Rui Ueyama [Thu, 17 Nov 2016 04:10:09 +0000 (04:10 +0000)]
Rename a function so that that starts with a lowercase letter.

llvm-svn: 287202

7 years ago[AMDGPU] Promote f16/i16 conversions to f32/i32
Konstantin Zhuravlyov [Thu, 17 Nov 2016 04:00:46 +0000 (04:00 +0000)]
[AMDGPU] Promote f16/i16 conversions to f32/i32

llvm-svn: 287201

7 years agoSimplify and use consistent variable name. NFC.
Rui Ueyama [Thu, 17 Nov 2016 03:52:14 +0000 (03:52 +0000)]
Simplify and use consistent variable name. NFC.

llvm-svn: 287200

7 years ago[AMDGPU] Expand `br_cc` for f16
Konstantin Zhuravlyov [Thu, 17 Nov 2016 03:49:01 +0000 (03:49 +0000)]
[AMDGPU] Expand `br_cc` for f16

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

llvm-svn: 287199

7 years agoUse uint16_t instead of size_t for symbol version ID.
Rui Ueyama [Thu, 17 Nov 2016 03:39:21 +0000 (03:39 +0000)]
Use uint16_t instead of size_t for symbol version ID.

Because it is uint16_t in the ELF spec. Using size_t was confusing.

llvm-svn: 287198

7 years agoAdd single quotes to a warning message for consistency.
Rui Ueyama [Thu, 17 Nov 2016 03:32:41 +0000 (03:32 +0000)]
Add single quotes to a warning message for consistency.

llvm-svn: 287197

7 years agoSimplify handleAnonymousVersion even more.
Rui Ueyama [Thu, 17 Nov 2016 03:19:34 +0000 (03:19 +0000)]
Simplify handleAnonymousVersion even more.

We used to create a vector contantaining all version definitions
with wildcards because doing that was efficient. All patterns were
compiled to a regexp and matched against symbol names. Because
a regexp can be converted to a DFA, matching against union of patterns
is as cheap as matching against one patter.

We are no longer converting them to regexp. Our own glob pattern
handler doesn't do such optimization. Therefore, creating a vector
no longer makes sense.

llvm-svn: 287196

7 years ago[Orc] Clang-format the recent RPC update (r286620 and related).
Lang Hames [Thu, 17 Nov 2016 02:33:47 +0000 (02:33 +0000)]
[Orc] Clang-format the recent RPC update (r286620 and related).

llvm-svn: 287195

7 years agoRemove -Wsigned-enum-bitfield from -Wmost. On a wide set of ABIs, this warning
Richard Smith [Thu, 17 Nov 2016 02:16:09 +0000 (02:16 +0000)]
Remove -Wsigned-enum-bitfield from -Wmost. On a wide set of ABIs, this warning
is completely irrelevant, producing (effectively) false positives, and -Wmost
is used pretty widely. We should somehow turn it back on by default when
targeting the MS ABI, however, since it indicates the program will not do as
intended in those cases.

(Or perhaps we should just treat enum bitfields as having the signedness of the
enum, even when targeting the MS ABI...)

llvm-svn: 287193

7 years agoSimplify. NFC.
Rui Ueyama [Thu, 17 Nov 2016 02:16:06 +0000 (02:16 +0000)]
Simplify. NFC.

llvm-svn: 287192

7 years agoSplit scanVersionScript. NFC.
Rui Ueyama [Thu, 17 Nov 2016 02:09:42 +0000 (02:09 +0000)]
Split scanVersionScript. NFC.

llvm-svn: 287191

7 years agoConvert UriParser to use StringRef.
Zachary Turner [Thu, 17 Nov 2016 01:38:02 +0000 (01:38 +0000)]
Convert UriParser to use StringRef.

llvm-svn: 287190

7 years agoMake GetValueForVariableExpression use StringRef.
Zachary Turner [Thu, 17 Nov 2016 01:37:52 +0000 (01:37 +0000)]
Make GetValueForVariableExpression use StringRef.

Also significantly reduced the indentation level by use of
early returns, and simplified some of the logic by using
StringRef functions such as consumeInteger() and getAsInteger()
instead of strtoll, etc.

llvm-svn: 287189

7 years agoConvert AutoComplete related code to StringRef.
Zachary Turner [Thu, 17 Nov 2016 01:37:42 +0000 (01:37 +0000)]
Convert AutoComplete related code to StringRef.

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

llvm-svn: 287188

7 years ago[Sema] Fix a bug in enable_if condition instantiation.
George Burgess IV [Thu, 17 Nov 2016 01:33:54 +0000 (01:33 +0000)]
[Sema] Fix a bug in enable_if condition instantiation.

During template instantiation, we currently fall back to just calling
Sema::SubstExpr for enable_if attributes that aren't value-dependent or
type-dependent. Since Sema::SubstExpr strips off any implicit casts
we've added to an expression, it's possible that this behavior will
leave us with an enable_if condition that's just a DeclRefExpr.
Conditions like that deeply confuse Sema::CheckEnableIf.

llvm-svn: 287187

7 years agoUse profile info to adjust loop unroll threshold.
Dehao Chen [Thu, 17 Nov 2016 01:17:02 +0000 (01:17 +0000)]
Use profile info to adjust loop unroll threshold.

Summary:
For flat loop, even if it is hot, it is not a good idea to unroll in runtime, thus we set a lower partial unroll threshold.
For hot loop, we set a higher unroll threshold and allows expensive tripcount computation to allow more aggressive unrolling.

Reviewers: davidxl, mzolotukhin

Subscribers: sanjoy, mehdi_amini, llvm-commits

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

llvm-svn: 287186

7 years agoExplicitly specify that ubsan-vtable-checks is x86-64.
Ivan Krasin [Thu, 17 Nov 2016 01:09:04 +0000 (01:09 +0000)]
Explicitly specify that ubsan-vtable-checks is x86-64.

This should fix a failure on PowerPC introduced by r287181.

llvm-svn: 287185

7 years ago[CUDA] Update docs to indicate that clang now supports std::complex in CUDA mode.
Justin Lebar [Thu, 17 Nov 2016 01:03:42 +0000 (01:03 +0000)]
[CUDA] Update docs to indicate that clang now supports std::complex in CUDA mode.

The last remaining necessary change was D25403, landed as r287012.

llvm-svn: 287184

7 years agoRemove a stale test case.
Lang Hames [Thu, 17 Nov 2016 01:02:52 +0000 (01:02 +0000)]
Remove a stale test case.

llvm-svn: 287183

7 years agollvm-dis: Remove dead code.
Peter Collingbourne [Thu, 17 Nov 2016 00:42:08 +0000 (00:42 +0000)]
llvm-dis: Remove dead code.

llvm-svn: 287182

7 years agoInsert a type check before reading vtable.
Ivan Krasin [Thu, 17 Nov 2016 00:39:48 +0000 (00:39 +0000)]
Insert a type check before reading vtable.

Summary:
this is to prevent a situation when a pointer is invalid or null,
but we get to reading from vtable before we can check that
(possibly causing a segfault without a good diagnostics).

Reviewers: pcc

Subscribers: cfe-commits

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

llvm-svn: 287181

7 years ago[AVR] Remove some accidentally-commited code that broke the bots
Dylan McKay [Thu, 17 Nov 2016 00:09:38 +0000 (00:09 +0000)]
[AVR] Remove some accidentally-commited code that broke the bots

This is a remnant of an on-chip unit testing tool that has since been
moved out-of-tree.

It was accidentally committed in r287162.

llvm-svn: 287180

7 years ago[CMake] Support lld with LTO bootstrap
Petr Hosek [Wed, 16 Nov 2016 23:59:06 +0000 (23:59 +0000)]
[CMake] Support lld with LTO bootstrap

lld has LTO support, if requested we should add a dependency on lld
rather than LLVMgold when doing LTO bootstrap build.

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

llvm-svn: 287179

7 years agoIntroduce GlobalSplit pass.
Peter Collingbourne [Wed, 16 Nov 2016 23:40:26 +0000 (23:40 +0000)]
Introduce GlobalSplit pass.

This pass splits globals into elements using inrange annotations on
getelementptr indices.

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

llvm-svn: 287178

7 years agoAdd warning when assigning enums to bitfields without an explicit unsigned underlying...
Reid Kleckner [Wed, 16 Nov 2016 23:40:00 +0000 (23:40 +0000)]
Add warning when assigning enums to bitfields without an explicit unsigned underlying type

Summary:
Add a warning when assigning enums to bitfields without an explicit
unsigned underlying type. This is to prevent problems with MSVC
compatibility, since the Microsoft ABI defaults to storing enums with a
signed type, causing inconsistencies with saving to/reading from
bitfields.

Also disabled the warning in the dr0xx.cpp test which throws the error,
and added a test for the warning.

The warning can be disabled with -Wno-signed-enum-bitfield.

Patch by Sasha Bermeister!

Reviewers: rnk, aaron.ballman

Subscribers: mehdi_amini, aaron.ballman, cfe-commits, thakis, dcheng

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

llvm-svn: 287177

7 years ago[AVR] Wrap all methods in the pseudo expansion pass in an anon namespace
Dylan McKay [Wed, 16 Nov 2016 23:06:14 +0000 (23:06 +0000)]
[AVR] Wrap all methods in the pseudo expansion pass in an anon namespace

The '-fpermissive' compiler flag complains if the template
specializations used in the class are used in a different namespace.

llvm-svn: 287176

7 years ago[analyzer] Remove unused check::RegionChanges::wantsRegionChangeUpdate callback
Anna Zaks [Wed, 16 Nov 2016 22:59:01 +0000 (22:59 +0000)]
[analyzer] Remove unused check::RegionChanges::wantsRegionChangeUpdate callback

Remove the check::RegionChanges::wantsRegionChangeUpdate callback as it is no
longer used (since checkPointerEscape has been added).

A patch by Krzysztof Wiśniewski!

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

llvm-svn: 287175

7 years ago[AVR] Fix basic block naming in ctlz and cttz tests
Dylan McKay [Wed, 16 Nov 2016 22:48:38 +0000 (22:48 +0000)]
[AVR] Fix basic block naming in ctlz and cttz tests

The branch selector would change the names.

llvm-svn: 287174

7 years ago[AVR] Remove unused method from AVRTargetMachine
Dylan McKay [Wed, 16 Nov 2016 22:48:30 +0000 (22:48 +0000)]
[AVR] Remove unused method from AVRTargetMachine

llvm-svn: 287173

7 years ago[AVR] Add tests for counting leading/trailing zeros
Dylan McKay [Wed, 16 Nov 2016 22:38:43 +0000 (22:38 +0000)]
[AVR] Add tests for counting leading/trailing zeros

This adds two test files that verify the 'cttz' and 'ctlz' operations.

llvm-svn: 287172

7 years ago[x86] allow FP-logic ops when one operand is FP and result is FP
Sanjay Patel [Wed, 16 Nov 2016 22:34:05 +0000 (22:34 +0000)]
[x86] allow FP-logic ops when one operand is FP and result is FP

We save an inter-register file move this way. If there's any CPU where
the FP logic is slower, we could transform this back to int-logic in
MachineCombiner.

This helps, but doesn't solve, PR6137:
https://llvm.org/bugs/show_bug.cgi?id=6137

The 'andn' test shows that we're missing a pattern match to
recognize the xor with -1 constant as a 'not' op.

llvm-svn: 287171

7 years ago[AsmParser] Avoid recursing when lexing ';'. NFC.
Ahmed Bougacha [Wed, 16 Nov 2016 22:25:05 +0000 (22:25 +0000)]
[AsmParser] Avoid recursing when lexing ';'. NFC.

This should prevent stack overflows in non-optimized builds on
.ll files with lots of consecutive commented-out lines.

Instead of recursing into LexToken(), continue into a 'while (true)'.

llvm-svn: 287170

7 years ago[CodeGen] Pass references, not pointers, to MMI helpers. NFC.
Ahmed Bougacha [Wed, 16 Nov 2016 22:25:03 +0000 (22:25 +0000)]
[CodeGen] Pass references, not pointers, to MMI helpers. NFC.

While there, rename them to follow the coding style.

llvm-svn: 287169

7 years agoRevert "Get GlobalISel to build on Linux after r286407"
Ahmed Bougacha [Wed, 16 Nov 2016 22:24:59 +0000 (22:24 +0000)]
Revert "Get GlobalISel to build on Linux after r286407"

This reverts commit r286962.

We want to avoid depending on SelectionDAG, and AddLandingPadInfo
lives in CodeGen now.

llvm-svn: 287168

7 years ago[CodeGen] Pull MMI helpers from FunctionLoweringInfo to MMI. NFC.
Ahmed Bougacha [Wed, 16 Nov 2016 22:24:56 +0000 (22:24 +0000)]
[CodeGen] Pull MMI helpers from FunctionLoweringInfo to MMI. NFC.

They're not SelectionDAG- or FunctionLoweringInfo-specific.  They
are, however, specific to building MMI from IR.
We could make them members, but it's nice having MMI be a "simple" data
structure and this logic kept separate.

This also lets us reuse them from GlobalISel.

llvm-svn: 287167

7 years ago[CodeGen] Cleanup MachineModuleInfo doxygen comments. NFC.
Ahmed Bougacha [Wed, 16 Nov 2016 22:24:53 +0000 (22:24 +0000)]
[CodeGen] Cleanup MachineModuleInfo doxygen comments. NFC.

Remove redundant names and only keep header comments.

llvm-svn: 287166

7 years ago[CodeGen] Sort MMI forward declarations. NFC.
Ahmed Bougacha [Wed, 16 Nov 2016 22:24:46 +0000 (22:24 +0000)]
[CodeGen] Sort MMI forward declarations. NFC.

llvm-svn: 287165

7 years ago[libc++] Introduce `_LIBCPP_OVERRIDABLE_FUNC_VIS`
Shoaib Meenai [Wed, 16 Nov 2016 22:18:10 +0000 (22:18 +0000)]
[libc++] Introduce `_LIBCPP_OVERRIDABLE_FUNC_VIS`

This is a generalization of `_LIBCPP_NEW_DELETE_VIS`; the new macro name
captures the semantics better, and also allows us to get rid of the
`_WIN32` check in `include/new`. No functional change.

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

llvm-svn: 287164

7 years agoGeneral clean up of error handling in llvm-objdump to remove its use of report_fatal_...
Kevin Enderby [Wed, 16 Nov 2016 22:17:38 +0000 (22:17 +0000)]
General clean up of error handling in llvm-objdump to remove its use of report_fatal_error().
No real functional change with this commit.

The problem with report_fatal_error() is it does not include the tool name
and the file name the for which the error message was generated.

Uses of report_fatal_error() were change to report_error() or error()
to get a better error and to make the code smaller and cleaner.

Also changed things like error(errorToErrorCode(SOrErr.takeError())) to
use report_error() with a file name and the llvm::Error (as well as the
ArchitectureName if available) so the error message is printed.

llvm-svn: 287163

7 years ago[AVR] Add the pseudo instruction expansion pass
Dylan McKay [Wed, 16 Nov 2016 21:58:04 +0000 (21:58 +0000)]
[AVR] Add the pseudo instruction expansion pass

Summary:
A lot of the pseudo instructions are required because LLVM assumes that
all integers of the same size as the pointer size are legal. This means
that it will not currently expand 16-bit instructions to their 8-bit
variants because it thinks 16-bit types are legal for the operations.

This also adds all of the CodeGen tests that required the pass to run.

Reviewers: arsenm, kparzysz

Subscribers: wdng, mgorny, modocache, llvm-commits

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

llvm-svn: 287162

7 years agoFix "isn't a prototype" warning
Vitaly Buka [Wed, 16 Nov 2016 21:51:39 +0000 (21:51 +0000)]
Fix "isn't a prototype" warning

llvm-svn: 287161

7 years agoX86: Simplify X86ISD::Wrapper operand checks. NFCI.
Peter Collingbourne [Wed, 16 Nov 2016 21:48:59 +0000 (21:48 +0000)]
X86: Simplify X86ISD::Wrapper operand checks. NFCI.

We only ever create TargetConstantPool, TargetJumpTable, TargetExternalSymbol,
TargetGlobalAddress, TargetGlobalTLSAddress, MCSymbol and TargetBlockAddress
nodes as operands of X86ISD::Wrapper nodes, so we can remove one check and
invert the other.

Also update the documentation comment for X86ISD::Wrapper.

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

llvm-svn: 287160

7 years ago[ImplicitNullChecks] Do not not handle call MachineInstrs
Sanjoy Das [Wed, 16 Nov 2016 21:45:22 +0000 (21:45 +0000)]
[ImplicitNullChecks] Do not not handle call MachineInstrs

We don't track callee clobbered registers correctly, so avoid hoisting
across calls.

Note: for this bug to trigger we need a `readonly` call target, since we
already have logic to not hoist across potentially storing instructions
either.

llvm-svn: 287159

7 years agoFix some unit test compilation failures.
Zachary Turner [Wed, 16 Nov 2016 21:45:11 +0000 (21:45 +0000)]
Fix some unit test compilation failures.

llvm-svn: 287158

7 years agoMake Apropos functions accept StringRefs.
Zachary Turner [Wed, 16 Nov 2016 21:45:04 +0000 (21:45 +0000)]
Make Apropos functions accept StringRefs.

llvm-svn: 287157

7 years agoBitcode: Introduce initial multi-module reader API.
Peter Collingbourne [Wed, 16 Nov 2016 21:44:45 +0000 (21:44 +0000)]
Bitcode: Introduce initial multi-module reader API.

Implement getLazyBitcodeModule() and parseBitcodeFile() in terms of it.

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

llvm-svn: 287156

7 years agoUpdate GenerateAdditionalHelpAvenues to take StringRef.
Zachary Turner [Wed, 16 Nov 2016 21:34:22 +0000 (21:34 +0000)]
Update GenerateAdditionalHelpAvenues to take StringRef.

llvm-svn: 287155

7 years agoUse the member function location in enable_if diagnostics.
George Burgess IV [Wed, 16 Nov 2016 21:31:25 +0000 (21:31 +0000)]
Use the member function location in enable_if diagnostics.

Before:
<stdin>:3:3: error: no matching member function for call to 'bar'
  Foo().bar();
  ^

After:
<stdin>:3:9: error: no matching member function for call to 'bar'
  Foo().bar();
        ^

llvm-svn: 287154

7 years ago[clang-tidy] Fix identifier naming for initializer list member initializers.
Eric Fiselier [Wed, 16 Nov 2016 21:15:58 +0000 (21:15 +0000)]
[clang-tidy] Fix identifier naming for initializer list member initializers.

Summary:
This patch adds handling for member initializers in a constructors initializer list. Previously we only handled base-class and delegating initializers, which are transformed by the `TypeLoc` matcher. For Example:

```
// Style options: All identifiers should start with an upper case letter.
struct base { ...  };
struct der :  base {
  int field;  // FIXES: int Field;
  der() : der(42) {} // FIXES: Der() : Der(42) {}
  der(int X) : base(), field(X) {} // FIXES: Der(int X) : Base(), field(X)
  // Note that `field` doesn't get replaced
};
```

Reviewers: alexfh, hokein, aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 287153

7 years agoDon't allow direct access to StreamString's internal buffer.
Zachary Turner [Wed, 16 Nov 2016 21:15:24 +0000 (21:15 +0000)]
Don't allow direct access to StreamString's internal buffer.

This is a large API change that removes the two functions from
StreamString that return a std::string& and a const std::string&,
and instead provide one function which returns a StringRef.

Direct access to the underlying buffer violates the concept of
a "stream" which is intended to provide forward only access,
and makes porting to llvm::raw_ostream more difficult in the
future.

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

llvm-svn: 287152

7 years ago[ELF][MIPS] Add MipsGotSection to handle MIPS GOT
Simon Atanasyan [Wed, 16 Nov 2016 21:01:02 +0000 (21:01 +0000)]
[ELF][MIPS] Add MipsGotSection to handle MIPS GOT

MIPS GOT handling is very different from other targets so it is better
to keep the code in the separatre section class MipsGotSection. This
patch introduces the new section and moves all MIPS specific code from
GotSection to the new class. I did not rename fields and methods in the
MipsGotSection class to reduce the diff and plan to do that by the
separate commit.

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

llvm-svn: 287150

7 years agoARM: fix CodeGen for 64-bit shifts.
Tim Northover [Wed, 16 Nov 2016 20:54:28 +0000 (20:54 +0000)]
ARM: fix CodeGen for 64-bit shifts.

One half of the shifts obviously needed conditional selection based on whether
the shift amount is more than 32-bits, but leaving the other half as the
natural shift isn't acceptable either: it's undefined behaviour to shift a
32-bit value by more than 31.

llvm-svn: 287149

7 years agoMake block placement deterministic
Rong Xu [Wed, 16 Nov 2016 20:50:06 +0000 (20:50 +0000)]
Make block placement deterministic

We fail to produce bit-to-bit matching stage2 and stage3 compiler in PGO
bootstrap build. The reason is because LoopBlockSet is of SmallPtrSet type
whose iterating order depends on the pointer value.

This patch fixes this issue by changing to use SmallSetVector.

Differential Revision: http://reviews.llvm.org/D26634

llvm-svn: 287148

7 years ago[InstCombine] replace unreachable with assert and remove unreachable code; NFCI
Sanjay Patel [Wed, 16 Nov 2016 20:40:02 +0000 (20:40 +0000)]
[InstCombine] replace unreachable with assert and remove unreachable code; NFCI

llvm-svn: 287147

7 years agoAMDGPU: Enable ConstrainCopy DAG mutation
Matt Arsenault [Wed, 16 Nov 2016 20:35:23 +0000 (20:35 +0000)]
AMDGPU: Enable ConstrainCopy DAG mutation

This fixes a probably unintended divergence from the default
scheduler behavior.

llvm-svn: 287146

7 years ago[InstCombine] fix formatting and add FIXMEs to foldOperationIntoSelectOperand(); NFC
Sanjay Patel [Wed, 16 Nov 2016 20:18:34 +0000 (20:18 +0000)]
[InstCombine] fix formatting and add FIXMEs to foldOperationIntoSelectOperand(); NFC

llvm-svn: 287145

7 years agoadding operator* to help working with primitive values
Mike Aizatsky [Wed, 16 Nov 2016 19:35:37 +0000 (19:35 +0000)]
adding operator* to help working with primitive values

Subscribers: kubabrecka

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

llvm-svn: 287144

7 years ago[ELF] Don't replace path separators on *NIX.
Davide Italiano [Wed, 16 Nov 2016 19:35:36 +0000 (19:35 +0000)]
[ELF] Don't replace path separators on *NIX.

Apparently this is wrong because it's legal to have a filename
on UNIX which contains a backslash.

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

llvm-svn: 287143

7 years ago[AArch64] Handle vector types in replaceZeroVectorStore.
Geoff Berry [Wed, 16 Nov 2016 19:35:19 +0000 (19:35 +0000)]
[AArch64] Handle vector types in replaceZeroVectorStore.

Summary:
Extend replaceZeroVectorStore to handle more vector type stores,
floating point zero vectors and set alignment more accurately on split
stores.

This is a follow-up change to r286875.

This change fixes PR31038.

Reviewers: MatzeB

Subscribers: mcrosier, aemerson, llvm-commits, rengolin

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

llvm-svn: 287142

7 years agoRelax testcase.
Adrian Prantl [Wed, 16 Nov 2016 19:31:44 +0000 (19:31 +0000)]
Relax testcase.
This removes checks that are irrelevant for what is being tested.

llvm-svn: 287141

7 years agoReduce number of tasks in parallel_for_each.
Rui Ueyama [Wed, 16 Nov 2016 19:27:33 +0000 (19:27 +0000)]
Reduce number of tasks in parallel_for_each.

TaskGroup has a fairly high overhead, so we don't want to partition
tasks into too small tasks. This patch partition tasks into up to
1024 tasks.

I compared this patch with the original LLD's parallel_for_each.
I reverted r287042 locally for comparison.

With this patch, time to self-link lld with debug info changed from
6.23 seconds to 4.62 seconds (-25.8%), with -threads and without -build-id.
With both -threads and -build-id, it improved from 11.71 seconds
to 4.94 seconds (-57.8%). Full results are below.

BTW, GNU gold takes 11.65 seconds to link the same binary.

NOW

--no-threads --build-id=none
       6789.847776 task-clock (msec)         #    1.000 CPUs utilized            ( +-  1.86% )
               685 context-switches          #    0.101 K/sec                    ( +-  2.82% )
                 4 cpu-migrations            #    0.001 K/sec                    ( +- 31.18% )
         1,424,690 page-faults               #    0.210 M/sec                    ( +-  1.07% )
    21,339,542,522 cycles                    #    3.143 GHz                      ( +-  1.49% )
    13,092,260,230 stalled-cycles-frontend   #   61.35% frontend cycles idle     ( +-  2.23% )
   <not supported> stalled-cycles-backend
    21,462,051,828 instructions              #    1.01  insns per cycle
                                             #    0.61  stalled cycles per insn  ( +-  0.41% )
     3,955,296,378 branches                  #  582.531 M/sec                    ( +-  0.39% )
        75,699,909 branch-misses             #    1.91% of all branches          ( +-  0.08% )

       6.787630744 seconds time elapsed                                          ( +-  1.86% )

--threads --build-id=none
      14767.148697 task-clock (msec)         #    3.196 CPUs utilized            ( +-  2.56% )
            28,891 context-switches          #    0.002 M/sec                    ( +-  1.99% )
               905 cpu-migrations            #    0.061 K/sec                    ( +-  5.49% )
         1,262,122 page-faults               #    0.085 M/sec                    ( +-  1.68% )
    43,116,163,217 cycles                    #    2.920 GHz                      ( +-  3.07% )
    33,690,171,242 stalled-cycles-frontend   #   78.14% frontend cycles idle     ( +-  3.67% )
   <not supported> stalled-cycles-backend
    22,836,731,536 instructions              #    0.53  insns per cycle
                                             #    1.48  stalled cycles per insn  ( +-  1.13% )
     4,382,712,998 branches                  #  296.788 M/sec                    ( +-  1.33% )
        78,622,295 branch-misses             #    1.79% of all branches          ( +-  0.54% )

       4.621228056 seconds time elapsed                                          ( +-  1.90% )

--threads --build-id=sha1
      24594.457135 task-clock (msec)         #    4.974 CPUs utilized            ( +-  1.78% )
            29,902 context-switches          #    0.001 M/sec                    ( +-  2.62% )
             1,097 cpu-migrations            #    0.045 K/sec                    ( +-  6.29% )
         1,313,947 page-faults               #    0.053 M/sec                    ( +-  2.36% )
    70,516,415,741 cycles                    #    2.867 GHz                      ( +-  0.78% )
    47,570,262,296 stalled-cycles-frontend   #   67.46% frontend cycles idle     ( +-  0.86% )
   <not supported> stalled-cycles-backend
    73,124,599,029 instructions              #    1.04  insns per cycle
                                             #    0.65  stalled cycles per insn  ( +-  0.33% )
    10,495,266,104 branches                  #  426.733 M/sec                    ( +-  0.41% )
        91,444,149 branch-misses             #    0.87% of all branches          ( +-  0.83% )

       4.944291711 seconds time elapsed                                          ( +-  1.72% )

PREVIOUS

--threads --build-id=none
       7307.437544 task-clock (msec)         #    1.160 CPUs utilized            ( +-  2.34% )
             3,128 context-switches          #    0.428 K/sec                    ( +-  4.37% )
               352 cpu-migrations            #    0.048 K/sec                    ( +-  5.98% )
         1,354,450 page-faults               #    0.185 M/sec                    ( +-  2.20% )
    22,081,733,098 cycles                    #    3.022 GHz                      ( +-  1.46% )
    13,709,991,267 stalled-cycles-frontend   #   62.09% frontend cycles idle     ( +-  1.77% )
   <not supported> stalled-cycles-backend
    21,634,468,895 instructions              #    0.98  insns per cycle
                                             #    0.63  stalled cycles per insn  ( +-  0.86% )
     3,993,062,361 branches                  #  546.438 M/sec                    ( +-  0.83% )
        76,188,819 branch-misses             #    1.91% of all branches          ( +-  0.19% )

       6.298101157 seconds time elapsed                                          ( +-  2.03% )

--threads --build-id=sha1
      12845.420265 task-clock (msec)         #    1.097 CPUs utilized            ( +-  1.95% )
             4,020 context-switches          #    0.313 K/sec                    ( +-  2.89% )
               369 cpu-migrations            #    0.029 K/sec                    ( +-  6.26% )
         1,464,822 page-faults               #    0.114 M/sec                    ( +-  1.37% )
    40,668,449,813 cycles                    #    3.166 GHz                      ( +-  0.96% )
    18,863,982,388 stalled-cycles-frontend   #   46.38% frontend cycles idle     ( +-  1.82% )
   <not supported> stalled-cycles-backend
    71,560,499,058 instructions              #    1.76  insns per cycle
                                             #    0.26  stalled cycles per insn  ( +-  0.14% )
    10,044,152,441 branches                  #  781.925 M/sec                    ( +-  0.19% )
        87,835,773 branch-misses             #    0.87% of all branches          ( +-  0.09% )

      11.711773314 seconds time elapsed                                          ( +-  1.51% )

llvm-svn: 287140

7 years agoAdd the missing FileCheck invocation to this testcase.
Adrian Prantl [Wed, 16 Nov 2016 19:26:11 +0000 (19:26 +0000)]
Add the missing FileCheck invocation to this testcase.

llvm-svn: 287139

7 years agoRangify for loops, NFC.
Yaron Keren [Wed, 16 Nov 2016 19:24:10 +0000 (19:24 +0000)]
Rangify for loops, NFC.

llvm-svn: 287138

7 years agoExport fewer functions from Error.h.
Rui Ueyama [Wed, 16 Nov 2016 18:54:37 +0000 (18:54 +0000)]
Export fewer functions from Error.h.

Also add a comment saying that check() returns a value.

llvm-svn: 287136

7 years ago[LoopVectorize] Fix for non-determinism in codegen
Mandeep Singh Grang [Wed, 16 Nov 2016 18:53:17 +0000 (18:53 +0000)]
[LoopVectorize] Fix for non-determinism in codegen

Summary: This patch fixes issues in codegen uncovered due to https://reviews.llvm.org/D26718

Reviewers: mssimpso

Subscribers: llvm-commits, mzolotukhin

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

llvm-svn: 287135

7 years agoFix PR31029 by attaching an artificial debug location to msabi thunks.
Adrian Prantl [Wed, 16 Nov 2016 18:49:47 +0000 (18:49 +0000)]
Fix PR31029 by attaching an artificial debug location to msabi thunks.
This was a latent bug that was recently uncovered by r286400.

llvm-svn: 287134

7 years ago[ELF] - Separate locals list from versions.
George Rimar [Wed, 16 Nov 2016 18:46:23 +0000 (18:46 +0000)]
[ELF] - Separate locals list from versions.

This change separates all versioned locals to be a separate list in config,
that was suggested by Rafael and simplifies the logic a bit.

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

llvm-svn: 287132

7 years agoAMDGPU/SI: Avoid creating unnecessary copies in the SIFixSGPRCopies pass
Tom Stellard [Wed, 16 Nov 2016 18:42:17 +0000 (18:42 +0000)]
AMDGPU/SI: Avoid creating unnecessary copies in the SIFixSGPRCopies pass

Summary:
1. Don't try to copy values to and from the same register class.
2. Replace copies with of registers with immediate values with v_mov/s_mov
   instructions.

The main purpose of this change is to make MachineSink do a better job of
determining when it is beneficial to split a critical edge, since the pass
assumes that copies will become move instructions.

This prevents a regression in uniform-cfg.ll if we enable critical edge
splitting for AMDGPU.

Reviewers: arsenm

Subscribers: arsenm, kzhuravl, llvm-commits

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

llvm-svn: 287131

7 years ago[ExecutionEngine] Fix examples build broken in r287126 and other Include What You...
Eugene Zelenko [Wed, 16 Nov 2016 18:32:58 +0000 (18:32 +0000)]
[ExecutionEngine] Fix examples build broken in r287126 and other Include What You Use warnings.

llvm-svn: 287130

7 years agoFixed layout of test/ASTMerge.
Sean Callanan [Wed, 16 Nov 2016 18:21:00 +0000 (18:21 +0000)]
Fixed layout of test/ASTMerge.

As outlined in a previous RFC, the test/ASTMerge/Inputs folder is getting full and the tests are starting to become interdependent. This is undesirable because

- it makes it harder to write new tests
- it makes it harder to figure out at a glance what old tests are doing, and
- it adds the risk of breaking one test while changing a different one, because of the interdependencies.

To fix this, according to the conversation in the RFC, I have changed the layout from

a.c
Inputs/a1.c
Inputs/a2.c

to

a/test.c
a/Inputs/a1.c
a/Inputs/a2.c
for all existing tests. I have also eliminated interdependencies by replicating the input files for each test that uses them.

https://reviews.llvm.org/D26571

llvm-svn: 287129

7 years ago[Frontend] Allow attaching an external sema source to compiler instance and extra...
Benjamin Kramer [Wed, 16 Nov 2016 18:15:26 +0000 (18:15 +0000)]
[Frontend] Allow attaching an external sema source to compiler instance and extra diags to TypoCorrections

This can be used to append alternative typo corrections to an existing diag.
include-fixer can use it to suggest includes to be added.

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

llvm-svn: 287128

7 years agofix comment formatting; NFC
Sanjay Patel [Wed, 16 Nov 2016 18:09:44 +0000 (18:09 +0000)]
fix comment formatting; NFC

llvm-svn: 287127

7 years ago[ExecutionEngine] Fix some Clang-tidy modernize-use-default, modernize-use-equals...
Eugene Zelenko [Wed, 16 Nov 2016 18:07:33 +0000 (18:07 +0000)]
[ExecutionEngine] Fix some Clang-tidy modernize-use-default, modernize-use-equals-delete and Include What You Use warnings; other minor fixes.

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

llvm-svn: 287126

7 years agoDon't error if __tls_get_addr is defined.
Rafael Espindola [Wed, 16 Nov 2016 18:01:41 +0000 (18:01 +0000)]
Don't error if __tls_get_addr is defined.

Turns out some systems do define it. Not producing an error in this
case matches gold and bfd.

llvm-svn: 287125

7 years ago[ELF] - Added support for extern "c++" local symbols in version script.
George Rimar [Wed, 16 Nov 2016 17:59:10 +0000 (17:59 +0000)]
[ELF] - Added support for extern "c++" local symbols in version script.

Previously we did not support them,
patch implements this functionality

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

llvm-svn: 287124

7 years ago[ELF] - Change error message according to review comment. NFC.
George Rimar [Wed, 16 Nov 2016 17:45:45 +0000 (17:45 +0000)]
[ELF] - Change error message according to review comment. NFC.

Forgot about that, I am sorry.

llvm-svn: 287123

7 years ago[x86] add fake scalar FP logic instructions to ReplaceableInstrs to save some bytes
Sanjay Patel [Wed, 16 Nov 2016 17:42:40 +0000 (17:42 +0000)]
[x86] add fake scalar FP logic instructions to ReplaceableInstrs to save some bytes

We can replace "scalar" FP-bitwise-logic with other forms of bitwise-logic instructions.
Scalar SSE/AVX FP-logic instructions only exist in your imagination and/or the bowels of
compilers, but logically equivalent int, float, and double variants of bitwise-logic
instructions are reality in x86, and the float variant may be a shorter instruction
depending on which flavor (SSE or AVX) of vector ISA you have...so just prefer float all
the time.

This is a preliminary step towards solving PR6137:
https://llvm.org/bugs/show_bug.cgi?id=6137

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

llvm-svn: 287122

7 years ago[Orc] Re-enable the RPC unit test disabled in r286917.
Lang Hames [Wed, 16 Nov 2016 17:31:09 +0000 (17:31 +0000)]
[Orc] Re-enable the RPC unit test disabled in r286917.

This unit test infinite-looped on s390x due to a thread_yield being optimized
out. I've updated the QueueChannel class (where thread_yield was called) to use
a condition variable instead. This should cause the unit test to behave
correctly.

llvm-svn: 287121

7 years ago[ELF] - Improve diagnostic messages.
George Rimar [Wed, 16 Nov 2016 17:24:06 +0000 (17:24 +0000)]
[ELF] - Improve diagnostic messages.

Particulaty "cannot preempt symbol" message
is extended with locations now.

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

llvm-svn: 287120

7 years agoDefine -build-id=tree as a synonym for -build-id=sha1.
Rui Ueyama [Wed, 16 Nov 2016 17:14:11 +0000 (17:14 +0000)]
Define -build-id=tree as a synonym for -build-id=sha1.

Our build-id is a tree hash anyway, so I'll define this as a synonym
for sha1. GNU gold takes this parameter, so this is for compatibility
with that.

llvm-svn: 287119

7 years ago[change-namespace] handle constructor initializer: Derived : Base::Base() {} and...
Eric Liu [Wed, 16 Nov 2016 16:54:53 +0000 (16:54 +0000)]
[change-namespace] handle constructor initializer: Derived : Base::Base() {} and added conflict detections

Summary:
namespace nx { namespace ny { class Base { public: Base(i) {}} } }
namespace na {
namespace nb {
class X : public nx::ny {
public:
  X() : Base::Base(1) {}
};
}
}

When changing from na::nb to x::y, "Base::Base" will be changed to "nx::ny::Base" and
 "Base::" in "Base::Base" will be replaced with "nx::ny::Base" too, which causes
conflict. This conflict should've been detected when adding replacements but was hidden by `addOrMergeReplacement`. We now also detect conflict when adding replacements where conflict must not happen.

The namespace lookup is tricky here, we simply replace "Base::Base()" with "nx::ny::Base()" as a workaround, which compiles but not perfect.

Reviewers: hokein

Subscribers: bkramer, cfe-commits

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

llvm-svn: 287118

7 years ago[sancov] Name the global containing the main source file name
Reid Kleckner [Wed, 16 Nov 2016 16:50:43 +0000 (16:50 +0000)]
[sancov] Name the global containing the main source file name

If the global name doesn't start with __sancov_gen, ASan will insert
unecessary red zones around it.

llvm-svn: 287117

7 years agotest commit, changed tab to spaces, NFC
Daniil Fukalov [Wed, 16 Nov 2016 16:41:40 +0000 (16:41 +0000)]
test commit, changed tab to spaces, NFC

llvm-svn: 287116

7 years agotarget-data test update for TCE and TCELE
Pekka Jaaskelainen [Wed, 16 Nov 2016 16:21:59 +0000 (16:21 +0000)]
target-data test update for TCE and TCELE

llvm-svn: 287115

7 years agoRemove duplicate condition (PR30648). NFCI.
Simon Pilgrim [Wed, 16 Nov 2016 16:11:08 +0000 (16:11 +0000)]
Remove duplicate condition (PR30648). NFCI.

We only need to check that the bitstream entry is a Record.

llvm-svn: 287114

7 years agoRemove Windows-specific minidump plugin
Adrian McCarthy [Wed, 16 Nov 2016 16:04:14 +0000 (16:04 +0000)]
Remove Windows-specific minidump plugin

With the cross-platform minidump plugin working, the Windows-specific one is no longer needed. This eliminates the unnecessary code.

This does not eliminate the Windows-specific tests, as they hit a few cases the general tests don't. (The Windows-specific tests are currently passing.) I'll look into a separate patch to make sure we're not doing too much duplicate testing.

After that I might do a little re-org in the Windows plugin, as there was some factoring there (Common & Live) that probably isn't necessary anymore.

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

llvm-svn: 287113

7 years agoAdd a little endian variant of TCE.
Pekka Jaaskelainen [Wed, 16 Nov 2016 15:22:31 +0000 (15:22 +0000)]
Add a little endian variant of TCE.

llvm-svn: 287112

7 years agoAdd a little endian variant of TCE.
Pekka Jaaskelainen [Wed, 16 Nov 2016 15:22:23 +0000 (15:22 +0000)]
Add a little endian variant of TCE.

llvm-svn: 287111

7 years ago[X86] Add integer division test for PR23590
Simon Pilgrim [Wed, 16 Nov 2016 14:54:34 +0000 (14:54 +0000)]
[X86] Add integer division test for PR23590

Shows missed opportunity to recognise reduced integer division result size

llvm-svn: 287110

7 years agoFix -verify tests for older ccache versions
Eric Fiselier [Wed, 16 Nov 2016 14:48:42 +0000 (14:48 +0000)]
Fix -verify tests for older ccache versions

llvm-svn: 287109

7 years ago[X86][AVX512] Autoupgrade lossless i32/u32 to f64 conversion intrinsics with generic IR
Simon Pilgrim [Wed, 16 Nov 2016 14:48:32 +0000 (14:48 +0000)]
[X86][AVX512] Autoupgrade lossless i32/u32 to f64 conversion intrinsics with generic IR

Both the (V)CVTDQ2PD (i32 to f64) and (V)CVTUDQ2PD (u32 to f64) conversion instructions are lossless and can be safely represented as generic SINT_TO_FP/UINT_TO_FP calls instead of x86 intrinsics without affecting final codegen.

LLVM counterpart to D26686

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

llvm-svn: 287108

7 years ago[clang-tidy] New check to prefer transparent functors to non-transparent ones.
Gabor Horvath [Wed, 16 Nov 2016 14:42:10 +0000 (14:42 +0000)]
[clang-tidy] New check to prefer transparent functors to non-transparent ones.

llvm-svn: 287107