Commit Graph

200396 Commits

Author SHA1 Message Date
Tom Stellard f01af29f01 MachineCSE: Add a target query for the LookAheadLimit heurisitic
This is used to determine whether or not to CSE physical register
defs.

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

llvm-svn: 236923
2015-05-09 00:56:07 +00:00
Pete Cooper d54fb89901 [Fast-ISel] Don't mark the first use of a remat constant as killed.
When emitting something like 'add x, 1000' if we remat the 1000 then we should be able to
mark the vreg containing 1000 as killed.  Given that we go bottom up in fast-isel, a later
use of 1000 will be higher up in the BB and won't kill it, or be impacted by the lower kill.

However, rematerialised constant expressions aren't generated bottom up.  The local value save area
grows downwards.  This means that if you remat 2 constant expressions which both use 1000 then the
first will kill it, then the second, which is *lower* in the BB will read a killed register.

This is the case in the attached test where the 2 GEPs both need to generate 'add x, 6680' for the constant offset.

Note that this commit only makes kill flag generation conservative.  There's nothing else obviously wrong with
the local value save area growing downwards, and in fact it needs to for handling arbitrarily complex constant expressions.

However, it would be nice if there was a solution which would let us generate more accurate kill flags, or just kill flags completely.

llvm-svn: 236922
2015-05-09 00:51:03 +00:00
Arnold Schwaighofer dc2711446e Fix compile error
llvm-svn: 236921
2015-05-09 00:10:25 +00:00
Tom Stellard 17ec3a51c3 Implement fast_normalize builtin v4
This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

v2:
  - Remove f suffix from constant in double implementations.
  - Consolidate implementations using the .cl/.inc approach.

v3:
 - Use __CLC_FPSIZE instead of __CLC_FP{32,64}

v4 (Jan Vesely):
 - Limit to single precision.

llvm-svn: 236920
2015-05-09 00:04:12 +00:00
Quentin Colombet 3e93ebecb8 Revert r236912.
Author: dblaikie
Date: Fri May  8 17:47:50 2015
New Revision: 236912

URL: http://llvm.org/viewvc/llvm-project?rev=236912&view=rev
Log:
[opaque pointer type] Cleanup a few references to pointee types using nearby non-pointee types of the same value

& cleanup a convoluted return expression while I'm here

llvm-svn: 236919
2015-05-09 00:02:06 +00:00
Davide Italiano 2c29cd697e [Target/ARM] Remove unused 'private' from class.
Differential Revision:	http://reviews.llvm.org/D9611
Reviewed by:	rengolin

llvm-svn: 236918
2015-05-08 23:58:28 +00:00
Oleksiy Vyalov a9ea07113c Use hard links to link sysroot files within ModuleCache.
http://reviews.llvm.org/D9587

llvm-svn: 236917
2015-05-08 23:54:34 +00:00
Arnold Schwaighofer f54b73d681 ScheduleDAGInstrs: In functions with tail calls PseudoSourceValues are not non-aliasing distinct objects
The code that builds the dependence graph assumes that two PseudoSourceValues
don't alias. In a tail calling function two FixedStackObjects might refer to the
same location. Worse 'immutable' fixed stack objects like function arguments are
not immutable and will be clobbered.

Change this so that a load from a FixedStackObject is not invariant in a tail
calling function and don't return a PseudoSourceValue for an instruction in tail
calling functions when building the dependence graph so that we handle function
arguments conservatively.

Fix for PR23459.

rdar://20740035

llvm-svn: 236916
2015-05-08 23:52:00 +00:00
Tom Stellard 2ddfa0c5b2 Implement half_rsqrt builtin v3
This is a generic implementation which just calls rsqrt.
Targets should override this if they want a faster implementation.

v2:
  - Alphabettize SOURCES

v3 (Jan Vesely):
  Limit to single precision types.

llvm-svn: 236915
2015-05-08 23:28:44 +00:00
Vince Harron a6ad6d3cc9 TestCModules was effectively skipped on Linux
Summary: I've removed the secret skip and added expectedFailureLinux
    
Test Plan: run tests
    
Reviewers: flackr
    
Subscribers: lldb-commits
    
Differential Revision: http://reviews.llvm.org/D9615

llvm-svn: 236914
2015-05-08 23:17:46 +00:00
Siva Chandra 2d7832e44b Bump the default timeout in dosep.py to 10m.
Summary:
This seems to be sufficient to get the tests taking longer than the
previous timeout of 5m to run to completion on Android to pass instead
of timing out.

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 236913
2015-05-08 23:08:53 +00:00
David Blaikie 951c8c4cf3 [opaque pointer type] Cleanup a few references to pointee types using nearby non-pointee types of the same value
& cleanup a convoluted return expression while I'm here

