OSDN Git Service

android-x86/external-llvm.git
7 years ago[Hexagon] Fix typo in HexagonEarlyIfCConv.cpp
Krzysztof Parzyszek [Fri, 31 Mar 2017 20:36:00 +0000 (20:36 +0000)]
[Hexagon] Fix typo in HexagonEarlyIfCConv.cpp

Found by PVS-Studio. Fixes llvm.org/PR32480.

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

7 years agoFix 80-column violation in previous commit.
Stephen Canon [Fri, 31 Mar 2017 20:35:02 +0000 (20:35 +0000)]
Fix 80-column violation in previous commit.

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

7 years agoFix APFloat mod (committing for simonbyrne)
Stephen Canon [Fri, 31 Mar 2017 20:31:33 +0000 (20:31 +0000)]
Fix APFloat mod (committing for simonbyrne)

The previous version was prone to intermediate rounding or overflow.

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

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

7 years ago[DAGCombiner] add fold for 'All sign bits set?'
Sanjay Patel [Fri, 31 Mar 2017 20:28:06 +0000 (20:28 +0000)]
[DAGCombiner] add fold for 'All sign bits set?'

(and (setlt X,  0), (setlt Y,  0)) --> (setlt (and X, Y),  0)

We have 7 similar folds, but this one got away. The fact that the
x86 test with a branch didn't change is probably a separate bug. We
may also be missing this and the related folds in instcombine.

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

7 years ago[AMDGPU] Remove assumption that vector and scalar types do not alias
Stanislav Mekhanoshin [Fri, 31 Mar 2017 20:16:54 +0000 (20:16 +0000)]
[AMDGPU] Remove assumption that vector and scalar types do not alias

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

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

7 years ago[APInt] Remove shift functions from APIntOps namespace. Replace the few users with...
Craig Topper [Fri, 31 Mar 2017 20:01:16 +0000 (20:01 +0000)]
[APInt] Remove shift functions from APIntOps namespace. Replace the few users with the APInt class methods. NFCI

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

7 years agoDo not translate rint into nearbyint, but truncate it like nearbyint.
Joerg Sonnenberger [Fri, 31 Mar 2017 19:58:07 +0000 (19:58 +0000)]
Do not translate rint into nearbyint, but truncate it like nearbyint.

A common way to implement nearbyint is by fiddling with the floating
point environment and calling rint. This is used at least by the BSD
libm and musl. As such, canonicalizing the latter to the former will
create infinite loops for libm and generally pessimize performance, at
least when the generic C versions are used.

This change preserves the rint in the libcall translation and also
handles the domain truncation logic, so that rint with float argument
will be reduced to rintf etc.

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

7 years agoAMDGPU: Remove unnecessary ands when f16 is legal
Matt Arsenault [Fri, 31 Mar 2017 19:53:03 +0000 (19:53 +0000)]
AMDGPU: Remove unnecessary ands when f16 is legal

Add a new node to act as a fancy bitcast from f16 operations to
i32 that implicitly zero the high 16-bits of the result.

Alternatively could try making v2f16 legal and canonicalizing
on build_vectors.

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

7 years agoAMDGPU/R600: Fix amdgpu alias analysis pass.
Jan Vesely [Fri, 31 Mar 2017 19:26:23 +0000 (19:26 +0000)]
AMDGPU/R600: Fix amdgpu alias analysis pass.

R600 uses higher AS number to access kernel parameters

Fixes: r298846
Differential Revision: https://reviews.llvm.org/D31520

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

7 years ago[PowerPC] add tests for setcc+setcc+logic; NFC
Sanjay Patel [Fri, 31 Mar 2017 18:51:03 +0000 (18:51 +0000)]
[PowerPC] add tests for setcc+setcc+logic; NFC

These are the same tests added for x86 with r299238,
but PPC doesn't specify all branches as cheap, so we
see different patterns in tests with branches.

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

7 years ago[APInt] Rewrite getLoBits in a way that will do one less memory allocation in the...
Craig Topper [Fri, 31 Mar 2017 18:48:14 +0000 (18:48 +0000)]
[APInt] Rewrite getLoBits in a way that will do one less memory allocation in the multiword case. Rewrite getHiBits to use the class method version of lshr instead of the one in APIntOps. NFCI

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

7 years ago[APInt] Remove unused functions from the APIntOps namespace. The corresponding method...
Craig Topper [Fri, 31 Mar 2017 18:30:01 +0000 (18:30 +0000)]
[APInt] Remove unused functions from the APIntOps namespace. The corresponding methods on the APInt object should be used instead. NFC

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

7 years ago[DAGCombiner] remove redundant code and add comments; NFCI
Sanjay Patel [Fri, 31 Mar 2017 18:18:58 +0000 (18:18 +0000)]
[DAGCombiner] remove redundant code and add comments; NFCI

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

7 years ago[AArch64] Add new subtarget feature to fold LSL into address mode.
Balaram Makam [Fri, 31 Mar 2017 18:16:53 +0000 (18:16 +0000)]
[AArch64] Add new subtarget feature to fold LSL into address mode.

Summary:
This feature enables folding of logical shift operations of up to 3 places into addressing mode on Kryo and Falkor that have a fastpath LSL.

