OSDN Git Service
Chris Kennelly [Tue, 8 Jan 2019 04:04:51 +0000 (04:04 +0000)]
[NFC] Remove empty line as a test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350605
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Tue, 8 Jan 2019 04:00:22 +0000 (04:00 +0000)]
gn build: Stop passing -o to ar.
The -o flag means something different to ar than what appears to be
intended here. Also, llvm-ar doesn't accept the flag in this position.
Differential Revision: https://reviews.llvm.org/D56426
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350604
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Tue, 8 Jan 2019 01:46:57 +0000 (01:46 +0000)]
gn build: Merge r350580.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350600
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 8 Jan 2019 01:30:02 +0000 (01:30 +0000)]
AMDGPU/GlobalISel: Legalize concat_vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350598
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 8 Jan 2019 01:25:47 +0000 (01:25 +0000)]
Fix typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350597
91177308-0d34-0410-b5e6-
96231b3b80d8
Heejin Ahn [Tue, 8 Jan 2019 01:25:12 +0000 (01:25 +0000)]
[WebAssembly] Move CFG-changing passes before RegStackify
Summary:
FixIrreducibleControlFlow and LateEHPrepare both possibly modify CFG and
create new registers. There seems to be no reason these passes go after
register-related optimization passes (PrepareForLiveIntervals,
OptimizeLiveIntervals, StoreResults, RegStackify, and RegColoring), and
this also possibly create new optimization opportunities. I think we
should put all current and future optimization passes before RegStackify
(and related passes) unless there's a reason not to.
Reviewers: kripken
Subscribers: dschuff, sbc100, sunfish, jgravelle-google, llvm-commits
Differential Revision: https://reviews.llvm.org/D56356
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350596
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 8 Jan 2019 01:22:47 +0000 (01:22 +0000)]
RegBankSelect: Fix copy insertion point for terminators
If a copy was needed to handle the condition of brcond, it was being
inserted before the defining instruction. Add tests for iterator edge
cases.
I find the existing code here suspect for the case where it's looking
for terminators that modify the register. It's going to insert a copy
in the middle of the terminators, which isn't allowed (it might be
necessary to have a COPY_terminator if anybody actually needs this).
Also legalize brcond for AMDGPU.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350595
91177308-0d34-0410-b5e6-
96231b3b80d8
Heejin Ahn [Tue, 8 Jan 2019 01:15:15 +0000 (01:15 +0000)]
[WebAssembly] Use 'I' multiclass template for br_table (NFC)
Summary:
We don't need to explicitly use `NI` anymore because we now don't use
`let` statements within the definitions.
Reviewers: aardappel
Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D56376
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350594
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 8 Jan 2019 01:13:20 +0000 (01:13 +0000)]
AMDGPU/GlobalISel: Disallow VGPR->SCC copies
This fixes using scalar adds when only the carry in is a VGPR
using greedy regbankselect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350593
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 8 Jan 2019 01:09:09 +0000 (01:09 +0000)]
AMDGPU/GlobalISel: RegBankSelect for carry-in
I'm not sure we should be allowing the truncate
to s1 for the inputs. It may be necessary to
create a new VCC reg bank.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350592
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Tue, 8 Jan 2019 01:08:09 +0000 (01:08 +0000)]
[dsymutil] Fix assertion triggered by empty address range.
An assertion was hit when running dsymutil on a gcc generated binary
that contained an empty address range. Address ranges are stored in an
interval map of half open intervals. Since the interval is empty and
therefore meaningless, we simply don't add it to the map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350591
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 8 Jan 2019 01:03:58 +0000 (01:03 +0000)]
AMDGPU/GlobalISel: RegBankSelect for add/sub with carry out
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350589
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 8 Jan 2019 00:46:19 +0000 (00:46 +0000)]
AMDGPU/GlobalISel: InstrMapping for G_UNMERGE_VALUES
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350588
91177308-0d34-0410-b5e6-
96231b3b80d8
Chen Zheng [Tue, 8 Jan 2019 00:40:01 +0000 (00:40 +0000)]
fix comment typo - NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350587
91177308-0d34-0410-b5e6-
96231b3b80d8
Wei Mi [Tue, 8 Jan 2019 00:26:11 +0000 (00:26 +0000)]
[RegisterCoalescer] dst register's live interval needs to be updated when
merging a src register in ToBeUpdated set.
This is to fix PR40061 related with https://reviews.llvm.org/rL339035.
In https://reviews.llvm.org/rL339035, live interval of source pseudo register
in rematerialized copy may be saved in ToBeUpdated set and its update may be
postponed.
In PR40061, %t2 = %t1 is rematerialized and %t1 is added into toBeUpdated set
to postpone its live interval update. After the rematerialization, the live
interval of %t1 is larger than necessary. Then %t1 is merged into %t3 and %t1
gets removed. After the merge, %t3 contains live interval larger than necessary.
Because %t3 is not in toBeUpdated set, its live interval is not updated after
register coalescing and it will break some assumption in regalloc.
The patch requires the live interval of destination register in a merge to be
updated if the source register is in ToBeUpdated.
Differential revision: https://reviews.llvm.org/D55867
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350586
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Mon, 7 Jan 2019 23:27:25 +0000 (23:27 +0000)]
[dsymutil] Upstream unobfuscation logic.
The unobufscation support for BCSymbolMaps was the last piece of code
that hasn't been upstreamed yet. This patch contains a reworked version
of the existing code and relevant tests.
Differential revision: https://reviews.llvm.org/D56346
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350580
91177308-0d34-0410-b5e6-
96231b3b80d8
Rong Xu [Mon, 7 Jan 2019 23:25:56 +0000 (23:25 +0000)]
[PGO] Use SourceFileName rather module name in PGOFuncName
In LTO or Thin-lto mode (though linker plugin), the module
names are of temp file names which are different for
different compilations. Using SourceFileName avoids the issue.
This should not change any functionality for current PGO as
all the current callers of getPGOFuncName() is before LTO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350579
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 7 Jan 2019 23:09:09 +0000 (23:09 +0000)]
[Verifier] Reject invalid type for DILocalVariable.
Reviewers: aprantl
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D56414
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350578
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ferguson [Mon, 7 Jan 2019 21:02:22 +0000 (21:02 +0000)]
[ValueTracking] Adjust comment in test
Adjusts a comment in this test to verify commit access.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350569
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 7 Jan 2019 21:00:32 +0000 (21:00 +0000)]
Recommit r350554 "[X86] Remove AVX512VBMI2 concat and shift intrinsics. Replace with target independent funnel shift intrinsics."
The MSVC limit we hit on AutoUpgrade.cpp has been worked around for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350567
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Mon, 7 Jan 2019 20:55:33 +0000 (20:55 +0000)]
[ObjectYAML] [COFF] Support multiple symbols with the same name
Differential Revision: https://reviews.llvm.org/D56294
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350566
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 7 Jan 2019 20:13:45 +0000 (20:13 +0000)]
[X86][AutoUpgrade] Make some tweaks to reduce the number of nested if/else in the intrinsic upgrade code to avoid an MSVC compiler limit.
MSVC has a nesting limit of around 110-130. An if/else if/else if counts against this next level. The autoupgrade code consists a long chain of these checking matches against strings.
This commit moves some code to a helper function to move out a large if/else chain that was inside of one of the blocks into a separate function. There are more of these we could move or we could change some to lookup tables.
I've also merged together a few similar blocks in the outer chain. This should buy us some margin for a little bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350564
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 7 Jan 2019 19:39:05 +0000 (19:39 +0000)]
Revert r350554 "[X86] Remove AVX512VBMI2 concat and shift intrinsics. Replace with target independent funnel shift intrinsics."
The AutoUpgrade.cpp if/else cascade hit an MSVC limit again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350562
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Mon, 7 Jan 2019 19:38:47 +0000 (19:38 +0000)]
[MemorySSA] Add SkipSelfWalker.
Summary: Add implementation of SkipSelfWalker.
Reviewers: george.burgess.iv
Subscribers: sanjoy, jlebar, Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D56285
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350561
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 7 Jan 2019 19:30:43 +0000 (19:30 +0000)]
[TargetLowering][AMDGPU] Remove the SimplifyDemandedBits function that takes a User and OpIdx. Stop using it in AMDGPU target for simplifyI24.
As we saw in D56057 when we tried to use this function on X86, it's unsafe. It allows the operand node to have multiple users, but doesn't prevent recursing past the first node when it does have multiple users. This can cause other simplifications earlier in the graph without regard to what bits are needed by the other users of the first node. Ideally all we should do to the first node if it has multiple uses is bypass it when its not needed by the user we started from. Doing any other transformation that SimplifyDemandedBits can do like turning ZEXT/SEXT into AEXT would result in an increase in instructions.
Fortunately, we already have a function that can do just that, GetDemandedBits. It will only make transformations that involve bypassing a node.
This patch changes AMDGPU's simplifyI24, to use a combination of GetDemandedBits to handle the multiple use simplifications. And then uses the regular SimplifyDemandedBits on each operand to handle simplifications allowed when the operand only has a single use. Unfortunately, GetDemandedBits simplifies constants more aggressively than SimplifyDemandedBits. This caused the -7 constant in the changed test to be simplified to remove the upper bits. I had to modify computeKnownBits to account for this by ignoring the upper 8 bits of the input.
Differential Revision: https://reviews.llvm.org/D56087
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350560
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Mon, 7 Jan 2019 19:22:37 +0000 (19:22 +0000)]
[MemorySSA] Refactor CachingWalker.
Summary:
Refactor caching walker to make creating a walker that skips the
starting access strightforward.
Reviewers: george.burgess.iv
Subscribers: sanjoy, jlebar, Prazek, llvm-commits, jfb
Differential Revision: https://reviews.llvm.org/D55957
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350558
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 7 Jan 2019 19:10:12 +0000 (19:10 +0000)]
[X86] Remove AVX512VBMI2 concat and shift intrinsics. Replace with target independent funnel shift intrinsics.
Differential Revision: https://reviews.llvm.org/D56377
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350554
91177308-0d34-0410-b5e6-
96231b3b80d8
Diogo N. Sampaio [Mon, 7 Jan 2019 19:01:47 +0000 (19:01 +0000)]
[ARM] ComputeKnownBits to handle extract vectors
This patch adds the sign/zero extension done by
vgetlane to ARM computeKnownBitsForTargetNode.
Differential revision: https://reviews.llvm.org/D56098
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350553
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Mon, 7 Jan 2019 18:40:27 +0000 (18:40 +0000)]
[MemorySSA] Extend the clobber walker with the option to skip the starting access.
Summary:
The option enables loop transformations to hoist accesses that do not
have clobbers in the loop. If the clobber queries skips the starting
access, the result may be outside the loop instead of the header Phi.
Adding the walker that uses this option in a separate patch.
Reviewers: george.burgess.iv
Subscribers: sanjoy, jlebar, Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D55944
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350551
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikita Popov [Mon, 7 Jan 2019 18:15:11 +0000 (18:15 +0000)]
Revert "[DemandedBits] Use SetVector for Worklist"
This reverts commit r350547.
Seeing assertion failures on clang tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350549
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 7 Jan 2019 18:07:56 +0000 (18:07 +0000)]
[X86] Add OR(AND(X,C),AND(Y,~C)) bit select tests
Based off work for D55935
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350548
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikita Popov [Mon, 7 Jan 2019 18:03:36 +0000 (18:03 +0000)]
[DemandedBits] Use SetVector for Worklist
DemandedBits currently uses a simple vector for the worklist, which
means that instructions may be inserted multiple times into it.
Especially in combination with the deep lattice, this may cause
instructions too be recomputed very often. To avoid this, switch
to a SetVector.
Differential Revision: https://reviews.llvm.org/D56362
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350547
91177308-0d34-0410-b5e6-
96231b3b80d8
Armando Montanez [Mon, 7 Jan 2019 17:33:10 +0000 (17:33 +0000)]
[elfabi] Add option to manually specify file read format
Although llvm-elfabi will attempt to read input files without needing the format to be manually specified, doing so has the potential to introduce extraneous errors that can hinder debugging (since multiple readers may fail in attempts to read the file). This change allows the input file format to be manually specified to force elfabi to use a single reader. This makes it easier to test and debug errors specific to a given reader.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350545
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rupprecht [Mon, 7 Jan 2019 16:59:12 +0000 (16:59 +0000)]
[llvm-objcopy] Handle -O <format> flag.
Summary:
The -O flag is currently being mostly ignored; it's only checked whether or not the output format is "binary". This adds support for a few formats (e.g. elf64-x86-64), so that when specified, the output can change between 32/64 bit and sizes/alignments are updated accordingly.
This fixes PR39135
Reviewers: jakehehrlich, jhenderson, alexshap, espindola
Reviewed By: jhenderson
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D53667
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350541
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Mon, 7 Jan 2019 16:24:37 +0000 (16:24 +0000)]
[lit] Respect PYTHONPATH
If a user has PYTHONPATH set in the environment, append new entries to
it rather than blindly setting PYTHONPATH to a fixed string. This
allows tests to, for example, find psutil if it is in
PYTHONPATH. Without this change, lit will detect psutil but then
various tests will fail because PYTHONPATH has been overwritten and
psutil cannot be found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350536
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Morehouse [Mon, 7 Jan 2019 16:14:00 +0000 (16:14 +0000)]
[llvm-demangle-fuzzer] Also fuzz microsoftDemangle().
Summary:
Use first byte of input to determine whether to call itaniumDemangle()
or microsoftDemangle().
Addresses https://bugs.llvm.org/show_bug.cgi?id=39582.
Reviewers: kcc, thakis
Reviewed By: kcc, thakis
Subscribers: mgorny, thakis, erik.pilkington, llvm-commits
Differential Revision: https://reviews.llvm.org/D54780
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350534
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 7 Jan 2019 16:10:14 +0000 (16:10 +0000)]
[x86] add more tests for LowerToHorizontalOp(); NFC
These tests show missed optimizations and a miscompile
similar to PR40243 - https://bugs.llvm.org/show_bug.cgi?id=40243
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350533
91177308-0d34-0410-b5e6-
96231b3b80d8
Rhys Perry [Mon, 7 Jan 2019 15:52:28 +0000 (15:52 +0000)]
AMDGPU: test for uniformity of branch instruction, not its condition
Summary:
If a divergent branch instruction is marked as divergent by propagation
rule 2 in DivergencePropagator::exploreSyncDependency() and its condition
is uniform, that branch would incorrectly be assumed to be uniform.
Reviewers: arsenm, tstellar
Reviewed By: arsenm
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D56331
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350532
91177308-0d34-0410-b5e6-
96231b3b80d8
James Henderson [Mon, 7 Jan 2019 14:12:51 +0000 (14:12 +0000)]
[llvm-nm] Add --portability as alias for --format=posix
GNU nm supports this alias, so supporting it in llvm-nm makes it easier
to transition between the two.
Fixes https://bugs.llvm.org/show_bug.cgi?id=40002
Reviewed by: mstorsjo, rupprecht
Differential Revision: https://reviews.llvm.org/D56312
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350522
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexandre Ganea [Mon, 7 Jan 2019 13:53:16 +0000 (13:53 +0000)]
[CodeView] More appropriate name and type for a Microsoft precompiled headers parameter. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350520
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 7 Jan 2019 13:31:55 +0000 (13:31 +0000)]
AMDGPU: Remove v16i8 from register classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350518
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 7 Jan 2019 13:21:36 +0000 (13:21 +0000)]
AMDGPU: Remove VS/SV mappings from select
These would violate the constant bus restriction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350517
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 7 Jan 2019 12:21:13 +0000 (12:21 +0000)]
Regenerate test.
Prep work towards enabling SimplifyDemandedBits vector support for TRUNCATE as discussed on D56118.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350514
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 7 Jan 2019 12:20:35 +0000 (12:20 +0000)]
Regenerate test.
Prep work towards enabling SimplifyDemandedBits vector support for TRUNCATE as discussed on D56118.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350513
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 7 Jan 2019 07:31:49 +0000 (07:31 +0000)]
[CallSite removal] Move the rest of IR implementation code away from
`CallSite`.
With this change, the remaining `CallSite` usages are just for
implementing the wrapper type itself.
This does update the C API but leaves the names of that API alone and
only updates their implementation.
Differential Revision: https://reviews.llvm.org/D56184
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350509
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 7 Jan 2019 07:15:51 +0000 (07:15 +0000)]
[CallSite removal] Port `IndirectCallSiteVisitor` to use `CallBase` and
update client code.
Also rename it to use the more generic term `call` instead of something
that could be confused with a praticular type.
Differential Revision: https://reviews.llvm.org/D56183
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350508
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 7 Jan 2019 07:02:34 +0000 (07:02 +0000)]
[CallSite removal] Move the verifier to use `CallBase` instead of the
`CallSite` wrapper.
Mostly mechanical, but I've tried to tidy up code where it made sense to
do so.
Differential Revision: https://reviews.llvm.org/D56143
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350507
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 7 Jan 2019 05:58:53 +0000 (05:58 +0000)]
[X86] Update VBMI2 vshld/vshrd tests to use an immediate that doesn't require a modulo.
Planning to replace these with funnel shift intrinsics which would mask out the extra bits. This will help minimize test diffs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350504
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 7 Jan 2019 05:42:51 +0000 (05:42 +0000)]
[CallSite removal] Migrate all Alias Analysis APIs to use the newly
minted `CallBase` class instead of the `CallSite` wrapper.
This moves the largest interwoven collection of APIs that traffic in
`CallSite`s. While a handful of these could have been migrated with
a minorly more shallow migration by converting from a `CallSite` to
a `CallBase`, it hardly seemed worth it. Most of the APIs needed to
migrate together because of the complex interplay of AA APIs and the
fact that converting from a `CallBase` to a `CallSite` isn't free in its
current implementation.
Out of tree users of these APIs can fairly reliably migrate with some
combination of `.getInstruction()` on the `CallSite` instance and
casting the resulting pointer. The most generic form will look like `CS`
-> `cast_or_null<CallBase>(CS.getInstruction())` but in most cases there
is a more elegant migration. Hopefully, this migrates enough APIs for
users to fully move from `CallSite` to the base class. All of the
in-tree users were easily migrated in that fashion.
Thanks for the review from Saleem!
Differential Revision: https://reviews.llvm.org/D55641
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350503
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 7 Jan 2019 05:15:49 +0000 (05:15 +0000)]
[CallSite removal] Add `CallBase` support to the `InstVisitor` in such
a way that it still supports `CallSite` but users can be ported to rely
on `CallBase` instead.
This will unblock the ports across the analysis and transforms libraries
(and out-of-tree users) and once done we can clean this up by removing
the `CallSite` layer.
Differential Revision: https://reviews.llvm.org/D56182
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350502
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Mon, 7 Jan 2019 01:26:12 +0000 (01:26 +0000)]
[gn build] Add build files for llvm/lib/Target/ARM + tests
The ARM target itself is similar to the X86 target in https://reviews.llvm.org/rL348903
The llvm-exegesis unittests ARM bits are similar to the X86 bits in https://reviews.llvm.org/rL350413
Both are similar to the corresponding AArch64 bits in https://reviews.llvm.org/rL350499 too
After this, everything in my local GN branch is upstreamed to LLVM.
Differential Revision: https://reviews.llvm.org/D56371
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350500
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Mon, 7 Jan 2019 01:23:11 +0000 (01:23 +0000)]
[gn build] Add build files for llvm/lib/Target/AArch64 + tests
The AArch64 target itself is similar to the X86 target in https://reviews.llvm.org/rL348903
The llvm-exegesis AArch64 bits are similar to the X86 bits in http://reviews.llvm.org/rL350184
The llvm-exegesis unittests AArch64 bits are similar to the X86 bits in https://reviews.llvm.org/rL350413
llvm/unittests/Target/AArch64 doesn't have an equivalent since the X86 Target
only has lit tests, no unittests.
Differential Revision: https://reviews.llvm.org/D56364
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350499
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 6 Jan 2019 18:10:18 +0000 (18:10 +0000)]
[X86] Add support for matching vector funnel shift to AVX512VBMI2 instructions.
Summary: AVX512VBMI2 supports a funnel shift by immediate and a funnel shift by a variable vector.
Reviewers: spatel, RKSimon
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D56361
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350498
91177308-0d34-0410-b5e6-
96231b3b80d8
Lama Saba [Sun, 6 Jan 2019 16:39:14 +0000 (16:39 +0000)]
Revert "Resubmit rL345008 "Split MachinePipeliner code into header and cpp files""
This reverts commit rL350493
issues related to modules still appear in http://green.lab.llvm.org/green/job/lldb-cmake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350497
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 6 Jan 2019 16:21:42 +0000 (16:21 +0000)]
[x86] explicitly set cost of integer add/sub
There are no test changes here in the existing cost model
regression tests because integer add/sub have a default
legal cost of 1 already. This would break, however, if
we custom lower those ops because the default cost model
assumes that custom-lowered ops are more expensive.
This is similar to the change in rL350403. See discussion
in D56011 for more details. When we enhance that patch to
handle integer ops, we need this cost model change to avoid
unintended diffs here from the custom lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350496
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Sun, 6 Jan 2019 15:49:10 +0000 (15:49 +0000)]
[gn build] Merge r350341
Adds a build file for llvm-elfabi and makes check-llvm depend on it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350494
91177308-0d34-0410-b5e6-
96231b3b80d8
Lama Saba [Sun, 6 Jan 2019 15:45:40 +0000 (15:45 +0000)]
Resubmit rL345008 "Split MachinePipeliner code into header and cpp files"
Resubmitted in rL345290 and reverted in rL350345 due to failures in
http://green.lab.llvm.org/green/job/lldb-cmake/
Resubmitting after a workaround to lldb-cmake failure was
committed in rL350346, more info in https://reviews.llvm.org/D56084
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350493
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Sun, 6 Jan 2019 15:09:22 +0000 (15:09 +0000)]
[gn build] Add build files for LLVM unittests with a custom main() function
Differential Revision: https://reviews.llvm.org/D56219
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350492
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 6 Jan 2019 07:06:35 +0000 (07:06 +0000)]
[LegalizeVectorOps] Add FSHL/FSHR to the list of vector operations that should be handled.
The FSHL/FSHR nodes are handled in the expand function, but they need to also be listed in the code that queries for the operation action too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350490
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 5 Jan 2019 23:30:28 +0000 (23:30 +0000)]
[X86][AsmParser] Don't allow X86::DX in CheckBaseRegAndIndexRegAndScale.
This was here because out and in instructions allow '(%dx)' even though its not a memory reference. To handle this we build a special operand for the DX register reference before we get to the call to CheckBaseRegAndIndexRegAndScale. So we no longer need this special case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350483
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 5 Jan 2019 22:42:58 +0000 (22:42 +0000)]
[X86] Use two pmovmskbs in combineBitcastvxi1 for (i64 (bitcast (v64i1 (truncate (v64i8)))) on KNL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350481
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 5 Jan 2019 21:40:07 +0000 (21:40 +0000)]
[X86] Allow combinevxi1Bitcast to use pmovmskb on avx512 targets if the input is a truncate from v16i8/v32i8.
This is especially helpful on targets without avx512bw since we don't have a good way to convert from v16i8/v32i8 to v16i1/v32i1 for the truncate anyway. If we're just going to convert it to a GPR we might as well use pmovmskb to accomplish both.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350480
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Sat, 5 Jan 2019 19:20:00 +0000 (19:20 +0000)]
Added single use check to ShrinkDemandedConstant
Fixes cvt_f32_ubyte combine. performCvtF32UByteNCombine() could shrink
source node to demanded bits only even if there are other uses.
Differential Revision: https://reviews.llvm.org/D56289
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350475
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 5 Jan 2019 19:19:37 +0000 (19:19 +0000)]
[X86] Regenerate test to merge 32-bit and 64-bit check lines. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350474
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 5 Jan 2019 18:48:11 +0000 (18:48 +0000)]
[X86] Allow LowerTRUNCATE to use PACKUS/PACKSS for v16i16->v16i8 truncate when -mprefer-vector-width-256 is in effect and BWI is not available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350473
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikita Popov [Sat, 5 Jan 2019 17:36:05 +0000 (17:36 +0000)]
[InstCombine] Improve cttz/ctlz + icmp tests; NFC
Change part of the tests to use vectors (I'm using scalar for ugt
and vector for ult), add multiuse variations, rename %lz to %tz
for the cttz tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350471
91177308-0d34-0410-b5e6-
96231b3b80d8
Mike Spertus [Sat, 5 Jan 2019 16:59:27 +0000 (16:59 +0000)]
Enhance MSVC visualization of PointerUnions
Add a "deref" view that displays the pointed to objects since
other visualizers often need to display data reference by internal
PointerUnions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350469
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikita Popov [Sat, 5 Jan 2019 15:51:59 +0000 (15:51 +0000)]
[InstCombine] Add cttz/ctlz + icmp ugt/ult tests; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350468
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikita Popov [Sat, 5 Jan 2019 09:48:16 +0000 (09:48 +0000)]
[InstCombine] Relax cttz/ctlz with select on zero
The cttz/ctlz intrinsics have a parameter specifying whether the
result is undefined for zero. cttz(x, false) can be relaxed to
cttz(x, true) if x is known non-zero, and in fact such an optimization
is already performed. However, this currently doesn't work if x is
non-zero as a result of a select rather than an explicit branch.
This patch adds handling for this case, thus allowing
x != 0 ? cttz(x, false) : y to simplify to x != 0 ? cttz(x, true) : y.
Differential Revision: https://reviews.llvm.org/D55786
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350463
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikita Popov [Sat, 5 Jan 2019 09:48:05 +0000 (09:48 +0000)]
[InstCombine] Add vector tests for select + ctlz/cttz; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350462
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Sat, 5 Jan 2019 05:01:20 +0000 (05:01 +0000)]
[gn build] Merge r350423
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350458
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Sat, 5 Jan 2019 04:05:25 +0000 (04:05 +0000)]
[gn build] Add build files for unittests under llvm/unittests/ExecutionEngine
Differential Revision: https://reviews.llvm.org/D56328
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350457
91177308-0d34-0410-b5e6-
96231b3b80d8
Easwaran Raman [Sat, 5 Jan 2019 02:26:29 +0000 (02:26 +0000)]
[Inliner] Optimize shouldBeDeferred
This has some minor optimizations to shouldBeDeferred. This is not
strictly NFC because the early exit inside the loop assumes
TotalSecondaryCost is monotonically non-decreasing, which is not true if
the threshold used by CostAnalyzer is negative. AFAICT the thresholds do
not go below 0 for the default values of the various options we use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350456
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 5 Jan 2019 01:40:29 +0000 (01:40 +0000)]
[X86] Require second operand of X86vshiftuniform to be an integer. NFC
We don't need to require the first operand to be an integer because we already said it was the same type as the result which we also constrained to an integer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350455
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Sat, 5 Jan 2019 01:39:18 +0000 (01:39 +0000)]
[gn build] Add build files for unittests that load shared libraries
This is slightly ugly for three reasons:
- The shlib needs to go next to the binary to be found on all platforms, so the
build files refer to target_out_dir
- The explicit -fPIC flag needed on the shared lib side, and the -rdynamic flag
needed on the host side, on Linux
- Plugins that refer to LLVM code and assume that the host will resolve them
don't work on Windows -- PluginsTests won't test anything on Windows (but
DynamicLibraryTests will, since the dll here doesn't call LLVM code)
If we get lots more of these plugin / plugin host targets it might make sense
to add a template for them. But for now, these are the last ones we need.
(We're at 6 plugin hosts, 2 of them tests, and at 6 shared libraries, 2 of them
tests as well. clang is a plugin host by default in the CMake build but not
(yet?) in the GN build.)
Differential Revision: https://reviews.llvm.org/D56330
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350454
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Sat, 5 Jan 2019 00:44:58 +0000 (00:44 +0000)]
Revert "Revert "[hwasan] Android: Switch from TLS_SLOT_TSAN(8) to TLS_SLOT_SANITIZER(6)""
This reapplies commit r348983.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350448
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Sat, 5 Jan 2019 00:14:37 +0000 (00:14 +0000)]
[gn build] Add build file for DebugInfoPDBTests
I'm pretty unhappy this patch: DebugInfoPDBTests uses an API that requires some
magic txt file to be next to the unit test executable that stores the absolute
path to the LLVM source root.
The choices here are:
1. Don't use the unittest() template for DebugInfoPDBTests and set output_dir
for unit tests in two places (the gni file for every test but this one, and the
BUILD.gn file for this specific test).
2. Add another unittest_foo() template variation for this one test.
I went with the former, and added a comment to the template to look out for
this.
(The CMake build has the same issue.)
Differential Revision: https://reviews.llvm.org/D56324
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350447
91177308-0d34-0410-b5e6-
96231b3b80d8
Rong Xu [Fri, 4 Jan 2019 22:54:03 +0000 (22:54 +0000)]
[PGO] Use SourceFileName rather module name in PGOFuncName
In LTO or Thin-lto mode (though linker plugin), the module
names are of temp file names which are different for
different compilations. Using SourceFileName avoids the issue.
This should not change any functionality for current PGO as
all the current callers of getPGOFuncName() is before LTO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350442
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikita Popov [Fri, 4 Jan 2019 21:41:35 +0000 (21:41 +0000)]
[X86] Fix warning; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350437
91177308-0d34-0410-b5e6-
96231b3b80d8
Vyacheslav Zakharin [Fri, 4 Jan 2019 21:25:01 +0000 (21:25 +0000)]
Update the pr_datasz of .note.gnu.property section.
Patch by Xiang Zhang.
Differential Revision: https://reviews.llvm.org/D56080
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350436
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikita Popov [Fri, 4 Jan 2019 21:21:43 +0000 (21:21 +0000)]
[BDCE] Remove dead uses of arguments
In addition to finding dead uses of instructions, also find dead uses
of function arguments, and replace them with zero as well.
I'm changing the way the known bits are computed here to remove the
coupling between the transfer function and the algorithm. It previously
relied on the first op being visited first and computing known bits --
unless the first op is not an instruction, in which case they're computed
on the second op. I could have adjusted this to check for "instruction
or argument", but I think it's better to avoid the repeated calculation
with an explicit flag.
Differential Revision: https://reviews.llvm.org/D56247
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350435
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Fri, 4 Jan 2019 21:02:25 +0000 (21:02 +0000)]
[AArch64] Adjust the cost model for Exynos M3
Improve the modeling of ASIMD loads and stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350434
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 4 Jan 2019 20:50:59 +0000 (20:50 +0000)]
[X86] Add INSERT_SUBVECTOR to ComputeNumSignBits
This adds support for calculating sign bits of insert_subvector. I based it on the computeKnownBits.
My motivating case is propagating sign bits information across basic blocks on AVX targets where concatenating using insert_subvector is common.
Differential Revision: https://reviews.llvm.org/D56283
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350432
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 4 Jan 2019 20:14:53 +0000 (20:14 +0000)]
[x86] add tests for potential horizontal vector ops; NFC
These are modified versions of the FP tests from rL349923.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350430
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 4 Jan 2019 19:27:04 +0000 (19:27 +0000)]
hwasan: Implement lazy thread initialization for the interceptor ABI.
The problem is similar to D55986 but for threads: a process with the
interceptor hwasan library loaded might have some threads started by
instrumented libraries and some by uninstrumented libraries, and we
need to be able to run instrumented code on the latter.
The solution is to perform per-thread initialization lazily. If a
function needs to access shadow memory or add itself to the per-thread
ring buffer its prologue checks to see whether the value in the
sanitizer TLS slot is null, and if so it calls __hwasan_thread_enter
and reloads from the TLS slot. The runtime does the same thing if it
needs to access this data structure.
This change means that the code generator needs to know whether we
are targeting the interceptor runtime, since we don't want to pay
the cost of lazy initialization when targeting a platform with native
hwasan support. A flag -fsanitize-hwaddress-abi={interceptor,platform}
has been introduced for selecting the runtime ABI to target. The
default ABI is set to interceptor since it's assumed that it will
be more common that users will be compiling application code than
platform code.
Because we can no longer assume that the TLS slot is initialized,
the pthread_create interceptor is no longer necessary, so it has
been removed.
Ideally, lazy initialization should only cost one instruction in the
hot path, but at present the call may cause us to spill arguments
to the stack, which means more instructions in the hot path (or
theoretically in the cold path if the spills are moved with shrink
wrapping). With an appropriately chosen calling convention for
the per-thread initialization function (TODO) the hot path should
always need just one instruction and the cold path should need two
instructions with no spilling required.
Differential Revision: https://reviews.llvm.org/D56038
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350429
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Fri, 4 Jan 2019 19:04:54 +0000 (19:04 +0000)]
[ThinLTO] Handle chains of aliases
At -O0, globalopt is not run during the compile step, and we can have a
chain of an alias having an immediate aliasee of another alias. The
summaries are constructed assuming aliases in a canonical form
(flattened chains), and as a result only the base object but no
intermediate aliases were preserved.
Fix by adding a pass that canonicalize aliases, which ensures each
alias is a direct alias of the base object.
Reviewers: pcc, davidxl
Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, arphaman, llvm-commits
Differential Revision: https://reviews.llvm.org/D54507
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350423
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 4 Jan 2019 17:48:13 +0000 (17:48 +0000)]
[x86] lower extracted fadd/fsub to horizontal vector math; 2nd try
The 1st try for this was at rL350369, but it caused IR-level diffs because
our cost models differentiate custom vs. legal/promote lowering. So that was
reverted at rL350373. The cost models were fixed independently at rL350403,
so this is effectively the same patch as last time.
Original commit message:
This would show up if we fix horizontal reductions to narrow as they go along,
but it's an improvement for size and/or Jaguar (fast-hops) independent of that.
We need to do this late to not interfere with other pattern matching of larger
horizontal sequences.
We can extend this to integer ops in a follow-up patch.
Differential Revision: https://reviews.llvm.org/D56011
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350421
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Fri, 4 Jan 2019 17:43:22 +0000 (17:43 +0000)]
[CodeExtractor] Do not extract unsafe lifetime markers
Lifetime markers which reference inputs to the extraction region are not
safe to extract. Example ('rhs' will be extracted):
```
entry:
+------------+
| x = alloca |
| y = alloca |
+------------+
/ \
lhs: rhs:
+-------------------+ +-------------------+
| lifetime_start(x) | | lifetime_start(x) |
| use(x) | | lifetime_start(y) |
| lifetime_end(x) | | use(x, y) |
| lifetime_start(y) | | lifetime_end(y) |
| use(y) | | lifetime_end(x) |
| lifetime_end(y) | +-------------------+
+-------------------+
```
Prior to extraction, the stack coloring pass sees that the slots for 'x'
and 'y' are in-use at the same time. After extraction, the coloring pass
infers that 'x' and 'y' are *not* in-use concurrently, because markers
from 'rhs' are no longer available to help decide otherwise.
This leads to a miscompile, because the stack slots actually are in-use
concurrently in the extracted function.
Fix this by moving lifetime start/end markers for memory regions defined
in the calling function around the call to the extracted function.
Fixes llvm.org/PR39671 (rdar://
45939472).
Differential Revision: https://reviews.llvm.org/D55967
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350420
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 4 Jan 2019 17:38:12 +0000 (17:38 +0000)]
[InstCombine] reduce raw IR narrowing rotate patterns to funnel shift
Similar to rL350199 - there are no known analysis/codegen holes for
funnel shift intrinsics now, so we can canonicalize the 6+ regular
instructions to funnel shift to improve vectorization, inlining,
unrolling, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350419
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 4 Jan 2019 17:32:28 +0000 (17:32 +0000)]
[gn build] Merge r350351
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350418
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 4 Jan 2019 17:26:05 +0000 (17:26 +0000)]
[gn build] Commit change that should have been in r350410.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350416
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 4 Jan 2019 17:16:21 +0000 (17:16 +0000)]
[gn build] Add even more build files for LLVM unittests
Another random assortment of easy build files.
Differential Revision: https://reviews.llvm.org/D56217
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350413
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 4 Jan 2019 17:15:38 +0000 (17:15 +0000)]
[gn build] Add more build files for LLVM unittests
A fairly random assortment of build files that are easy.
Differential Revision: https://reviews.llvm.org/D56213
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350412
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 4 Jan 2019 17:14:55 +0000 (17:14 +0000)]
[gn build] Start adding build files for LLVM unittests
Adds build files for //llvm/unittest/[A-D].
Also teach sync_source_lists_from_cmake.py to not complain about missing
BUILD.gn files for CMakeLists.txt files that just call add_subdirectory()
without calling add_.+_unittest, like e.g.
llvm/unittests/Target/CMakeLists.txt.
(Omits CodeGen/GlobalISel and DebugInfo/PDB because their build files are somewhat interesting, and this patch is already on the larger side.)
Differential Revision: https://reviews.llvm.org/D56212
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350411
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 4 Jan 2019 17:13:33 +0000 (17:13 +0000)]
[gn build] Add check-llvm target and make it work
With this, check-llvm runs and passes all of clang's lit tests. It doesn't run
any of its unit tests yet.
This is the only change in the GN build patch series that needs a change to a
file outside of llvm/utils/gn: llvm/test/tools/llvm-config/booleans.test checks
the result of llvm-config --build-system for some reason, so I'm updating the
test to accept "gn" as valid output in addition to "cmake". (The alternative
would be to let the gn build self-identify as cmake, which seems worse.)
Like with check-clang and check-lld, running just ninja -C out/gn will build
all prerequisites needed to run tests, but it won't run the tests (so that the
build becomes clean after one build). Running ninja -C out/gn check-llvm will
build prerequisites if needed and run the tests. The check-llvm target never
becomes clean and runs tests every time.
Differential Revision: https://reviews.llvm.org/D56195
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350410
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 4 Jan 2019 17:12:25 +0000 (17:12 +0000)]
[gn build] Add build file for libLTO.dylib
Not used by anything yet, but will be needed to make check-llvm run ld64's libLTO plugin tests.
Differential Revision: https://reviews.llvm.org/D56317
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350409
91177308-0d34-0410-b5e6-
96231b3b80d8
John Brawn [Fri, 4 Jan 2019 17:12:09 +0000 (17:12 +0000)]
[LICM] Adjust how moving the re-hoist point works
In some cases the order that we hoist instructions in means that when rehoisting
(which uses the same order as hoisting) we can rehoist to a block A, then a
block B, then block A again. This currently causes an assertion failure as it
expects that when changing the hoist point it only ever moves to a block that
dominates the hoist point being moved from.
Fix this by moving the re-hoist point when it doesn't dominate the dominator of
hoisted instruction, or in other words when it wouldn't dominate the uses of
the instruction being rehoisted.
Differential Revision: https://reviews.llvm.org/D55266
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350408
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 4 Jan 2019 17:11:46 +0000 (17:11 +0000)]
[gn build] Add build files for llvm/lib/{LineEditor,Testing/Support,TextAPI}
Nothing pulls them in yet, but they will be needed for check-llvm.
LineEditor depends on libedit, so create a gn/build/lib for it, following the
usual pattern.
Differential Revision: https://reviews.llvm.org/D56316
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350407
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Fri, 4 Jan 2019 17:11:15 +0000 (17:11 +0000)]
Undo r350355 "[X86] Remove terrible DX Register parsing hack in parse operand. NFCI."
Add missing test case and update comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350406
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 4 Jan 2019 16:55:57 +0000 (16:55 +0000)]
[CostModel][X86] Fix SSE1 FADD/FSUB costs
Noticed in D56011 - handle the case that scalar fp ops are quicker on P3 than P4
Add the other costs so that we're not relying on the default "is legal/custom" cost logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350403
91177308-0d34-0410-b5e6-
96231b3b80d8