llvm-svn: 236912
2015-05-08 22:47:50 +00:00
Kostya Serebryany f3f3ed323a [lib/Fuzzer] build tests that work well with dfsan also w/o dfsan
llvm-svn: 236909
2015-05-08 21:45:19 +00:00
Tobias Grosser a704600295 Revert "Make emacs show when clang-format encountered a syntax error."
This reverts commit 236854, which caused clang-format to always print
'{ "IncompleteFormat": false }' at the top of an incompletely formatted file.
This output causes problems e.g. in Polly's automatic formatting checks. Daniel
tried to fix this in 236867, but this fix had to be reverted due to buildbot
failures. I revert this change as well for now as it is Friday night and
unlikely to be fixed immediately.

llvm-svn: 236908
2015-05-08 21:34:09 +00:00
Kostya Serebryany 8fd66a71c4 [asan/fuzzer] define a dummy weak __sanitizer_cov_trace_cmp
llvm-svn: 236907
2015-05-08 21:32:03 +00:00
Kostya Serebryany 1ac8055bc7 [lib/Fuzzer] use -fsanitize-coverage=trace-cmp when building LLVM with LLVM_USE_SANITIZE_COVERAGE; in lib/Fuzzer try to reload the corpus to pick up new units from other processes
llvm-svn: 236906
2015-05-08 21:30:55 +00:00
Hans Wennborg ae0254dabc Switch lowering: cluster adjacent fall-through cases even at -O0
It's cheap to do, and codegen is much faster if cases can be merged
into clusters.

llvm-svn: 236905
2015-05-08 21:23:39 +00:00
Daniel Berlin c67979bf4d Add a comment about DepthFirstIterator's skipchildren behavior
llvm-svn: 236904
2015-05-08 21:17:24 +00:00
Siva Chandra 09c4424994 [TestCreateAfterAttach] Add @skipIfRemote to the forking test.
Test Plan: dotest.py -p TestCreateAfterAttach

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: lldb-commits

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

llvm-svn: 236903
2015-05-08 21:12:41 +00:00
Jonathan Roelofs 1992834a29 Fix typo in www. NFC
llvm-svn: 236902
2015-05-08 21:11:49 +00:00
Renato Golin 0600e1ebe9 Using ARMTargetParser in Clang
This is a starting point for using the TargetParser in Clang, in a simple
enough part of the code that can be used without disrupting the crazy
platform support that we need to be compatible with other toolchains.

Also adding a few FIXME on obvious places that need replacing, but those
cases will indeed break a few of the platform assumptions, as arch/cpu names
change multiple times in the driver.

Finally, I'm changing the "neon-vfpv3" behaviour to match standard NEON, since
-mfpu=neon implies vfpv3 by default in both Clang and LLVM. That option
string is still supported as an alias to "neon".

llvm-svn: 236901
2015-05-08 21:04:50 +00:00
Renato Golin f5f373fcf1 TargetParser: FPU/ARCH/EXT parsing refactory - NFC
This new class in a global context contain arch-specific knowledge in order
to provide LLVM libraries, tools and projects with the ability to understand
the architectures. For now, only FPU, ARCH and ARCH extensions on ARM are
supported.

Current behaviour it to parse from free-text to enum values and back, so that
all users can share the same parser and codes. This simplifies a lot both the
ASM/Obj streamers in the back-end (where this came from), and the front-end
parsers for command line arguments (where this is going to be used next).

The previous implementation, using .def/.h includes is deprecated due to its
inflexibility to be built without the backend support and for being too
cumbersome. As more architectures join this scheme, and as more features of
such architectures are added (such as hardware features, type sizes, etc) into
a full blown TargetDescription class, having a set of classes is the most
sane implementation.

The ultimate goal of this refactor both LLVM's and Clang's target description
classes into one unique interface, so that we can de-duplicate and standardise
the descriptions, as well as make it available for other front-ends, tools,
etc.

The FPU parsing for command line options in Clang has been converted to use
this new library and a number of aliases were added for compatibility:
 * A bogus neon-vfpv3 alias (neon defaults to vfp3)
 * armv5/v6
 * {fp4/fp5}-{sp/dp}-d16

Next steps:
 * Port Clang's ARCH/EXT parsing to use this library.
 * Create a TableGen back-end to generate this information.
 * Run this TableGen process regardless of which back-ends are built.
 * Expose more information and rename it to TargetDescription.
 * Continue re-factoring Clang to use as much of it as possible.

llvm-svn: 236900
2015-05-08 21:04:27 +00:00
Diego Novillo 0aaff4795b Update Function::getContext documentation. NFC.
llvm-svn: 236899
2015-05-08 21:01:29 +00:00
Diego Novillo 86f884ed46 Fix BackendConsumer::EmitOptimizationMessage()
Patch from Geoff Berry <gberry@codeaurora.org>