Reviewers: mcrosier, rengolin, t.p.northover

Subscribers: junbuml, gberry, llvm-commits, aemerson

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

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

7 years ago[x86] add/consolidate tests for setcc+setcc+and/or; NFC
Sanjay Patel [Fri, 31 Mar 2017 17:55:07 +0000 (17:55 +0000)]
[x86] add/consolidate tests for setcc+setcc+and/or; NFC

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

7 years agoImprove DebugInfo/strip-loop-metadata.ll test
Adam Nemet [Fri, 31 Mar 2017 17:51:12 +0000 (17:51 +0000)]
Improve DebugInfo/strip-loop-metadata.ll test

This wasn't covering for the case where you have multiple latches and hence
the use of the same loop-id which needs to be mapped to the same loop-id.

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

7 years ago[MSSA] Small test fix
Piotr Padlewski [Fri, 31 Mar 2017 17:39:07 +0000 (17:39 +0000)]
[MSSA] Small test fix

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

7 years ago[AVX-512] Update lowering for gather/scatter prefetch intrinsics to match the immedia...
Craig Topper [Fri, 31 Mar 2017 17:24:29 +0000 (17:24 +0000)]
[AVX-512] Update lowering for gather/scatter prefetch intrinsics to match the immediate encodings the frontend uses based on the _MM_HINT_T0/T1 constant values in clang's headers.

Our _MM_HINT_T0/T1 constant values are 3/2 which matches gcc, but not icc or Intel documentation. Interestingly gcc had this same bug on their implementation of the gather/scatter builtins at one point too.

Fixes PR32411.

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

7 years agoRename variable.
Rafael Espindola [Fri, 31 Mar 2017 17:11:51 +0000 (17:11 +0000)]
Rename variable.

Requested on post commit code review.

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

7 years agoFix the InstCombine to reserve the VP metadata and sets correct call count.
Dehao Chen [Fri, 31 Mar 2017 15:59:52 +0000 (15:59 +0000)]
Fix the InstCombine to reserve the VP metadata and sets correct call count.

Summary: Currently the VP metadata was dropped when InstCombine converts a call to direct call. This patch converts the VP metadata to branch_weights so that its hotness is recorded.

Reviewers: eraman, davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

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

7 years agoRefactor code to create getFallThrough method in MachineBasicBlock.
Jan Sjodin [Fri, 31 Mar 2017 15:55:37 +0000 (15:55 +0000)]
Refactor code to create getFallThrough method in MachineBasicBlock.

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

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

7 years agoRemove name space pollution from Signals.cpp
Kristof Beyls [Fri, 31 Mar 2017 14:58:52 +0000 (14:58 +0000)]
Remove name space pollution from Signals.cpp

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

7 years ago[mips][msa] Prevent output operand from commuting for dpadd_[su].df ins
Petar Jovanovic [Fri, 31 Mar 2017 14:31:55 +0000 (14:31 +0000)]
[mips][msa] Prevent output operand from commuting for dpadd_[su].df ins

Implementation of TargetInstrInfo::findCommutedOpIndices for MIPS target,
restricting commutativity to second and third operand only for
dpaadd_[su].df instructions therein.

Prior to this change, there were cases where the vector that is to be added
to the dot product of the other two could take a position other than the
first one in the instruction, generating false output in the destination
vector.

Such behavior has been noticed in the two functions generating v2i64 output
values so far. Other ones may exhibit such behavior as well, just not for
the vector operands which are present in the test at the moment.

Tests altered so that the function's first operand is a constant splat so
that it can be loaded with a ldi instruction, since that is the case in
which the erroneous instruction operand placement has occurred. We check
that the register which is present in the ldi instruction is placed as the
first operand in the corresponding dpadd instruction.

Patch by Stefan Maksimovic.

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

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

7 years agoRemove more name space pollution from .inc files
Kristof Beyls [Fri, 31 Mar 2017 14:26:44 +0000 (14:26 +0000)]
Remove more name space pollution from .inc files

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

7 years ago[DAGCombiner] Add ComputeNumSignBits vector demanded elements support to ASHR and...
Simon Pilgrim [Fri, 31 Mar 2017 14:21:50 +0000 (14:21 +0000)]
[DAGCombiner] Add ComputeNumSignBits vector demanded elements support to ASHR and INSERT_VECTOR_ELT

Followup to D31311

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

7 years ago[SystemZ] Make sure of correct regclasses in insertSelect()
Jonas Paulsson [Fri, 31 Mar 2017 14:06:59 +0000 (14:06 +0000)]
[SystemZ]  Make sure of correct regclasses in insertSelect()

Since LOCR only accepts GR32 virtual registers, its operands must be copied
into this regclass in insertSelect(), when an LOCR is built. Otherwise, the
case where the source operand was GRX32 will produce invalid IR.

Review: Ulrich Weigand

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

7 years ago[DAGCombiner] Add vector demanded elements support to ComputeNumSignBits
Simon Pilgrim [Fri, 31 Mar 2017 13:54:09 +0000 (13:54 +0000)]
[DAGCombiner] Add vector demanded elements support to ComputeNumSignBits

Currently ComputeNumSignBits returns the minimum number of sign bits for all elements of vector data, when we may only be interested in one/some of the elements.

