47540 Commits

Author SHA1 Message Date
Yonghong Song
2865ab6996 bpf: add inline-asm support
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313593 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 23:29:36 +00:00
Yi Kong
74ae606cb2 [ThinLTO/gold] Implement ThinLTO cache pruning support
Differential Revision: https://reviews.llvm.org/D37993

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313592 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 23:24:55 +00:00
Hans Wennborg
96d3026420 Revert r313400 "[DebugInfo] Insert DW_OP_deref when spilling indirect DBG_VALUEs"
This caused asserts in Chromium. See http://crbug.com/766261

> Summary:
> This comes up in optimized debug info for C++ programs that pass and
> return objects indirectly by address. In these programs,
> llvm.dbg.declare survives optimization, which causes us to emit indirect
> DBG_VALUE instructions. The fast register allocator knows to insert
> DW_OP_deref when spilling indirect DBG_VALUE instructions, but the
> LiveDebugVariables did not until this change.
>
> This fixes part of PR34513. I need to look into why this doesn't work at
> -O0 and I'll send follow up patches to handle that.
>
> Reviewers: aprantl, dblaikie, probinson
>
> Subscribers: qcolombet, hiraditya, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D37911

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313589 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 23:08:42 +00:00
Zachary Turner
af03e798b8 [lit] Update clang and lld to use new config helpers.
NFC intended here, this only updates clang and lld's lit configs
to use some helper functionality in the lit.llvm submodule.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313579 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 22:26:48 +00:00
Sanjay Patel
a3209ae52e [DAGCombiner] fold assertzexts separated by trunc
If we have an AssertZext of a truncated value that has already been AssertZext'ed, 
we can assert on the wider source op to improve the zext-y knowledge:
 assert (trunc (assert X, i8) to iN), i1 --> trunc (assert X, i1) to iN

This moves a fold from being Mips-specific to general combining, and x86 shows
improvements.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313577 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 22:05:35 +00:00
Sanjay Patel
83af88427f [InstCombine] auto-generate complete checks; NFC
The code responsible for these transforms has the potential to add 2 
instructions and break min/max patterns (PR33301).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 21:57:56 +00:00
Adrian Prantl
8233b30822 llvm-dwarfdump: add a --show-parents options when selectively dumping DIEs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313567 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 21:27:44 +00:00
Adrian Prantl
b528477a93 Fix typo in testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313566 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 21:27:42 +00:00
Konstantin Zhuravlyov
fe0a82a17c AMDGPU: Start selecting s_xnor_{b32, b64}
Differential Revision: https://reviews.llvm.org/D37981


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313565 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 21:22:45 +00:00
Sanjay Patel
e3402afeee [DAG, x86] allow store merging before and after legalization (PR34217)
rL310710 allowed store merging to occur after legalization to catch stores that are created late,
but this exposes a logic hole seen in PR34217:
https://bugs.llvm.org/show_bug.cgi?id=34217

We will miss merging stores if the target lowers vector extracts into target-specific operations.
This patch allows store merging to occur both before and after legalization if the target chooses
to get maximum merging.

I don't think the potential regressions in the other tests are relevant. The tests are for
correctness of weird IR constructs rather than perf tests, and I think those are still correct.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313564 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 20:54:26 +00:00
Craig Topper
1ae3ba04b8 [X86] Make sure we still emit zext for GR32 to GR64 when the source of the zext is AssertZext
The AssertZext we might see in this case is only giving information about the lower 32 bits. It isn't providing information about the upper 32 bits. So we should emit a zext.

This fixes PR28540.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313563 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 20:49:13 +00:00
Alexey Bataev
4e16710f42 [SLP] Add a test for PR34635, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313559 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 19:33:30 +00:00
Sanjay Patel
d800c2eba5 [x86] add tests for PR34217; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313548 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 18:07:50 +00:00
Simon Pilgrim
d7c4504964 [X86][AVX] Improve (i8 bitcast (v8i1 x)) handling for 256-bit vector compare results.
As commented on D37849, AVX1 targets were missing a chance to use vmovmskps for v8f32/v8i32 results for bool vector bitcasts


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313547 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 17:58:31 +00:00
Sanjay Patel
fe612a2f7f [x86] regenerate checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313545 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 17:33:47 +00:00
Manoj Gupta
31cc06a8d8 [LoopVectorizer] Add more testcases for PR33804.
Summary:
Add test cases when float <-> pointer types conversion is triggered
in presence of load instructions.

Reviewers: Ayal, srhines, mkuper, rengolin

Reviewed By: rengolin

