1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

115194 Commits

Author SHA1 Message Date
Benjamin Kramer
256487b189 [winehprepare] Update and sort includes. NFC.
llvm-svn: 232994
2015-03-23 18:57:17 +00:00
Benjamin Kramer
e51698aa6c Another set of missing raw_ostream.h. Still no functional change.
llvm-svn: 232993
2015-03-23 18:45:56 +00:00
Matt Arsenault
8e770103b5 R600/SI: Merge tables for commuting
Don't use a separate table for compares anymore,
and use the same VOP2_REV class.

llvm-svn: 232992
2015-03-23 18:45:41 +00:00
Matt Arsenault
eccb2c4adf R600/SI: Only use one range of isCommutable for compares
Also don't count the class instructions as isCompare anymore.

llvm-svn: 232991
2015-03-23 18:45:38 +00:00
Matt Arsenault
9b09466d56 R600/SI: Remove redundant unsetting of hasSideEffects
These are already set in the base class for the instruction.

llvm-svn: 232990
2015-03-23 18:45:36 +00:00
Matt Arsenault
4417e31a16 R600/SI: Move hasSideEffects setting into VOPCX classes
llvm-svn: 232989
2015-03-23 18:45:35 +00:00
Matt Arsenault
c20cbf651a R600/SI: Allow commuting compares
This enables very common cases to switch to the
smaller encoding.

All of the standard LLVM canonicalizations of comparisons
are the opposite of what we want. Compares with constants
are moved to the RHS, but the first operand can be an inline
immediate, literal constant, or SGPR using the 32-bit VOPC
encoding.

There are additional bad canonicalizations that should
also be fixed, such as canonicalizing ge x, k to gt x, (k + 1)
if this makes k no longer an inline immediate value.

llvm-svn: 232988
2015-03-23 18:45:30 +00:00
Matt Arsenault
62b927232e R600/SI: Use right class for cmpsx f64 instructions
Use VOPCX_F64 to not need the let Defs = [EXEC]

llvm-svn: 232987
2015-03-23 18:45:23 +00:00
Matt Arsenault
091c8e3346 R600/SI: Remove cond operand to VOPCX classes
It isn't used, and these will probably never be directly selected.

llvm-svn: 232986
2015-03-23 18:45:20 +00:00
David Blaikie
6e404de8a2 Refactor: simplify boolean expressions in llvm-objdump
Simplify boolean expressions involving `true` and `false` with `clang-tidy`.

Actually upon inspection a bunch of these boolean variables could be
factored away entirely anyway - using find_if and then testing the
result before using it. This also helps reduce indentation in the code
anyway - and a bunch of other related simplification fell out nearby so
I just committed all of that.

Patch by Richard Thomson (legalize@xmission.com)

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

llvm-svn: 232984
2015-03-23 18:39:02 +00:00
Yaron Keren
da3be4cd62 Add missing ELFObjectWriter::reset() override, like other MC classes.
See detailed discussion at

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140915/235418.html

and r217907, r217948:

 http://llvm.org/viewvc/llvm-project?view=revision&revision=217907
 http://llvm.org/viewvc/llvm-project?view=revision&revision=217948

llvm-svn: 232982
2015-03-23 18:35:01 +00:00
Benjamin Kramer
14de61149f More missing includes only visible to MSVC.
NFC.

llvm-svn: 232981
2015-03-23 18:23:08 +00:00
Benjamin Kramer
8660a876e1 Add missing include that MSVC complains about.
Also reorder includes a bit, NFC.

llvm-svn: 232980
2015-03-23 18:19:41 +00:00
Benjamin Kramer
45a545b9c6 Purge unused includes throughout libSupport.
NFC.

llvm-svn: 232976
2015-03-23 18:07:13 +00:00
Chad Rosier
c67eff5c3b [AArch64] Enable rematerialization of float 0 values.
Patch by Geoff Berry<gberry@codeaurora.org>.

llvm-svn: 232967
2015-03-23 17:19:34 +00:00
Bradley Smith
f7359fa871 Revert "[ARM] Add more pattern matching for f16 <-> f64 conversions"
This change is incorrect since it converts double rounding into single rounding,
which can produce different results. Instead this optimization will be done by
modifying Clang's codegen to not produce double rounding in the first place.

This reverts commit r232954.

llvm-svn: 232962
2015-03-23 16:52:52 +00:00
Eli Bendersky
feff27462f Simplify boolean expressions with true and false using clang-tidy
Patch by Richard (legalize@xmission.com)

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

llvm-svn: 232961
2015-03-23 16:26:23 +00:00
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