This patch adds a DemandedElts argument that allows us to specify the elements we actually care about. The original ComputeNumSignBits implementation calls with a DemandedElts demanding all elements to match current behaviour. Scalar types set this to 1.

I've only added support for BUILD_VECTOR and EXTRACT_VECTOR_ELT so far, all others will default to demanding all elements but can be updated in due course.

Followup to D25691.

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

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

7 years agoDo not pollute the namespace in a header file.
Kristof Beyls [Fri, 31 Mar 2017 13:48:21 +0000 (13:48 +0000)]
Do not pollute the namespace in a header file.

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

7 years agoAdd a %basename substitution.
Rafael Espindola [Fri, 31 Mar 2017 13:41:10 +0000 (13:41 +0000)]
Add a %basename substitution.

This will be used to avoid various call to basename in the asan tests.

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

7 years ago[SystemZ] Skip DAGCombining of vector node for older subtargets.
Jonas Paulsson [Fri, 31 Mar 2017 13:22:59 +0000 (13:22 +0000)]
[SystemZ]  Skip DAGCombining of vector node for older subtargets.

Even on older subtargets that lack vector support, there may be vector values
with just one element in the input program. These are converted during DAG
legalization to scalar values.

The pre-legalize SystemZ DAGCombiner methods should in this circumstance not
touch these nodes. This patch adds a check for this in
SystemZTargetLowering::combineEXTRACT_VECTOR_ELT().

Review: Ulrich Weigand

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

7 years agoMake naming in Host.h in line with coding standards.
Kristof Beyls [Fri, 31 Mar 2017 13:06:40 +0000 (13:06 +0000)]
Make naming in Host.h in line with coding standards.

Based on post-commit review comments by Chandler Carruth on
https://reviews.llvm.org/D31236. Thanks!

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

7 years agoUse the current working directory in the glob expansion
Rafael Espindola [Fri, 31 Mar 2017 12:46:39 +0000 (12:46 +0000)]
Use the current working directory in the glob expansion

This fixes tests that do things like

mkdir <dir>
cd <dir>
..
<cmd> *.foo

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

7 years agoUpdate comment for r299098 per feedback from James Henderson.
Yaron Keren [Fri, 31 Mar 2017 12:08:45 +0000 (12:08 +0000)]
Update comment for r299098 per feedback from James Henderson.

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

7 years ago[ScalarEvolution] Re-enable Predicate implication from operations
Max Kazantsev [Fri, 31 Mar 2017 12:05:30 +0000 (12:05 +0000)]
[ScalarEvolution] Re-enable Predicate implication from operations

The patch rL298481 was reverted due to crash on clang-with-lto-ubuntu build.
The reason of the crash was type mismatch between either a or b and RHS in the following situation:

  LHS = sext(a +nsw b) > RHS.

This is quite rare, but still possible situation. Normally we need to cast all {a, b, RHS} to their widest type.
But we try to avoid creation of new SCEV that are not constants to avoid initiating recursive analysis that
can take a lot of time and/or cache a bad value for iterations number. To deal with this, in this patch we
reject this case and will not try to analyze it if the type of sum doesn't match with the type of RHS. In this
situation we don't need to create any non-constant SCEVs.

This patch also adds an assertion to the method IsProvedViaContext so that we could fail on it and not
go further into range analysis etc (because in some situations these analyzes succeed even when the passed
arguments have wrong types, what should not normally happen).

The patch also contains a fix for a problem with too narrow scope of the analysis caused by wrong
usage of predicates in recursive invocations.

The regression test on the said failure: test/Analysis/ScalarEvolution/implied-via-addition.ll

Reviewers: reames, apilipenko, anna, sanjoy

Reviewed By: sanjoy

Subscribers: mzolotukhin, mehdi_amini, llvm-commits

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

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

7 years agoDo not pollute the namespace in a header file.
Kristof Beyls [Fri, 31 Mar 2017 12:00:24 +0000 (12:00 +0000)]
Do not pollute the namespace in a header file.

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

7 years ago[AMDGPU] SDWA Peephole: improve search for immediates in SDWA patterns
Sam Kolton [Fri, 31 Mar 2017 11:42:43 +0000 (11:42 +0000)]
[AMDGPU] SDWA Peephole: improve search for immediates in SDWA patterns

Previously compiler often extracted common immediates into specific register, e.g.:
```
%vreg0 = S_MOV_B32 0xff;
%vreg2 = V_AND_B32_e32 %vreg0, %vreg1
%vreg4 = V_AND_B32_e32 %vreg0, %vreg3
```
Because of this SDWA peephole failed to find SDWA convertible pattern. E.g. in previous example this could be converted into 2 SDWA src operands:
```
SDWA src: %vreg2 src_sel:BYTE_0
SDWA src: %vreg4 src_sel:BYTE_0
```
With this change peephole check if operand is either immediate or register that is copy of immediate.

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

7 years ago[DAGCombiner] Add vector demanded elements support to computeKnownBitsForTargetNode
Simon Pilgrim [Fri, 31 Mar 2017 11:24:16 +0000 (11:24 +0000)]
[DAGCombiner] Add vector demanded elements support to computeKnownBitsForTargetNode

