Commit Graph

152666 Commits

Author SHA1 Message Date
Fariborz Jahanian e23f26bf94 ObjectiveC: diagnose duplicate declaration of
private ivars in class extensions and class
@implementation. // rdar://14278560

llvm-svn: 185025
2013-06-26 22:10:27 +00:00
Stephen Lin ff7fceed7d ARM: Proactively ensure that the LowerCallResult hack for 'this'-returns is not used for incompatible calling conventions.
(Currently, ARM 'this'-returns are handled in the standard calling convention case by treating R0 as preserved and doing some extra magic in LowerCallResult; this may not apply to calling conventions added in the future so this patch provides and documents an interface for indicating such)

llvm-svn: 185024
2013-06-26 21:42:14 +00:00
Joerg Sonnenberger ffc6d49982 Don't use unnamed local enums as template arguments.
Fixes -Werror bootstrap.

llvm-svn: 185023
2013-06-26 21:31:47 +00:00
Aaron Ballman 2a6febc0c5 This patch fixes PR16395, when HandleMSProperty returns null due to a declaration with no name.
Patch thanks to Robert Wilhelm.

llvm-svn: 185022
2013-06-26 21:28:44 +00:00
David Majnemer 23e297ff0a AST: small cleanup to FriendObjectKind
llvm-svn: 185021
2013-06-26 21:28:41 +00:00
Manman Ren aa00ce0e8f Debug Info: clean up usage of Verify.
No functionality change.
It should suffice to check the type of a debug info metadata, instead of
calling Verify.

llvm-svn: 185020
2013-06-26 21:26:10 +00:00
Rafael Espindola 8b96094420 Sync file handling logic in RewriterTestContext.h and RefactoringTest.cpp.
They are mostly duplicated and got out of sync during the PathV1 removal. We
should factor the code somewhere, but for now a FIXME will do.

llvm-svn: 185019
2013-06-26 21:02:22 +00:00
Eli Friedman 2782dacfbc Rewrite record layout for ms_struct structs.
The old implementation of ms_struct in RecordLayoutBuilder was a
complete mess: it depended on complicated conditionals which didn't
really reflect the underlying logic, and placed a burden on users of
the resulting RecordLayout. This commit rips out almost all of the
old code, and replaces it with simple checks in
RecordLayoutBuilder::LayoutBitField.

This commit also fixes <rdar://problem/14252115>, a bug where class
inheritance would cause us to lay out bitfields incorrectly.

llvm-svn: 185018
2013-06-26 20:50:34 +00:00
Han Ming Ong 6db14a9965 <rdar://problem/14262854>
Match up with top’s implementation on recent Cab as API has changed a bit.
Tested the same binary running on Zin as well. Tested ARM binary on iOS as well.

llvm-svn: 185017
2013-06-26 20:46:27 +00:00
Stephen Lin 4ff0dbb615 Minor formatting fix to ARMBaseRegisterInfo::getCalleeSavedRegs
llvm-svn: 185016
2013-06-26 20:19:06 +00:00
Rafael Espindola f1fc3829a8 Rename PathV2 to just Path now that it is the only one.
llvm-svn: 185015
2013-06-26 19:33:03 +00:00
Aaron Ballman 6ce6309adf Updating the same comment in a different file, again for links. No functional change intended.
llvm-svn: 185014
2013-06-26 19:33:02 +00:00
Aaron Ballman fcd5b7e76e Updating a link in the comments; no functional change.
llvm-svn: 185013
2013-06-26 19:17:19 +00:00
Akira Hatanaka c3114b3341 [mips] Do not emit ".option pic0" if target is mips64.
llvm-svn: 185012
2013-06-26 19:08:49 +00:00
Akira Hatanaka 5832fc607b [mips] Improve code generation for constant multiplication using shifts, adds and
subs.

llvm-svn: 185011
2013-06-26 18:48:17 +00:00
Matt Kopec eb7f2315f4 Remove unneeded limbo state flag.
llvm-svn: 185010
2013-06-26 18:46:08 +00:00
Tom Stellard 64b3bbae1e libclc: Add assembly versions of vstore for global [u]int4/8/16
The assembly should be generic, but at least currently R600 only supports
32-bit stores of [u]int1/4, and I believe that only global is well-supported.

R600 lowers the 8/16 component stores to multiple 4-component stores.

The unoptimized C versions of the other stuff is left in place.

Patch by: Aaron Watry

llvm-svn: 185009
2013-06-26 18:22:20 +00:00
Tom Stellard 922ac056e3 libclc: Add assembly versions of vload for global int4/8/16
The assembly should be generic, but at least currently R600 only supports
32-bit loads of int1/4, and I believe that only global is well-supported.