Fix BackendConsumer::EmitOptimizationMessage() to check if the
DiagnosticInfoOptimizationBase object has a valid location before
calling getLocation() to avoid dereferencing a null pointer inside
getLocation() when no debug info is present.

llvm-svn: 236898
2015-05-08 20:59:56 +00:00
Pete Cooper e4bb07ecff [Fast-ISel] Clear kill flags on registers replaced by updateValueMap.
When selecting an extract instruction, we don't actually generate code but instead work out which register we are reading, and rewrite uses of the extract def to the source register.  This is done via updateValueMap,.

However, its possible that the source register we are rewriting *to* to also have uses.  If those uses are after a kill of the value we are rewriting *from* then we have uses after a kill and the verifier fails.

This code checks for the case where the to register is also used, and if so it clears all kill on the from register.  This is conservative, but better that always clearing kills on the from register.

llvm-svn: 236897
2015-05-08 20:46:54 +00:00
Brendon Cahoon bece8edcdd [Hexagon] Generate more hardware loops
Refactored parts of the hardware loop pass to generate
more. Also, added more tests.

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

llvm-svn: 236896
2015-05-08 20:18:21 +00:00
Ed Maste 82d9f037fe Skip tests that are timing out on the FreeBSD buildbot
XFAILing these does not work because the timeout is caught by the
top-level test infrastucture instead.

Might be llvm.org/pr22784

llvm-svn: 236895
2015-05-08 19:51:44 +00:00
Sanjoy Das 14f5080aa1 [BasicAA] Fix zext & sext handling
Summary:

There are several unhandled edge cases in BasicAA's GetLinearExpression
method. This changes fixes outstanding issues, including zext / sext of
a constant with the sign bit set, and the refusal to decompose zexts or
sexts of wrapping arithmetic.

Test Plan: Unit tests added in //q.ext.ll//.

Patch by Nick White.

Reviewers: hfinkel, sanjoy

Reviewed By: hfinkel, sanjoy

Subscribers: sanjoy, llvm-commits, hfinkel

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

llvm-svn: 236894
2015-05-08 18:58:55 +00:00
David Blaikie b340f0a7bc Replace branch-to-unreachable with assertion.
llvm-svn: 236893
2015-05-08 18:52:28 +00:00
Zachary Turner a49c59145b Enable thread-safe logging.
Thread-safe logging had been disabled because of a deadlock,
possibly due to a lock acquired during a signal handler.

This patch turns thread safe logging back on and also greatly
reduces the scope of the lock, confining it only to the code that
affects the underlying output stream, instead of all the code that
builds up the formatted log message.  this should resolve the
issue surrounding the deadlock.

llvm-svn: 236892
2015-05-08 18:50:54 +00:00
Pat Gavlin 7afaed2847 Fix a docs build break introduced by rL236888.
llvm-svn: 236891
2015-05-08 18:37:49 +00:00
Pete Cooper 7f7c9f1dad [X86] Fast-ISel was incorrectly always killing the source of a truncate.
A trunc from i32 to i1 on x86_64 generates an instruction such as

%vreg19<def> = COPY %vreg9:sub_8bit<kill>; GR8:%vreg19 GR32:%vreg9

However, the copy here should only have the kill flag on the 32-bit path, not the 64-bit one.
Otherwise, we are killing the source of the truncate which could be used later in the program.