Follow up to D25691, this sets up the plumbing necessary to support vector demanded elements support in known bits calculations in target nodes.

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

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

7 years agoSpelling mistakes in comments. NFCI.
Simon Pilgrim [Fri, 31 Mar 2017 10:59:37 +0000 (10:59 +0000)]
Spelling mistakes in comments. NFCI.

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

7 years agoFix MSVC 'not all control paths return a value' warning
Simon Pilgrim [Fri, 31 Mar 2017 10:46:47 +0000 (10:46 +0000)]
Fix MSVC 'not all control paths return a value' warning

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

7 years agoFix signed/unsigned warning
Simon Pilgrim [Fri, 31 Mar 2017 10:45:35 +0000 (10:45 +0000)]
Fix signed/unsigned warning

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

7 years agoInstsimplify: Adding shufflevector test. NFC.
Zvi Rackover [Fri, 31 Mar 2017 07:46:02 +0000 (07:46 +0000)]
Instsimplify: Adding shufflevector test. NFC.

Adding some test-cases demonstrating cases that need to be improved.
To be followed by patches that improve these cases.

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

7 years ago[APInt] Add unittests that demonstrate how very broken APIntOps::isShiftedMask is.
Craig Topper [Fri, 31 Mar 2017 06:30:25 +0000 (06:30 +0000)]
[APInt] Add unittests that demonstrate how very broken APIntOps::isShiftedMask is.

Did you know that 0 is a shifted mask? But 0x0000ff00 and 0x000000ff aren't? At least we get 0xff000000 right.

I only see one usage of this function in the code base today and its in InstCombine. I think its protected against 0 being misreported as a mask. I guess we just don't have tests for the missed cases.

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

7 years ago[Scalarizer] Handle scalar arguments in vector GEP
Mikael Holmen [Fri, 31 Mar 2017 06:29:49 +0000 (06:29 +0000)]
[Scalarizer] Handle scalar arguments in vector GEP

Summary:
Triggered by commit r298620: "[LV] Vectorize GEPs".

If we encounter a vector GEP with scalar arguments, we splat the scalar
into a vector of appropriate size before we scatter the argument.

Reviewers: arsenm, mehdi_amini, bkramer

Reviewed By: arsenm

Subscribers: bjope, mssimpso, wdng, llvm-commits

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

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

7 years agoGo binding: Add GetCurrentDebugLocation to obtain debug location from builder
Andrew Wilkins [Fri, 31 Mar 2017 04:59:57 +0000 (04:59 +0000)]
Go binding: Add GetCurrentDebugLocation to obtain debug location from builder

Summary:

Currently Go binding only has SetCurrentDebugLocation method.
I added GetCurrentDebugLocation method to IRBuilder instance.

I added this because I want to save current debug location, change debug location temporary and restore the saved one finally.
This is useful when source location jumps and goes back after while LLVM IR generation.

I also added tests for this to ir_test.go.
I confirmed that all test passed with this patch based on r298890

Patch by Ryuichi Hayashida!

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

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

7 years agoRe-apply r299168 and r299169 now that the libdeps are fixed.
Peter Collingbourne [Fri, 31 Mar 2017 04:47:07 +0000 (04:47 +0000)]
Re-apply r299168 and r299169 now that the libdeps are fixed.

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

7 years agoMove llvm::emitLinkerFlagsForGlobalCOFF() to Mangler.
Peter Collingbourne [Fri, 31 Mar 2017 04:46:50 +0000 (04:46 +0000)]
Move llvm::emitLinkerFlagsForGlobalCOFF() to Mangler.

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

7 years agoMove llvm::canBeOmittedFromSymbolTable() to Analysis.
Peter Collingbourne [Fri, 31 Mar 2017 04:46:31 +0000 (04:46 +0000)]
Move llvm::canBeOmittedFromSymbolTable() to Analysis.

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

7 years ago[libFuzzer] simplify the code a bit
Kostya Serebryany [Fri, 31 Mar 2017 04:17:45 +0000 (04:17 +0000)]
[libFuzzer] simplify the code a bit

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

7 years ago[libFuzzer] tests: don't test 64-bit comparison on 32-bit builds
Kostya Serebryany [Fri, 31 Mar 2017 03:51:40 +0000 (03:51 +0000)]
[libFuzzer] tests: don't test 64-bit comparison on 32-bit builds

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

7 years ago[libFuzzer] ensure that strncmp is not inlined in a test
Kostya Serebryany [Fri, 31 Mar 2017 03:34:33 +0000 (03:34 +0000)]
[libFuzzer] ensure that strncmp is not inlined in a test

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

7 years ago[XRay][docs] Add XRayExample to docindex.
Dean Michael Berris [Fri, 31 Mar 2017 02:51:19 +0000 (02:51 +0000)]
[XRay][docs] Add XRayExample to docindex.

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

7 years agoRevert r299168 and r299169 due to library dependency issues.
Peter Collingbourne [Fri, 31 Mar 2017 02:44:50 +0000 (02:44 +0000)]
Revert r299168 and r299169 due to library dependency issues.

http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/25073/steps/build_llvmclang/logs/stdio

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

7 years agoFix 32-bit build.
Peter Collingbourne [Fri, 31 Mar 2017 02:32:53 +0000 (02:32 +0000)]
Fix 32-bit build.

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

