1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

115127 Commits

Author SHA1 Message Date
James Molloy
c18c1320ff [ARM] Remove target-specific ITOFP/FPTOI nodes
Anton tried this 5 years ago but it was reverted due to extra VMOVs
being emitted. This can be easily fixed with a liberal application
of patterns - matching loads/stores and extractelts.

llvm-svn: 232958
2015-03-23 16:15:16 +00:00
Tom Stellard
1f3265f20e R600/SI: Fix crash in SIInstrInfo::areLoadsFromSameBasePtr()
This function assumed that SMRD instructions always have immediate
offsets, which is not always the case.

llvm-svn: 232957
2015-03-23 16:06:01 +00:00
Colin LeMahieu
eb4453d530 [Hexagon] Simplify boolean expression
Patch by Richard
http://reviews.llvm.org/D8523

llvm-svn: 232955
2015-03-23 16:01:03 +00:00
Bradley Smith
cb2fa3d357 [ARM] Add more pattern matching for f16 <-> f64 conversions
Specifically when the conversion is done in two steps, f16 -> f32 -> f64.

For example:

%1 = tail call float @llvm.convert.from.fp16.f32(i16 %0)
%conv = fpext float %1 to double

to:

vcvtb.f64.f16

llvm-svn: 232954
2015-03-23 15:59:54 +00:00
Benjamin Kramer
2c6b0b5d05 [gcov] Move formatBranchInfo into an anonymous namespace.
NFC.

llvm-svn: 232949
2015-03-23 13:59:13 +00:00
Benjamin Kramer
d52ec1c0ec Move private classes into anonymous namespaces
NFC.

llvm-svn: 232944
2015-03-23 12:30:58 +00:00
Petar Jovanovic
8e9b052c46 Fix sign extension for MIPS64 in makeLibCall function
Fixing sign extension in makeLibCall for MIPS64. In MIPS64 architecture all
32 bit arguments (int, unsigned int, float 32 (soft float)) must be sign
extended. This fixes test "MultiSource/Applications/oggenc/".

Patch by Strahinja Petrovic.

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

llvm-svn: 232943
2015-03-23 12:28:13 +00:00
Daniel Sanders
698ec39776 [aarch64] Distinguish the 'Q' and 'm' inline assembly memory constraints.
Summary:
But still handle them the same way since I don't know how they differ on
this target.

Clang also has code for 'Ump', 'Utf', 'Usa', and 'Ush' but calls
llvm_unreachable() on this code path so they are not converted to a
constraint id at the moment.

No functional change intended.

Reviewers: t.p.northover

Subscribers: aemerson, llvm-commits

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

llvm-svn: 232941
2015-03-23 11:33:15 +00:00
Hal Finkel
70188cc8ca [SDAG] Don't widen VSETCC during type legalization for split operands
Because the operands of a vector SETCC node can be of a different type from the
result (and often are), it can happen that even if we'd prefer to widen the
result type of the SETCC, the operands have been split instead. In this case,
the SETCC result also must be split. This mirrors what is done in
WidenVecRes_SELECT, and should be NFC elsewhere because if the operands are not
widened the following calls to GetWidenedVector will assert (which is what was
happening in the test case).

llvm-svn: 232935
2015-03-23 08:22:43 +00:00
Lang Hames
fd6cb4a689 [Orc] Add missing -use-orcmcjit flag to a number of Orc regression tests.
llvm-svn: 232931
2015-03-23 06:02:49 +00:00
Craig Topper
21ffa88465 Fix typo 'AVX too' instead of 'AVX2'
llvm-svn: 232929
2015-03-23 04:17:11 +00:00
Craig Topper
ad12604e08 [X86] Add one stepping of Broadwell to the CPU name autodetection for march=native.
llvm-svn: 232927
2015-03-23 00:15:06 +00:00
David Majnemer
94a285c113 Silence a GCC warning
llvm-svn: 232923
2015-03-22 21:27:10 +00:00
Benjamin Kramer
a4e25e8842 FoldingSet: Make FoldingSetImpl's dtor protected and non-virtual
It's not intended to be polymorphically deleted. Make FoldingSet
and ContextualFoldingSet final to avoid noise from -Wnon-virtual-dtor.

No functional change intended.

llvm-svn: 232922
2015-03-22 18:22:33 +00:00
Duncan P. N. Exon Smith
ceb3e74b88 Prevent CHECK-NOTs from matching file paths
A build directory with a name like `build-Werror` would hit a false
positive on these `CHECK-NOT`s before, since the actual error line looks
like:

    .../build-Werror/bin/llvm-as <stdin>:1:2: error: ...