llvm-svn: 236890
2015-05-08 18:29:42 +00:00
Anton Korobeynikov 396441c873 Typos
llvm-svn: 236889
2015-05-08 18:14:14 +00:00
Pat Gavlin cc0431d1c0 Extend the statepoint intrinsic to allow statepoints to be marked as transitions from GC-aware code to code that is not GC-aware.
This changes the shape of the statepoint intrinsic from:

  @llvm.experimental.gc.statepoint(anyptr target, i32 # call args, i32 unused, ...call args, i32 # deopt args, ...deopt args, ...gc args)

to:

  @llvm.experimental.gc.statepoint(anyptr target, i32 # call args, i32 flags, ...call args, i32 # transition args, ...transition args, i32 # deopt args, ...deopt args, ...gc args)

This extension offers the backend the opportunity to insert (somewhat) arbitrary code to manage the transition from GC-aware code to code that is not GC-aware and back.

In order to support the injection of transition code, this extension wraps the STATEPOINT ISD node generated by the usual lowering lowering with two additional nodes: GC_TRANSITION_START and GC_TRANSITION_END. The transition arguments that were passed passed to the intrinsic (if any) are lowered and provided as operands to these nodes and may be used by the backend during code generation.

Eventually, the lowering of the GC_TRANSITION_{START,END} nodes should be informed by the GC strategy in use for the function containing the intrinsic call; for now, these nodes are instead replaced with no-ops.

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

llvm-svn: 236888
2015-05-08 18:07:42 +00:00
Jingyue Wu 78b0d51cd0 [NoTTI] reject negative scale in addressing mode
Summary:
I noticed this bug when deubging a WIP on LSR. I wonder whether and how we
should add a regression test for this.

Test Plan: no tests failed.

Reviewers: atrick

Subscribers: hfinkel, llvm-commits

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

llvm-svn: 236887
2015-05-08 18:07:24 +00:00
Pete Cooper 85b1c48b20 Clear kill flags on all used registers when sinking instructions.
The test here was sinking the AND here to a lower BB:

	%vreg7<def> = ANDWri %vreg8, 0; GPR32common:%vreg7,%vreg8
	TBNZW %vreg8<kill>, 0, <BB#1>; GPR32common:%vreg8

which meant that vreg8 was read after it was killed.

This commit changes the code from clearing kill flags on the AND to clearing flags on all registers used by the AND.

llvm-svn: 236886
2015-05-08 17:54:32 +00:00
Pete Cooper ff5064a188 80 cols fix since i'm looking at this function anyway. NFC
llvm-svn: 236885
2015-05-08 17:54:29 +00:00
Andrey Churbanov 820b25550b Change some text areas from saying Intel(R) OpenMP runtime library to LLVM OpenMP runtime library.
llvm-svn: 236884
2015-05-08 17:41:32 +00:00
Kaelyn Takata c8c0de2a89 Add the test case from PR 14044 to ensure it doesn't regress.
The test started working at some point, presumably fixed through the
delayed typo correction work.

llvm-svn: 236883
2015-05-08 17:39:48 +00:00
Renato Golin 82fbfe684e Revert "clang-format: Only output IncompleteFormat if -cursor is given."
This reverts commit r236867, as it was breaking multiple buildbots. Daniel
will look into it later.

llvm-svn: 236882
2015-05-08 17:05:24 +00:00
Pete Cooper eaef4bcd40 Remove duplicate cmake target I added in r236792.
Thanks to Daniel Jasper for pointing out the mistake.

llvm-svn: 236881
2015-05-08 16:59:53 +00:00
Davide Italiano d3142ec82b [ARM] Use the correct variable name and unbreak buildbot.
llvm-svn: 236880
2015-05-08 16:49:18 +00:00
Derek Schuff 2312bd3811 Do not emit thunks with available_externally linkage in comdats
Functions with available_externally linkage will not be emitted to object
files (they will just be undefined symbols), so it does not make sense to
put them in comdats.

Creates a second overload of maybeSetTrivialComdat that uses the GlobalObject
instead of the Decl, and uses that in several places that had the faulty
logic.

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

llvm-svn: 236879
2015-05-08 16:47:21 +00:00
Douglas Katzman 049887b252 Unbreak build: Makefile must have the same change as CMakeLists.txt
This was omitted from http://reviews.llvm.org/D9441
(the irony is that that was to detect omissions in something else)

llvm-svn: 236878
2015-05-08 16:39:59 +00:00
Sergey Matveev 42cc8fa592 [sanitizer] Attempt to fix the test for missing coverage script.
llvm-svn: 236877
2015-05-08 16:30:01 +00:00
Brendon Cahoon df43e68629 [Hexagon] Update AnalyzeBranch, etc target hooks
Improved the AnalyzeBranch, InsertBranch, and RemoveBranch
functions in order to handle more of our branch instructions.
This requires changes to analyzeCompare and PredicateInstructions.
Specifically, we've added support for new value compare jumps,
improved handling of endloop, added more compare instructions,
and improved support for predicate instructions.

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

llvm-svn: 236876
2015-05-08 16:16:29 +00:00
Tobias Grosser f7b5480474 Adjust formatting to latest clang-format change
llvm-svn: 236875
2015-05-08 16:10:53 +00:00
Anton Korobeynikov d3b50dce40 Fix "TODO" and provide the configure-time options to find libunwind.
This is done the same way as we're looking for libc++

llvm-svn: 236874
2015-05-08 16:10:11 +00:00
Leny Kholodov bde4144338 [ARM] Generation of .ARM.exidx/.ARM.extab sections
This patch provides generation of .ARM.exidx & .ARM.extab sections which are
used for unwinding. The patch adds new content type typeARMExidx for atoms from
.ARM.exidx section and integration of atoms with such type to the ELF
ReaderWriter. exidx.test has been added with checking of contents of .ARM.exidx
section and .ARM.extab section.

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

llvm-svn: 236873
2015-05-08 16:04:11 +00:00
Tamas Berghammer d916dbb726 Remove check for object file type from DynamicLoaderPOSIXDYLD::DidAttach
For PIE executables the type of the main executable is shared object
so we can't force that the main executable should have the type of
executable.

llvm-svn: 236870
2015-05-08 15:45:53 +00:00