7 years agoLTO: Reduce memory consumption by creating an in-memory symbol table for InputFiles...
Peter Collingbourne [Fri, 31 Mar 2017 02:28:30 +0000 (02:28 +0000)]
LTO: Reduce memory consumption by creating an in-memory symbol table for InputFiles. NFCI.

Introduce symbol table data structures that can be potentially written to
disk, have the LTO library build those data structures using temporarily
constructed modules and redirect the LTO library implementation to go through
those data structures. This allows us to remove the LLVMContext and Modules
owned by InputFile.

With this change I measured a peak memory consumption decrease from 5.4GB to
2.8GB in a no-op incremental ThinLTO link of Chromium on Linux. The impact on
memory consumption is larger in COFF linkers where we are currently forced
to materialize all metadata in order to read linker options. Peak memory
consumption linking a large piece of Chromium for Windows with full LTO and
debug info decreases from >64GB (OOM) to 15GB.

Part of PR27551.

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

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

7 years ago[libFuzzer] make sure we don't execute libFuzzer's mem* and str* hooks while calling...
Kostya Serebryany [Fri, 31 Mar 2017 02:21:28 +0000 (02:21 +0000)]
[libFuzzer] make sure we don't execute libFuzzer's mem* and str* hooks while calling mem*/str* inside libFuzzer itself

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

7 years agoTemporarily revert "[PPC] In PPCBoolRetToInt change the bool value to i64 if the...
Eric Christopher [Fri, 31 Mar 2017 02:16:54 +0000 (02:16 +0000)]
Temporarily revert "[PPC] In PPCBoolRetToInt change the bool value to i64 if the target is ppc64" as it's causing test failures, I've given Carrot a testcase offline.

This reverts commit r298955.

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

7 years ago[XRay][tools] Remove some assertions in llvm-xray graph
Dean Michael Berris [Fri, 31 Mar 2017 01:56:45 +0000 (01:56 +0000)]
[XRay][tools] Remove some assertions in llvm-xray graph

Summary:
Assertions assuming that function calls may not have zero durations do
not seem to hold in the wild. There are valid cases where the conversion
of the tsc counters end up becoming zero-length durations. These
assertions don't really hold and the algorithms don't need those to be
true for them to work.

Reviewers: dblaikie, echristo

Subscribers: llvm-commits

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

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

7 years agoFix typo, defind -> defined.
Eric Christopher [Fri, 31 Mar 2017 01:46:30 +0000 (01:46 +0000)]
Fix typo, defind -> defined.

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

7 years ago[libFuzzer] try to fix value-profile-strncmp on the Mac bot
Kostya Serebryany [Fri, 31 Mar 2017 00:52:39 +0000 (00:52 +0000)]
[libFuzzer] try to fix value-profile-strncmp on the Mac bot

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

7 years agoModuleSummaryAnalysis: Use a more precise #include. NFC.
Peter Collingbourne [Fri, 31 Mar 2017 00:08:24 +0000 (00:08 +0000)]
ModuleSummaryAnalysis: Use a more precise #include. NFC.

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

7 years ago[WebAssembly] Initial linking metadata support
Dan Gohman [Thu, 30 Mar 2017 23:58:19 +0000 (23:58 +0000)]
[WebAssembly] Initial linking metadata support

Add support for the new relocations and linking metadata section support in
https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md. In
particular, this allows LLVM to indicate which variable is the stack pointer,
so that it can be linked with other objects.

This also adds support for emitting type relocations for call_indirect
instructions.

Right now, this is mainly tested by using wabt and hexdump to examine the
output on selected testcases. We'll add more tests as the design stablizes
and more of the pieces are in place.

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

7 years agoAMDGPU: Rename isKernel
Matt Arsenault [Thu, 30 Mar 2017 23:58:04 +0000 (23:58 +0000)]
AMDGPU: Rename isKernel

What we really want to do is distinguish functions that may
be called by other functions, and graphics shaders are not
called kernels.

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

7 years ago[XRay][docs] Examples for how to use XRay
Dean Michael Berris [Thu, 30 Mar 2017 23:46:36 +0000 (23:46 +0000)]
[XRay][docs] Examples for how to use XRay

Summary:
This document is an attempt at showing how XRay could be used to debug
latency issues with LLVM tools, and how to use the llvm-xray tool to
analyse XRay traces.

Reviewers: echristo, mehdi_amini, davide

Subscribers: llvm-commits

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

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

7 years agoThinLTOBitcodeWriter: Use Module::global_values(). NFCI.
Peter Collingbourne [Thu, 30 Mar 2017 23:43:08 +0000 (23:43 +0000)]
ThinLTOBitcodeWriter: Use Module::global_values(). NFCI.

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

7 years agoLangRef: Don't refer to a 'generic' address space.
Matt Arsenault [Thu, 30 Mar 2017 23:36:47 +0000 (23:36 +0000)]
LangRef: Don't refer to a 'generic' address space.

Consistently call this the default address space.

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

7 years agoAdd testcase for r299124.
Eric Christopher [Thu, 30 Mar 2017 22:35:10 +0000 (22:35 +0000)]
Add testcase for r299124.

Patch by Tim Shen!

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