Switch to using:

    CHECK-NOT: error:

(note the trailing semi-colon) to avoid matching almost any file path.

llvm-svn: 232917
2015-03-22 15:58:21 +00:00
Simon Pilgrim
2b54cb1a02 Fixed MSVC compile warning issue introduced in r232837
- was reporting 'warning C4715: 'getType32' : not all control paths return a value'

llvm-svn: 232913
2015-03-22 13:38:36 +00:00
Benjamin Kramer
b1b20b3003 [SimplifyLibCalls] Fix negative shifts being produced by the memchr -> bitfield transform.
llvm-svn: 232903
2015-03-21 22:04:26 +00:00
Benjamin Kramer
facc0a564b [SimplifyLibCalls] Turn memchr(const, C, const) into a bitfield check.
strchr("123!", C) != nullptr is a common pattern to check if C is one
of 1, 2, 3 or !. If the largest element of the string is smaller than
the target's register size we can easily create a bitfield and just
do a simple test for set membership.

int foo(char C) { return strchr("123!", C) != nullptr; } now becomes

	cmpl	$64, %edi ## range check
	sbbb	%al, %al
	movabsq	$0xE000200000001, %rcx
	btq	%rdi, %rcx ## bit test
	sbbb	%cl, %cl
	andb	%al, %cl ## and the two conditions
	andb	$1, %cl
	movzbl	%cl, %eax ## returning an int
	ret