Subscribers: javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313544 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 17:28:15 +00:00
Simon Pilgrim
3632da7880 [SelectionDAG] Add BITCAST handling to ComputeNumSignBits for splatted sign bits.
For cases where we are BITCASTing to vectors of smaller elements, then if the entire source was a splatted sign (src's NumSignBits == SrcBitWidth) we can say that the dst's NumSignBit == DstBitWidth, as we're just splitting those sign bits across multiple elements.

We could generalize this but at the moment the only use case I have is to peek through bitcasts to vector comparison results.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313543 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 16:45:05 +00:00
Craig Topper
09f2a0775a [X86] Fix two more places to prefer VPERMQ/PD over VPERM2X128 when AVX2 is enabled
The shuffle combining and lowerVectorShuffleAsLanePermuteAndBlend were both still trying to use VPERM2XF128 for unary shuffles when AVX2 is enabled. VPERM2X128 takes two inputs meaning when we use it for a unary shuffle one of those inputs is left undefined creating a false dependency on whatever register gets allocated there.

If we have VPERMQ/PD we should prefer those since they only have a single input.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313542 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 16:39:49 +00:00
Sam Parker
df2a024df2 [AArch64] Add V8_2aOps feature to Cortex-A55 and 75
Add the missing hardware features the ProcA55 and ProcA75 feature.
These are already enabled via the target parser, but I had missed
them in the backend.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313535 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 14:46:14 +00:00
Sam Parker
7863128a7d [ARM] Implement isTruncateFree
Implement the isTruncateFree hooks, lifted from AArch64, that are
used by TargetTransformInfo. This allows simplifycfg to reduce the
test case into a single basic block.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313533 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 14:28:51 +00:00
Simon Pilgrim
00fb00243b [X86][SSE] Improve support for vselect(Cond, 0, X) -> ANDN(Cond, X)
As discussed on PR28925 and D37849.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313532 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 14:23:23 +00:00
Sjoerd Meijer
80ee0e02a2 [ARM] Fix for indexed dot product instruction descriptions
The indexed dot product instructions only accept the lower 16 D-registers as
the indexed register, but we were e.g. incorrectly accepting:

vudot.u8 d16,d16,d18[0]

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313531 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 14:17:57 +00:00
Jonas Devlieghere
6ad4356f4d [dwarfdump] Make .eh_frame an alias for .debug_frame
This patch makes the `.eh_frame` extension an alias for `.debug_frame`.
Up till now it was only possible to dump the section using objdump, but
not with dwarfdump. Since the two are essentially interchangeable, we
dump whichever of the two is present.

As a workaround, this patch also adds parsing for 3 currently
unimplemented CFA instructions: `DW_CFA_def_cfa_expression`,
`DW_CFA_expression`, and `DW_CFA_val_expression`. Because I lack the
required knowledge, I just parse the fields without actually creating
the instructions.

Finally, this also fixes the typo in the `.debug_frame` section name
which incorrectly contained a trailing `s`.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313530 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 14:15:57 +00:00
Simon Pilgrim
70c6728fba [X86][SSE] Add vselect with zero tests (PR28925)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313529 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 13:32:33 +00:00
Nikolai Bozhenov
289d643bfb [X86FixupBWInsts] More precise register liveness if no <imp-use> on MOVs.
Summary:
Subregister liveness tracking is not implemented for X86 backend, so
sometimes the whole super register is said to be live, when only a
subregister is really live. That might happen if the def and the use
are located in different MBBs, see added fixup-bw-isnt.mir test.

However, using knowledge of the specific instructions handled by the
bw-fixup-pass we can get more precise liveness information which this
change does.

Reviewers: MatzeB, DavidKreitzer, ab, andrew.w.kaylor, craig.topper

Reviewed By: craig.topper

Subscribers: n.bozhenov, myatsina, llvm-commits, hiraditya

Patch by Andrei Elovikov <andrei.elovikov@intel.com>

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313524 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 10:17:59 +00:00
Mohammed Agabaria
bcb17980a9 [X86][Codegen] adding masked gathers tests for avx2
related to patch: https://reviews.llvm.org/D35772
adding llvm gathers test before gathers codegen support.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313516 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 06:49:54 +00:00
Dean Michael Berris
d6aeff8fd7 [XRay][tools] Support tail-call exits before we write them in the runtime
Summary:
This change adds support for explicit tail-exit records to be written by
the XRay runtime. This lets us differentiate the tail exit
records/events in the log, and allows us to treat those exit events
especially in the future. For now we allow printing those out in YAML
(and reading them in).

Reviewers: kpw, pelikan

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313514 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 06:08:46 +00:00
Craig Topper
d28a1eae08 [X86] Teach the execution domain fixing tables to use movlhps inplace of unpcklpd for the packed single domain.
MOVLHPS has a smaller encoding than UNPCKLPD in the legacy encodings. With VEX and EVEX encodings it doesn't matter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313509 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 04:40:58 +00:00
Craig Topper
2dc0224dbf [X86] Teach execution domain fixing to convert between FP and int unpack instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313508 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 03:29:54 +00:00
Craig Topper
bcd1d60259 [X86] Teach execution domain fixing to convert between VPERMILPS and VPSHUFD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313507 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 03:29:47 +00:00
Craig Topper
1f42623bce [X86] Teach shuffle lowering to use MOVLHPS/MOVHLPS for lowering v4f32 unary shuffles with SSE1 only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313504 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 22:36:41 +00:00
Craig Topper
0f51ef8516 [X86] Add a couple more unary shuffles to the sse1 shuffle test.
These can be implemented with movlhps and movhlps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313503 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 22:36:39 +00:00
Jatin Bhateja
2aa82e0930 Adding test cases for PR34629 & PR34634.
Differential Revision: https://reviews.llvm.org/D37962

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313490 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 18:16:26 +00:00
Alex Bradbury
a1c2bb91ad [RISCV] Add support for disassembly
This Disassembly support allows for 'round-trip' testing, and rv32i-valid.s
has been updated appropriately.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313486 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 14:36:28 +00:00
Alex Bradbury
26132ea8ed [RISCV] Add support for all RV32I instructions
This patch supports all RV32I instructions as described in the RISC-V manual.
A future patch will add support for pseudoinstructions and other instruction
expansions (e.g. 0-arg fence -> fence iorw, iorw).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313485 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 14:27:35 +00:00
Igor Breger
1183423ec5 [GlobalISel][X86] Legalize i1 G_ADD/G_SUB/G_MUL/G_XOR/G_OR/G_AND instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313483 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 11:34:17 +00:00
Igor Breger
f4b98addfb [GlobalISel][X86] Use correct physical register in mir tests.NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313479 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 08:30:42 +00:00
Igor Breger
9e0b9aa749 [GlobalISel][X86] G_FCONSTANT support.
Summary: G_FCONSTANT support, port the implementation from X86FastIsel.

Reviewers: zvi, delena, guyblank

Reviewed By: delena

Subscribers: rovka, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313478 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 08:08:13 +00:00
Zachary Turner
be4be2e2c4 [llvm-symbolizer] Fix coff-dwarf.test
This was a bug in the test that was only exposed as a result of
refactoring some code in lit configuration files.  Previously,
llvm's lit configuration would only set the target-windows feature
if the system was also windows.  Since cross-compilation is
a thing, this isn't correct.  target-windows should be set
independently of system-windows.

Adding to that bug, this particular test then checked for
target-windows when it really meant "can I call a certain API on
the host machine", which is what system-windows is for.

Ultimately, this test only works if *both* the target and host
are Windows, so I've updated the test to reflect that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313468 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 19:01:04 +00:00
Zachary Turner
4af1a22e52 Resubmit "Add a shared llvm.lit module that all test suites can use."
There were some issues surrounding Py2 / Py3 compatibility, but
I've now tested with both Py2 and Py3 and everything seems to
work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313467 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 18:46:21 +00:00
Adrian Prantl
d4e3753582 llvm-dwarfdump: support a --show-children option
This will print all children of a DIE when selectively printing only
one DIE at a given offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313464 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 17:28:00 +00:00
Adrian Prantl
f6324abed0 llvm-dwarfdump: Add support for -debug-types=<offset>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313463 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 16:58:18 +00:00
George Rimar
295be907d4 [llvm-readobj] - Teach tool to report error if some section is in multiple COMDAT groups at once.
readelf tool reports an error when output contains the same section
in multiple COMDAT groups. That can be useful.
Path teaches llvm-readobj to do the same.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313459 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 14:29:51 +00:00
Sanjay Patel
153209826e [x86] enable storeOfVectorConstantIsCheap() target hook
This allows vector-sized store merging of constants in DAGCombiner using the existing code in MergeConsecutiveStores(). 
All of the twisted logic that decides exactly what vector operations are legal and fast for each particular CPU are 
handled separately in there using the appropriate hooks.

For the motivating tests in merge-store-constants.ll, we already produce the same vector code in IR via the SLP vectorizer. 
So this is just providing a backend backstop for code that doesn't go through that pass (-O1). More details in PR24449:
https://bugs.llvm.org/show_bug.cgi?id=24449 (this change should be the last step to resolve that bug)

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313458 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 13:29:12 +00:00
Craig Topper
343595467c [X86] Add isel patterns to be able to fold loads into VPERM2F128 even when the load is on the first input to the SDNode.
We just need to toggle bits 1 and 5 of the immediate and swap the sources. The peephole pass could trigger commuting/folding for this later, but its easy enough to fix in isel.

Disable the peephole pass on the main vperm2x128 test so we know we're doing this through isel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313455 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 09:16:48 +00:00
Craig Topper
2fa59dfd39 [X86] Remove unused check lines that got left behind when I moved tests to the instrinsic upgrade file and regenerated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313454 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 09:16:46 +00:00
Craig Topper
00530eccc1 [X86] Remove the vperm2f128 test file I just added in r313450.
I missed the we already had a pretty thorough test file for these instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313451 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 07:51:01 +00:00
Craig Topper
20d3306cef [X86] Remove VPERM2F128/VPERM2I128 intrinsics and autoupgrade to native shuffles.
I've moved the test cases from the InstCombine optimizations to the backend to keep the coverage we had there. It covered every possible immediate so I've preserved the resulting shuffle mask for each of those immediates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313450 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 07:36:14 +00:00
Craig Topper
a2d920301b [X86] Fix some FileCheck lines that use the wrong prefix.
Assume they were moved during autoupgrading and not changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313448 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 07:13:39 +00:00
Craig Topper
679ad58393 [X86] Don't set reserved bits in the immediate in the test cases for vperm2f128.
I'm going to autoupgrade these intrinsics in a future commit. This bit will never be set in the resulting output so pre-removing the bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 02:11:21 +00:00