7 years agogetPristineRegs is not accurately considering shrink wrapping puts
Eric Christopher [Thu, 30 Mar 2017 22:34:20 +0000 (22:34 +0000)]
getPristineRegs is not accurately considering shrink wrapping puts
registers not saved in certain blocks. Use explicit getCalleeSavedInfo
and isLiveIn instead.

This fixes pr32292.

Patch by Tim Shen!

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

7 years ago[InstCombine] Fix typo last->least. NFC
Craig Topper [Thu, 30 Mar 2017 22:28:55 +0000 (22:28 +0000)]
[InstCombine] Fix typo last->least. NFC

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

7 years agoAMDGPU: Add all atomicrmw fields to atomic.inc/dec
Matt Arsenault [Thu, 30 Mar 2017 22:21:40 +0000 (22:21 +0000)]
AMDGPU: Add all atomicrmw fields to atomic.inc/dec

Add scope, order, isVolatile

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

7 years ago[InstSimplify] Use m_SignBit instead of calling getSignBit and using m_Specific....
Craig Topper [Thu, 30 Mar 2017 22:21:16 +0000 (22:21 +0000)]
[InstSimplify] Use m_SignBit instead of calling getSignBit and using m_Specific. NFCI

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

7 years ago[InstSimplify] Use APInt::isMaxSignedValue() instead of comparing with ~APInt::getSig...
Craig Topper [Thu, 30 Mar 2017 22:10:54 +0000 (22:10 +0000)]
[InstSimplify] Use APInt::isMaxSignedValue() instead of comparing with ~APInt::getSignBit. NFC

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

7 years ago[SimplifyIndvar] Replace the sdiv used by IV if we can prove both of its operands...
Hongbin Zheng [Thu, 30 Mar 2017 21:56:56 +0000 (21:56 +0000)]
[SimplifyIndvar] Replace the sdiv used by IV if we can prove both of its operands are non-negative

Since there is no sdiv in SCEV, an 'udiv' is a better canonical form than an 'sdiv' as the user of induction variable

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

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

7 years ago[AVX-512] Fix bad comment from r299112. NFC
Craig Topper [Thu, 30 Mar 2017 21:05:33 +0000 (21:05 +0000)]
[AVX-512] Fix bad comment from r299112. NFC

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

7 years agoUse os.path.realpath when tracking the cwd.
Rafael Espindola [Thu, 30 Mar 2017 21:05:31 +0000 (21:05 +0000)]
Use os.path.realpath when tracking the cwd.

This is needed by TestCases/Posix/coverage-direct.cc

The problem is that the test does:

mkdir <dir>
cd <dir>
cd ..
rm -rf <dir>
<more commands>

the current directory currently looks like "/.../<dir>/../" which
doesn't exist when dir is deleted.

at some point we should probably switch to using the os current
directory (specially if we want to add subshell), but this is a small
incremental improvement.

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

7 years ago[AVX-512] Fix another case where fastisel was generating a GR8 to VK1 copy. This...
Craig Topper [Thu, 30 Mar 2017 21:02:52 +0000 (21:02 +0000)]
[AVX-512] Fix another case where fastisel was generating a GR8 to VK1 copy. This time after calls returning i1.

Fixes PR32472.

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

7 years agolit: support redirect from globs
Rafael Espindola [Thu, 30 Mar 2017 20:48:58 +0000 (20:48 +0000)]
lit: support redirect from globs

This adds support for commands like

FileCheck < foobar*

which is used by some asan tests because the file they want to read
has a pid in the name.

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

7 years ago[AMDGPU] Add GlobalOpt parameter to Always Inliner pass
Stanislav Mekhanoshin [Thu, 30 Mar 2017 20:16:02 +0000 (20:16 +0000)]
[AMDGPU] Add GlobalOpt parameter to Always Inliner pass

If set to false it does not remove global aliases. With this parameter
set to false it should be safe to run the pass before link.

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

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

7 years agoTeach stripNonLineTableDebugInfo() to remap DILocations in !llvm.loop nodes.
Adrian Prantl [Thu, 30 Mar 2017 20:10:56 +0000 (20:10 +0000)]
Teach stripNonLineTableDebugInfo() to remap DILocations in !llvm.loop nodes.

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

7 years ago[Object] Remove check for BIND_OPCODE_DONE/REBASE_OPCODE_DONE.
Juergen Ributzka [Thu, 30 Mar 2017 19:56:50 +0000 (19:56 +0000)]
[Object] Remove check for BIND_OPCODE_DONE/REBASE_OPCODE_DONE.

BIND_OPCODE_DONE/REBASE_OPCODE_DONE may appear at the end of the opcode array,
but they are not required to. The linker only adds them as padding to align the
opcodes to pointer size.

This fixes rdar://problem/31285560.

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

7 years ago[AArch64ISelLowering] Remove `else` after `return` in LowerGlobalTLSAddress.
Davide Italiano [Thu, 30 Mar 2017 19:52:31 +0000 (19:52 +0000)]
[AArch64ISelLowering] Remove `else` after `return` in LowerGlobalTLSAddress.

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

7 years ago[AArch64] Simplify isSingExtended()/isZeroExtended(). NFCI.
Davide Italiano [Thu, 30 Mar 2017 19:46:18 +0000 (19:46 +0000)]
[AArch64] Simplify isSingExtended()/isZeroExtended(). NFCI.

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