(imho the backend should expand this into a series of branches, but
that's a different story)

The code is currently limited to bit fields that fit in a register, so
usually 64 or 32 bits. Sadly, this misses anything using alpha chars
or {}. This could be fixed by just emitting a i128 bit field, but that
can generate really ugly code so we have to find a better way. To some
degree this is also recreating switch lowering logic, but we can't
simply emit a switch instruction and thus change the CFG within
instcombine.

llvm-svn: 232902
2015-03-21 21:09:33 +00:00
Matt Arsenault
4a540d8fd4 R600: Cleanup test with multiple check prefixes
llvm-svn: 232901
2015-03-21 19:15:46 +00:00
Benjamin Kramer
b157a65962 StringRef: Just forward StringRef::find to libc's memchr.
Modern libc's have an SSE version of memchr which is a lot faster than our
hand-rolled version. In the past I was reluctant to use it because Darwin's
memchr used a naive ridiculously slow implementation, but that has been fixed
some versions ago.

Should have zero functional impact.

llvm-svn: 232898
2015-03-21 16:42:35 +00:00
Benjamin Kramer
27e43bb6d0 Revert accidental commit.
While this is a fun change, I didn't really test it :)

llvm-svn: 232897
2015-03-21 15:37:32 +00:00
Benjamin Kramer
6c7bd16fc0 SimplifyLibCalls: Add basic optimization of memchr calls.
This is just memchr(x, y, 0) -> nullptr and constant folding.

llvm-svn: 232896
2015-03-21 15:36:21 +00:00
Benjamin Kramer
804e94f0e7 ValueTracking: Forward getConstantStringInfo's TrimAtNul param into recursive invocation
Currently this is only used to tweak the backend's memcpy inlining
heuristics, testing that isn't very helpful. A real test case will
follow in the next commit, where this behavior would cause a real
miscompilation.

llvm-svn: 232895
2015-03-21 15:36:06 +00:00
Simon Pilgrim
c93710534f Tidied up vec_zero_cse.ll test. NFCI.
Added target triple and refactored the CHECKs to be per function.

llvm-svn: 232894
2015-03-21 14:05:12 +00:00
David Majnemer
a558926cc0 MemoryDependenceAnalysis: Don't miscompile atomics
r216771 introduced a change to MemoryDependenceAnalysis that allowed it
to reason about acquire/release operations.  However, this change does
not ensure that the acquire/release operations pair.  Unfortunately,
this leads to miscompiles as we won't see an acquire load as properly
memory effecting.  This largely reverts r216771.

This fixes PR22708.

llvm-svn: 232889
2015-03-21 06:19:17 +00:00
Tim Northover
489835620f AArch64: simplify test case
llvm-svn: 232886
2015-03-21 04:37:08 +00:00
Eric Christopher
c777d8d845 Remove the target independent TargetMachine::getSubtarget and
TargetMachine::getSubtargetImpl routines.

This keeps the target independent code free of bare subtarget
calls while the remainder of the backends are migrated, or not
if they don't wish to support per-function subtargets as would
be needed for function multiversioning or LTO of disparate
cpu subarchitecture types, e.g.

clang -msse4.2 -c foo.c -emit-llvm -o foo.bc
clang -c bar.c -emit-llvm -o bar.bc
llvm-link foo.bc bar.bc -o baz.bc
llc baz.bc

and get appropriate code for what the command lines requested.

llvm-svn: 232885
2015-03-21 04:22:23 +00:00
Eric Christopher
e8e68a5117 Remove the bare getSubtargetImpl call from the AArch64 port. As part
of this add a test that shows we can generate code for functions
that specifically enable a subtarget feature.

llvm-svn: 232884
2015-03-21 04:04:50 +00:00
Eric Christopher
496632fcd2 Remove the bare getSubtargetImpl call from the PPC port. As part
of this add a test that shows we can generate code with
for functions that differ by subtarget feature.

llvm-svn: 232882
2015-03-21 03:36:02 +00:00
Eric Christopher
ef90fb9647 Forward the Function based getSubtarget call to the appropriate Impl
call.

llvm-svn: 232881
2015-03-21 03:32:45 +00:00
Eric Christopher
61a041c2a0 Grab a subtarget off of an AMDGPUTargetMachine rather than a
bare target machine in preparation for the TargetMachine bare
getSubtarget/getSubtargetImpl calls going away.

llvm-svn: 232880
2015-03-21 03:17:25 +00:00
Eric Christopher
3d3373d3e2 Cache the Function dependent subtarget on the MachineFunction.
As preparation for removing the getSubtargetImpl() call from
TargetMachine go ahead and flip the switch on caching the function
dependent subtarget and remove the bare getSubtargetImpl call
from the X86 port. As part of this add a few tests that show we
can generate code and assemble on X86 based on features/cpu on
the Function.

llvm-svn: 232879
2015-03-21 03:13:10 +00:00
Eric Christopher
3e8e6fb933 Grab the cached subtarget off of the MachineFunction.
llvm-svn: 232878
2015-03-21 03:13:07 +00:00
Eric Christopher
c3a21ce588 Grab a subtarget off of a MipsTargetMachine rather than a
bare target machine in preparation for the TargetMachine bare
getSubtarget/getSubtargetImpl calls going away.

llvm-svn: 232877
2015-03-21 03:13:05 +00:00
Eric Christopher
310e3fc262 Simplify the query for a subtarget in the NVPTX pass manager.
llvm-svn: 232876
2015-03-21 03:13:03 +00:00
Eric Christopher
95f92de138 Change getISAEncoding to use the target triple to determine
thumb-ness similar to the rest of the Module level asm printing
infrastructure as debug info finalization happens after the function
may be missing.

llvm-svn: 232875
2015-03-21 03:13:01 +00:00
Eric Christopher
5edce2db85 Make the Hexagon ISelDAGToDAG pass set the subtarget dynamically
on each runOnMachineFunction invocation.

llvm-svn: 232874
2015-03-21 03:12:59 +00:00
Kostya Serebryany
55ec403858 [sanitizer] experimental tracing for cmp instructions
llvm-svn: 232873
2015-03-21 01:29:36 +00:00
Ahmed Bougacha
3337019a5f [CodeGen][IfCvt] Don't re-ifcvt blocks with unanalyzable terminators.
If we couldn't analyze its terminator (i.e., it's an indirectbr, or some
other weirdness), we can't safely re-if-convert a predicated block,
because we can't tell whether the predicated terminator can
fallthrough (it does).

Currently, we would completely ignore the fallthrough successor. In
the added testcase, this means we used to generate:

    ...
  @ %entry:
    cmp   r5, #21
    ittt  ne
  @ %cc1f:
    cmpne r7, #42
  @ %cc2t:
    strne.w       r5, [r8]
    movne pc, r10
  @ %cc1t:
    ...

Whereas the successor of %cc1f was originally %bb1.
With the fix, we get the correct:

    ...
  @ %entry:
    cmp   r5, #21
    itt   eq
  @ %cc1t:
    streq.w       r5, [r11]
    moveq pc, r0
  @ %cc1f:
    cmp   r7, #42
    itt   ne
  @ %cc2t:
    strne.w       r5, [r8]
    movne pc, r10
  @ %bb1:
    ...

rdar://20192768
Differential Revision: http://reviews.llvm.org/D8509

llvm-svn: 232872
2015-03-21 01:23:15 +00:00
Ahmed Bougacha
6bc0aa2395 [AArch64] Prefer UZP for concat_vector of illegal truncs.
Follow-up to r232459: prefer a UZP shuffle to the intermediate truncs.