R600 lowers the 8/16 component vectors to multiple 4-bit loads.

The unoptimized C versions of the other stuff is left in place.

Patch by: Aaron Watry

llvm-svn: 185008
2013-06-26 18:22:15 +00:00
Tom Stellard 51441f80c5 libclc: Initial vstore implementation
Assumes that the target supports byte-addressable stores.

Completely unoptimized.

Patch by: Aaron Watry

llvm-svn: 185007
2013-06-26 18:22:11 +00:00
Tom Stellard 66ecbc7c18 libclc: Initial vload implementation
Should work for all targets and data types.  Completely unoptimized.

Patch by: Aaron Watry

llvm-svn: 185006
2013-06-26 18:22:05 +00:00
Tom Stellard c0af47de00 r600: Fix implementations of get_group_id.ll and get_local_size.ll
llvm-svn: 185005
2013-06-26 18:22:00 +00:00
Tom Stellard e78344dfae libclc: Implement clz() builtin
Squashed commit of the following:

commit a0df0a0e86c55c1bdc0b9c0f5a739e5adef4b056
Author: Aaron Watry <awatry@gmail.com>
Date:   Mon Apr 15 18:42:04 2013 -0500

    libclc: Rename clz.ll to clz_if.ll to ensure it gets built.

    configure.py treats files that have the same name with the .cl and .ll
    extensions as overriding eachother.

    E.g. If you have clz.cl and clz.ll both specified to be built in the same
    SOURCES file, only the first file listed will actually be built.

    Since the contents of clz.ll were an interface that is implemented in
    clz_impl.ll, rename clz.ll to clz_if.ll to make sure that the interface is
    built.

commit 931b62bed05c58f737de625bd415af09571a6a5a
Author: Aaron Watry <awatry@gmail.com>
Date:   Sat Apr 13 12:32:54 2013 -0500

    libclc: llvm assembly implementation of clz

    Untested... currently crashes in the same manner as add_sat.

commit 6ef0b7b0b6d2e5584086b4b9a9243743b2e0538f
Author: Aaron Watry <awatry@gmail.com>
Date:   Sat Mar 23 12:35:27 2013 -0500

    libclc: Add stub clz builtin

    For scalar int/uint, attempt to use the clz llvm builtin.. for all others
    return 0 until an actual implementation is finished.

Patch by: Aaron Watry

llvm-svn: 185004
2013-06-26 18:21:55 +00:00
Tom Stellard 34f513df7c libclc: Add clamp(vec, scalar, scalar) and max(vec, scalar)
For any GENTYPE that isn't scalar, we need to implement a mixed
vector/scalar version of clamp/max.

This depends on the min() patches I sent to the list a few minutes ago.

Patch by: Aaron Watry

llvm-svn: 185003
2013-06-26 18:21:49 +00:00
Tom Stellard 075b31a2fa libclc: Implement the min(vec, scalar) version of the min builtin.
Checks if the current GENTYPE is scalar, and if not, then defines a separate
implementation of the function which casts the second arg to vector before
proceeding.

Patch by: Aaron Watry

llvm-svn: 185002
2013-06-26 18:21:44 +00:00
Tom Stellard 0be3acfc70 libclc: implement initial version of min()
This doesn't handle the integer cases for min(vector, scalar).

Patch by: Aaron Watry

llvm-svn: 185001
2013-06-26 18:21:38 +00:00
Tom Stellard 29b5b9816b libclc: Rename [add|sub]_sat.ll to [add|sub]_sat_if.ll
configure.py allows overloading *.cl with *.ll, but will only ever build
the first file listed in SOURCES of ${file}.cl and ${file}.ll

add_sat, sub_sat, (and the soon to be submitted clz) all define interfaces in
${function_name}.ll which are implemented in ${function_name}_impl.ll.

Renaming the interface files is enough to get them to build again, fixing
CL usage of these functions.

Tested on clover/r600g.

Patch by: Aaron Watry

llvm-svn: 185000
2013-06-26 18:21:31 +00:00
Tom Stellard a30713710c Add a another TODO note.
Patch by: Aaron Watry

llvm-svn: 184999
2013-06-26 18:21:25 +00:00
Tom Stellard 4974f6c6d0 Add a TODO note.
Patch by: Aaron Watry

llvm-svn: 184998
2013-06-26 18:21:22 +00:00
Tom Stellard 8c1e72f46a Simplify rotate implementation a bit..
Much more understandable/readable as a result, and probably more efficient.

Patch by: Aaron Watry

llvm-svn: 184997
2013-06-26 18:21:18 +00:00
Tom Stellard 0bb381eaec libclc: implement rotate builtin
This implementation does a lot of bit shifting and masking. Suffice to say,
this is somewhat suboptimal... but it does look to produce correct results
(after the piglit tests were corrected for sign extension issues).