7 years ago[WebAssembly] Improve support for WebAssembly binary format
Derek Schuff [Thu, 30 Mar 2017 19:44:09 +0000 (19:44 +0000)]
[WebAssembly] Improve support for WebAssembly binary format

Mostly this change adds support converting to and from
YAML which will allow us to write more test cases for
the WebAssembly MC and lld ports.

Better support for objdump, readelf, and nm will be in
followup CLs.

I had to update the two wasm test binaries because they
used the old style 'name' section which is no longer
supported.

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

Patch by Sam Clegg

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

7 years agoFollowing r297661, disable dup workaround to disable duplicate STDOUT fd closing...
Yaron Keren [Thu, 30 Mar 2017 19:30:51 +0000 (19:30 +0000)]
Following r297661, disable dup workaround to disable duplicate STDOUT fd closing and instead directly prevent closing of STD* file descriptors.

We do not want to close STDOUT as there may have been several uses of it
such as the case: llc %s -o=- -pass-remarks-output=- -filetype=asm
which cause multiple closes of STDOUT_FILENO and/or use-after-close of it.
Using dup() in getFD doesn't work as we end up with original STDOUT_FILENO
open anyhow.

reviewed by Rafael Espindola

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

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

7 years ago[DAGCombiner] Initial support for the fast-math flag contract
Adam Nemet [Thu, 30 Mar 2017 18:53:04 +0000 (18:53 +0000)]
[DAGCombiner] Initial support for the fast-math flag contract

Now alternatively to the TargetOption.AllowFPOpFusion global flag, FMUL->FADD
can also use the per operation FMF to allow fusion.

The idea here is not to port everything to the new scheme (e.g. fused
multiply-and-sub will be ported later) but that this work all the way from
clang.

The transformation is conditionalized on *both* the FADD and the FMUL having
the FMF contract flag.

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

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

7 years ago[CodeGen] Pass SDAG an ORE, and replace FastISel stats with remarks.
Ahmed Bougacha [Thu, 30 Mar 2017 17:49:58 +0000 (17:49 +0000)]
[CodeGen] Pass SDAG an ORE, and replace FastISel stats with remarks.

In the long-term, we want to replace statistics with something
finer-grained that lets us gather per-function data.
Remarks are that replacement.

Create an ORE instance in SelectionDAGISel, and pass it to
SelectionDAG.

SelectionDAG was used so that we can emit remarks from all
SelectionDAG-related code, including TargetLowering and DAGCombiner.
This isn't used in the current patch but Adam tells me he's interested
for the fp-contract combines.

Use the ORE instance to emit FastISel failures as remarks (instead of
the mix of dbgs() dumps and statistics that we currently have).