llvm-svn: 232871
2015-03-21 01:08:39 +00:00
Filipe Cabecinhas
5860032280 Make getLastArgNoClaim work for up to 4 arguments.
Summary:
This is needed for http://reviews.llvm.org/D8507
I have no idea what stand-alone tests could be done, if needed.

Reviewers: Bigcheese, craig.topper, samsonov

Subscribers: llvm-commits

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

llvm-svn: 232859
2015-03-20 23:32:58 +00:00
Yunzhong Gao
130199c4c2 Tell lit.cfg about more Windows triples.
For example, the host triple on my 64-bit PC is x86_64-pc-windows-msvc.

llvm-svn: 232854
2015-03-20 22:08:40 +00:00
Sanjay Patel
cf8a53f502 [X86, AVX] instcombine common cases of vperm2* intrinsics into shuffles
vperm2* intrinsics are just shuffles. 
In a few special cases, they're not even shuffles.

Optimizing intrinsics in InstCombine is better than
handling this in the front-end for at least two reasons:

1. Optimizing custom-written SSE intrinsic code at -O0 makes vector coders
   really angry (and so I have regrets about some patches from last week).

2. Doing mask conversion logic in header files is hard to write and 
   subsequently read.

There are a couple of TODOs in this patch to complete this optimization.

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

llvm-svn: 232852
2015-03-20 21:47:56 +00:00
Andrew Kaylor
7b78ee54b5 Fixing a bug with WinEH PHI handling
llvm-svn: 232851
2015-03-20 21:42:54 +00:00
Sanjay Patel
34ad366455 [X86] Prefer blendps over insertps codegen for one special case
With this patch, for this one exact case, we'll generate:

  blendps %xmm0, %xmm1, $1

instead of:

  insertps %xmm0, %xmm1, $0

If there's a memory operand available for load folding and we're
optimizing for size, we'll still generate the insertps.

The detailed performance data motivation for this may be found in D7866; 
in summary, blendps has 2-3x throughput vs. insertps on widely used chips.

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

llvm-svn: 232850
2015-03-20 21:19:52 +00:00
Benjamin Kramer
370163f28b X86: Make helper functions static. NFC.
llvm-svn: 232848
2015-03-20 21:07:30 +00:00
Eric Christopher
3aef531a8e Remove dead calls and function arguments dealing with TRI in StackMaps.
llvm-svn: 232847
2015-03-20 21:05:18 +00:00
Duncan P. N. Exon Smith
ffe7164bfa DebugInfo: Require valid DIDescriptors
As part of PR22777, switch from `dyn_cast_or_null<>` to `cast<>` in most
`DIDescriptor` accessors.  These classes are lightweight wrappers around
pointers, so the users should check for valid pointers before using
them.

This survives a Darwin clang -g bootstrap (after fixing testcases), but
it's possible the bots will complain about other configurations.  I'll
fix any fallout as quickly as I can!  Once this bakes for a bit I'll
remove the macros.

Note that `DebugLoc` implicitly gets stricter with this change as well,
since it forward to `DILocation`.  Any code that's using `DebugLoc`
accessors should check `DebugLoc::isUnknown()` first.  (BTW, I'm also
partway through a cleanup of the `DebugLoc` API to make it more obvious
what it is (a glorified pointer wrapper) and remove cruft from before
the Metadata/Value split.  I'll commit soon.)

llvm-svn: 232844
2015-03-20 20:17:07 +00:00
Rafael Espindola
06353319f0 Don't declare all text sections at the start of the .s
The code this patch removes was there to make sure the text sections went
before the dwarf sections. That is necessary because MachO uses offsets
relative to the start of the file, so adding a section can change relaxations.

The dwarf sections were being printed at the start just to produce symbols
pointing at the start of those sections.

The underlying issue was fixed in r231898. The dwarf sections are now printed
when they are about to be used, which is after we printed the text sections.

To make sure we don't regress, the patch makes the MachO streamer assert
if CodeGen puts anything unexpected after the DWARF sections.

llvm-svn: 232842
2015-03-20 20:00:01 +00:00
Duncan P. N. Exon Smith
c43bda0d54 Bugpoint: Fix invalid 'inlinedAt:' references in testcase
These are causing crashes in `DebugInfoFinder` after a WIP patch to
increase strictness of `DIDescriptor` accessors.

llvm-svn: 232839
2015-03-20 19:51:34 +00:00