Someone who knows LLVM better than I could re-write this more efficiently.

Patch by: Aaron Watry

llvm-svn: 184996
2013-06-26 18:21:13 +00:00
Tom Stellard cb133c9322 libclc: Move max builtin to shared/
Max(x,y) is available for all integer/floating types.

Patch by: Aaron Watry

llvm-svn: 184995
2013-06-26 18:21:06 +00:00
Tom Stellard fe23a30ef5 libclc: Add clamp() builtin for integer/floating point
Created under a new shared/ directory for functions which are available for
both integer and floating point types.

Patch by: Aaron Watry

llvm-svn: 184994
2013-06-26 18:20:56 +00:00
Tom Stellard cd88a4ebb6 libclc: Fix abs_diff builtin integer function
Patch by: Aaron Watry

llvm-svn: 184993
2013-06-26 18:20:50 +00:00
Tom Stellard ec87fb0b0c libclc: Add max() builtin function
Adds this function for both int and floating data types.

Patch by: Aaron Watry

llvm-svn: 184992
2013-06-26 18:20:46 +00:00
Tom Stellard 30f554b23d configure: Enable building separate libraries for target variants
llvm-svn: 184991
2013-06-26 18:20:38 +00:00
Tom Stellard 5668ea2d48 configure: fix out-of-source build
Patch by: Niels Ole Salscheider

llvm-svn: 184990
2013-06-26 18:20:35 +00:00
Tom Stellard 976577ecae Fix build with LLVM 3.3
Patch by: Niels Ole Salscheider

llvm-svn: 184989
2013-06-26 18:20:32 +00:00
Tom Stellard 207345820f Implement ceil() builtin
llvm-svn: 184988
2013-06-26 18:20:30 +00:00
Tom Stellard 509b3b2104 Implement fmax() and fmin() builtins
llvm-svn: 184987
2013-06-26 18:20:25 +00:00
Tom Stellard d84c7f5d0f Remove the static keyword from the _CLC_INLINE macro
static functions are not allowed in OpenCL C

llvm-svn: 184986
2013-06-26 18:20:18 +00:00
Tom Stellard 99bd71c4f5 Use brackets around include files in length.cl and normalize.cl
These functions were not being compiled

llvm-svn: 184985
2013-06-26 18:20:15 +00:00
Tom Stellard 560dbee27a Fix typo in include/clc/geometric/length.inc
llvm-svn: 184984
2013-06-26 18:20:12 +00:00
Tom Stellard 88812274dc r600: Add overrides file
llvm-svn: 184983
2013-06-26 18:20:08 +00:00
Tom Stellard d54f6ba7b8 Allow targets to override generic implementations
Targets can override generic implementations by adding a file called
OVERRIDES in $(TARGET_DIR)/lib and listing the generic implementations
that it wants to override.  For example, to override get_group_id() and
get_global_size() you would add these lines to the OVERRIDES file:

workitem/get_group_id.cl
workitem/get_global_size.cl

llvm-svn: 184982
2013-06-26 18:20:05 +00:00
Tom Stellard 1de7761ed9 Make libclc more Linux FHS conform.
- First introducing a versioning scheme
- Add --libexecdir, --includedir and --pkgconfigdir and prefill them as well as --prefix
- Build all targets by default
- Create clc.pc and install it in $pkgconfigdir
- Use clang++ instead of c++
- Rename builtins.bc to built_libs/$triple.bc and install them in $libexecdir
- Includes are installed recursively to $includedir
- Finally add $(DESTDIR) for 'make install'

Patch by: Johannes Obermayr

llvm-svn: 184981
2013-06-26 18:20:03 +00:00
Tom Stellard f2f5a86620 R600: Replace cl implementations with LLVM IR implementation
This allows libclc to be built for R600 with upstream clang and LLVM.

llvm-svn: 184980
2013-06-26 18:20:00 +00:00
Tom Stellard 10b6c22e8d PTX: move implementations of work-item and synchronisation functions
to lib, and add header files in generic.  Incorporates a patch by
Tom Stellard!

llvm-svn: 184979
2013-06-26 18:19:54 +00:00
Tom Stellard 9d804dae35 Move R600 headers into generic directory
llvm-svn: 184978
2013-06-26 18:19:50 +00:00
Tom Stellard 38f0ac9d5e r600: Add get_global_size() implementation
llvm-svn: 184977
2013-06-26 18:19:44 +00:00
Tom Stellard ac14c4e878 r600: Fix get_global_id implementation
llvm-svn: 184976
2013-06-26 18:19:39 +00:00