Eventually, we want to have an API that tells us whether remarks are
enabled (http://llvm.org/PR32352) so that we don't emit expensive
remarks (in this case, dumping IR) when it's not needed.  For now, use
'isEnabled' as a crude replacement.

This does mean that the replacement for '-fast-isel-verbose' is now
'-pass-remarks-missed=isel'.  Additionally, clang users also need to
enable remark diagnostics, using '-Rpass-missed=isel'.

This also removes '-fast-isel-verbose2': there are no static statistics
that we want to only enable in asserts builds, so we can always use
the remarks regardless of the build type.

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

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

7 years ago[DAGCombiner] add helper function for visitORLike; NFCI
Sanjay Patel [Thu, 30 Mar 2017 17:32:42 +0000 (17:32 +0000)]
[DAGCombiner] add helper function for visitORLike; NFCI

This combines all of the equivalent clean-ups for foldAndOfSetCCs:
https://reviews.llvm.org/rL298938
https://reviews.llvm.org/rL298940
https://reviews.llvm.org/rL298944
https://reviews.llvm.org/rL298949
https://reviews.llvm.org/rL298950
https://reviews.llvm.org/rL299002
https://reviews.llvm.org/rL299013

The sins of code duplication are on full display here:
each function is missing a fold that wasn't copied over from its logical sibling.

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

7 years ago[yaml2obj] Enable and fix tests
Chris Bieneman [Thu, 30 Mar 2017 16:35:02 +0000 (16:35 +0000)]
[yaml2obj] Enable and fix tests

Summary:
These tests were not being run because the yaml extension
wasn't be picked up by lit.

This change also fixes the tests which themselves were broken.

Patch By: Sam Clegg

Reviewers: beanz

Reviewed By: beanz

Subscribers: fhahn

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

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

7 years agoTest commit.
Andrew Ng [Thu, 30 Mar 2017 13:17:25 +0000 (13:17 +0000)]
Test commit.

Correct assertion messages in MachineOperand for some of the setters.

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

7 years agoSpelling mistakes in comments. NFCI.
Simon Pilgrim [Thu, 30 Mar 2017 12:59:53 +0000 (12:59 +0000)]
Spelling mistakes in comments. NFCI.

Based on corrections mentioned in patch for clang for PR27635

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

7 years agoSpelling mistakes in comments. NFCI.
Simon Pilgrim [Thu, 30 Mar 2017 12:30:15 +0000 (12:30 +0000)]
Spelling mistakes in comments. NFCI.

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

7 years agoRevert "Make naming in Host.h in line with coding standards."
Kristof Beyls [Thu, 30 Mar 2017 11:06:25 +0000 (11:06 +0000)]
Revert "Make naming in Host.h in line with coding standards."

This reverts r299062, which caused build failures on Windows.
It also reverts the attempts to fix the windows builds in r299064 and r299065.
The introduction of namespace llvm::sys::detail makes MSVC, and seemingly also
mingw, complain about ambiguity with the existing namespace llvm::detail.
E.g.:
C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/MathExtras.h(184): error C2872: 'detail': ambiguous symbol
C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/PointerLikeTypeTraits.h(31): note: could be 'llvm::detail'
C:\b\slave\sanitizer-windows\llvm\include\llvm/Support/Host.h(80): note: or       'llvm::sys::detail'

In r299064 and r299065 I tried to fix these ambiguities, based on the errors
reported in the log files. It seems however that the build stops early when
this kind of error is encountered, and many build-then-fix-iterations on
Windows may be needed to fix this. Therefore reverting r299062 for now to
get the build working again on Windows.

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

7 years agoAnother attempt fix the Windows builds
Kristof Beyls [Thu, 30 Mar 2017 10:47:41 +0000 (10:47 +0000)]
Another attempt fix the Windows builds

By changing more detail::... to llvm::detail::...

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

7 years agoAttempt to fix the Windows builds by using llvm::detail::... instead of detail::...
Kristof Beyls [Thu, 30 Mar 2017 10:14:40 +0000 (10:14 +0000)]
Attempt to fix the Windows builds by using llvm::detail::... instead of detail::...

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

7 years ago[globalisel][tablegen] Change Expected<bool> to Error and rename functions.
Daniel Sanders [Thu, 30 Mar 2017 09:36:33 +0000 (09:36 +0000)]
[globalisel][tablegen] Change Expected<bool> to Error and rename functions.

Functions that still return Expected<X> are now called createAndImport*()

Changing the return type was requested in the review comments for r299001

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

7 years agoMake naming in Host.h in line with coding standards.
Kristof Beyls [Thu, 30 Mar 2017 09:31:59 +0000 (09:31 +0000)]
Make naming in Host.h in line with coding standards.

Based on post-commit review comments by Chandler Carruth on
https://reviews.llvm.org/D31236. Thanks!

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

7 years agoRefactor getHostCPUName to allow testing on non-native hardware.
Kristof Beyls [Thu, 30 Mar 2017 07:24:49 +0000 (07:24 +0000)]
Refactor getHostCPUName to allow testing on non-native hardware.

This refactors getHostCPUName so that for the architectures that get the
host cpu info on linux from /proc/cpuinfo, the /proc/cpuinfo parsing
logic is present in the build, even if it wasn't built on a linux system
for that architecture.

Since the code is present in the build, we can then test that code also
on other systems, i.e. we don't need to have buildbots setup for all
architectures on linux to be able to test this. Instead, developers will
test this as part of the regression test run.

As an example, a few unit tests are added to test getHostCPUName for ARM
running linux. A unit test is preferred over a lit-based test, since the
expectation is that in the future, the functionality here will grow over
what can be tested with "llc -mcpu=native".

This is a preparation step to enable implementing the range of
improvements discussed on PR30516, such as adding AArch64 support,
support for big.LITTLE systems, reducing code duplication.

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

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

7 years ago[APInt] Remove references to integerPartWidth outside of APFloat implentation.
Craig Topper [Thu, 30 Mar 2017 05:49:03 +0000 (05:49 +0000)]
[APInt] Remove references to integerPartWidth outside of APFloat implentation.

Turns out integerPartWidth only explicitly defines the width of the tc functions in the APInt class. Functions that aren't used by APInt implementation itself. Many places in the code base already assume APInt is made up of 64-bit pieces. Explicitly assuming 64-bit here doesn't make that situation much worse. A full audit would need to be done if it ever changes.

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

7 years ago[libFuzzer] remove a stale flag from tests, run value-profile-strncmp.test longer...
Kostya Serebryany [Thu, 30 Mar 2017 04:22:20 +0000 (04:22 +0000)]
[libFuzzer] remove a stale flag from tests, run value-profile-strncmp.test longer (hopefully, will fix the OSX bot)

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

7 years ago[DAGCombine] A shuffle of a splat is always the splat itself
Zvi Rackover [Thu, 30 Mar 2017 01:42:57 +0000 (01:42 +0000)]
[DAGCombine]  A shuffle of a splat is always the splat itself

Summary:
Add a simplification:
shuffle (splat-shuffle), undef, M --> splat-shuffle

Fixes pr32449

Patch by Sanjay Patel

Reviewers: eli.friedman, RKSimon, spatel

Reviewed By: spatel

Subscribers: llvm-commits

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

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

7 years ago[libFuzzer] best effort support for -fsanitize-coverage=trace-pc instrumentation...
Kostya Serebryany [Thu, 30 Mar 2017 01:27:20 +0000 (01:27 +0000)]
[libFuzzer] best effort support for -fsanitize-coverage=trace-pc instrumentation. It is less efficient and precise than -fsanitize-coverage=trace-pc-guard, but still works

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