platform/upstream/llvm.git
9 years agoRefactor: Simplify boolean expressions in llvm Support
David Blaikie [Mon, 23 Mar 2015 19:45:40 +0000 (19:45 +0000)]
Refactor: Simplify boolean expressions in llvm Support

Simplify boolean expressions using `true` and `false` with `clang-tidy`

Patch by Richard Thomson - I dropped the parens and != 0 test, for
consistency with other patches/tests like this, but I'm open to the
notion that we should add the explicit non-zero test in all these sort
of cases (non-bool assigned to a bool).

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

llvm-svn: 233004

9 years ago[Sanitizers] Fix internal_ftruncate() to work on FreeBSD
Viktor Kutuzov [Mon, 23 Mar 2015 19:44:35 +0000 (19:44 +0000)]
[Sanitizers] Fix internal_ftruncate() to work on FreeBSD
Differential Revision: http://reviews.llvm.org/D8551

llvm-svn: 233003

9 years agoRefactor: Simplify boolean expressions in x86 target
David Blaikie [Mon, 23 Mar 2015 19:42:36 +0000 (19:42 +0000)]
Refactor: Simplify boolean expressions in x86 target

Simplify boolean expressions with `true` and `false` with `clang-tidy`

Patch by Richard Thomson.

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

llvm-svn: 233002

9 years ago[Tsan] Fix the mmap_large.cc test to build on FreeBSD
Viktor Kutuzov [Mon, 23 Mar 2015 19:40:59 +0000 (19:40 +0000)]
[Tsan] Fix the mmap_large.cc test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D8545

llvm-svn: 233001

9 years agoRefactor: Simplify boolean expression in modularize
David Blaikie [Mon, 23 Mar 2015 19:40:59 +0000 (19:40 +0000)]
Refactor: Simplify boolean expression in modularize

Simplify boolean expressions using `true` and `false` with `clang-tidy`

Patch by Richard Thomson.

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

llvm-svn: 233000

9 years agoRefactor: Simplify boolean expresssions in lib/Lex
David Blaikie [Mon, 23 Mar 2015 19:39:19 +0000 (19:39 +0000)]
Refactor: Simplify boolean expresssions in lib/Lex

Simplify boolean expressions using `true` and `false` with `clang-tidy`

Patch by Richard Thomson.

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

llvm-svn: 232999

9 years agoRe-sort includes with sort-includes.py and insert raw_ostream.h where it's used.
Benjamin Kramer [Mon, 23 Mar 2015 19:32:43 +0000 (19:32 +0000)]
Re-sort includes with sort-includes.py and insert raw_ostream.h where it's used.

llvm-svn: 232998

9 years agoFix and update comments and a small reformatting.
Eric Christopher [Mon, 23 Mar 2015 19:26:05 +0000 (19:26 +0000)]
Fix and update comments and a small reformatting.

llvm-svn: 232997

9 years agoRefactor: Simplify boolean expressions in libclang
Dmitri Gribenko [Mon, 23 Mar 2015 19:23:50 +0000 (19:23 +0000)]
Refactor: Simplify boolean expressions in libclang

Simplify boolean expresions using true and false with clang-tidy.

Patch by Richard.

llvm-svn: 232996

9 years ago[ctorutils] Update and sort includes. NFC.
Benjamin Kramer [Mon, 23 Mar 2015 19:06:17 +0000 (19:06 +0000)]
[ctorutils] Update and sort includes. NFC.

llvm-svn: 232995

9 years ago[winehprepare] Update and sort includes. NFC.
Benjamin Kramer [Mon, 23 Mar 2015 18:57:17 +0000 (18:57 +0000)]
[winehprepare] Update and sort includes. NFC.

llvm-svn: 232994

9 years agoAnother set of missing raw_ostream.h. Still no functional change.
Benjamin Kramer [Mon, 23 Mar 2015 18:45:56 +0000 (18:45 +0000)]
Another set of missing raw_ostream.h. Still no functional change.

llvm-svn: 232993

9 years agoR600/SI: Merge tables for commuting
Matt Arsenault [Mon, 23 Mar 2015 18:45:41 +0000 (18:45 +0000)]
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

9 years agoR600/SI: Only use one range of isCommutable for compares
Matt Arsenault [Mon, 23 Mar 2015 18:45:38 +0000 (18:45 +0000)]
R600/SI: Only use one range of isCommutable for compares

Also don't count the class instructions as isCompare anymore.

llvm-svn: 232991

9 years agoR600/SI: Remove redundant unsetting of hasSideEffects
Matt Arsenault [Mon, 23 Mar 2015 18:45:36 +0000 (18:45 +0000)]
R600/SI: Remove redundant unsetting of hasSideEffects

These are already set in the base class for the instruction.

llvm-svn: 232990

9 years agoR600/SI: Move hasSideEffects setting into VOPCX classes
Matt Arsenault [Mon, 23 Mar 2015 18:45:35 +0000 (18:45 +0000)]
R600/SI: Move hasSideEffects setting into VOPCX classes

llvm-svn: 232989

9 years agoR600/SI: Allow commuting compares
Matt Arsenault [Mon, 23 Mar 2015 18:45:30 +0000 (18:45 +0000)]
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

9 years agoR600/SI: Use right class for cmpsx f64 instructions
Matt Arsenault [Mon, 23 Mar 2015 18:45:23 +0000 (18:45 +0000)]
R600/SI: Use right class for cmpsx f64 instructions

Use VOPCX_F64 to not need the let Defs = [EXEC]

llvm-svn: 232987

9 years agoR600/SI: Remove cond operand to VOPCX classes
Matt Arsenault [Mon, 23 Mar 2015 18:45:20 +0000 (18:45 +0000)]
R600/SI: Remove cond operand to VOPCX classes

It isn't used, and these will probably never be directly selected.

llvm-svn: 232986

9 years ago[ELF] Remove extraneous semicolon in DefaultLayout
Rafael Auler [Mon, 23 Mar 2015 18:39:37 +0000 (18:39 +0000)]
[ELF] Remove extraneous semicolon in DefaultLayout

llvm-svn: 232985

9 years agoRefactor: simplify boolean expressions in llvm-objdump
David Blaikie [Mon, 23 Mar 2015 18:39:02 +0000 (18:39 +0000)]
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

9 years agoInitialize ObjC runtime at the right location.
Stephane Sezer [Mon, 23 Mar 2015 18:36:54 +0000 (18:36 +0000)]
Initialize ObjC runtime at the right location.

Summary:
Saw this while reading some code in DynamicLoader classes. Looks like this has
been a FIXME since 2011 at least.

Test Plan: Run unit tests.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 232983

9 years agoAdd missing ELFObjectWriter::reset() override, like other MC classes.
Yaron Keren [Mon, 23 Mar 2015 18:35:01 +0000 (18:35 +0000)]
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

9 years agoMore missing includes only visible to MSVC.
Benjamin Kramer [Mon, 23 Mar 2015 18:23:08 +0000 (18:23 +0000)]
More missing includes only visible to MSVC.

NFC.

llvm-svn: 232981

9 years agoAdd missing include that MSVC complains about.
Benjamin Kramer [Mon, 23 Mar 2015 18:19:41 +0000 (18:19 +0000)]
Add missing include that MSVC complains about.

Also reorder includes a bit, NFC.

llvm-svn: 232980

9 years agoAdd a missing null pointer check in CommandObjectThread.cpp.
Stephane Sezer [Mon, 23 Mar 2015 18:15:07 +0000 (18:15 +0000)]
Add a missing null pointer check in CommandObjectThread.cpp.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 232979

9 years agoImplement fast_distance builtin
Tom Stellard [Mon, 23 Mar 2015 18:10:04 +0000 (18:10 +0000)]
Implement fast_distance builtin

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 232978

9 years agoImplement fast_length builtin
Tom Stellard [Mon, 23 Mar 2015 18:10:02 +0000 (18:10 +0000)]
Implement fast_length builtin

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 232977

9 years agoPurge unused includes throughout libSupport.
Benjamin Kramer [Mon, 23 Mar 2015 18:07:13 +0000 (18:07 +0000)]
Purge unused includes throughout libSupport.

NFC.

llvm-svn: 232976

9 years agoExplicitly include raw_ostream.h instead of relying on transitive inclusion.
Benjamin Kramer [Mon, 23 Mar 2015 18:05:43 +0000 (18:05 +0000)]
Explicitly include raw_ostream.h instead of relying on transitive inclusion.

NFC.

llvm-svn: 232975

9 years agoRely on Makefile.rules in lldb/test/driver/batch_mode.
Zachary Turner [Mon, 23 Mar 2015 18:00:07 +0000 (18:00 +0000)]
Rely on Makefile.rules in lldb/test/driver/batch_mode.

This was hardcoding some make rules instead of relying on
Makefile.rules, which was causing some of the logic to be
incorrect for Windows.

Patch by: Adrian McCarthy
Differential Revision: http://reviews.llvm.org/D8363

llvm-svn: 232974

9 years agoRemove non-standard Environment header section
Ed Maste [Mon, 23 Mar 2015 17:57:42 +0000 (17:57 +0000)]
Remove non-standard Environment header section

llvm-svn: 232973

9 years ago[sanitizer] Fix file access modes in SanitizerCommon.InternalMmapWithOffset and Sanit...
Alexander Potapenko [Mon, 23 Mar 2015 17:55:19 +0000 (17:55 +0000)]
[sanitizer] Fix file access modes in SanitizerCommon.InternalMmapWithOffset and SanitizerCommon.FileOps

llvm-svn: 232972

9 years ago[CodeGen] Properly support the half FP type with non-native operations.
Ahmed Bougacha [Mon, 23 Mar 2015 17:54:16 +0000 (17:54 +0000)]
[CodeGen] Properly support the half FP type with non-native operations.

On AArch64, the -fallow-half-args-and-returns option is the default.
With it, the half type is considered legal (rather than the i16 used
normally for __fp16), but no operation is, except conversions and
load/stores and such.

The previous behavior was tantamount to saying LangOpts.NativeHalfType
was implied by LangOpts.HalfArgsAndReturns, which isn't true.
Instead, teach the various parts of CodeGen that already know about
half (using the intrinsics or not) about this weird in-between case,
where the "half" type is legal, but operations on it aren't.

This is a smaller intermediate step to the end-goal of removing the
intrinsic, always using "half", and letting the backend legalize.

Builds on r232968.
rdar://20045970, rdar://17468714
Differential Revision: http://reviews.llvm.org/D8367

llvm-svn: 232971

9 years agoUse .so library extension by default if platform is not Windows or Darwin
Ed Maste [Mon, 23 Mar 2015 17:52:38 +0000 (17:52 +0000)]
Use .so library extension by default if platform is not Windows or Darwin

llvm-svn: 232970

9 years agoFix whitespace in finishSwigWrapperClasses.py
Ed Maste [Mon, 23 Mar 2015 17:52:10 +0000 (17:52 +0000)]
Fix whitespace in finishSwigWrapperClasses.py

- replace hard tabs with 4-space indents
- delete EOL whitespace

llvm-svn: 232969

9 years ago[CodeGen] Convert double -> __fp16 in one step.
Ahmed Bougacha [Mon, 23 Mar 2015 17:48:07 +0000 (17:48 +0000)]
[CodeGen] Convert double -> __fp16 in one step.

Fix the CodeGen so that for types bigger than float, instead of
converting to fp16 via the sequence "InTy -> float -> fp16", we
perform conversions in just one step.  This avoids the double
rounding which potentially changes results from a natural
IEEE-754 operation.

rdar://17594379, rdar://17468714
Differential Revision: http://reviews.llvm.org/D4602
Part of: http://reviews.llvm.org/D8367

llvm-svn: 232968

9 years ago[AArch64] Enable rematerialization of float 0 values.
Chad Rosier [Mon, 23 Mar 2015 17:19:34 +0000 (17:19 +0000)]
[AArch64] Enable rematerialization of float 0 values.

Patch by Geoff Berry<gberry@codeaurora.org>.

llvm-svn: 232967

9 years agoDo not assert on POSIXDYLD double-eAdd.
Stephane Sezer [Mon, 23 Mar 2015 17:05:41 +0000 (17:05 +0000)]
Do not assert on POSIXDYLD double-eAdd.

Summary:
This has been discovered while experimenting with the gecko linker on android.
In general, assert()'ing on "user input" is a bad idea.

Test Plan: Run unit tests.

Reviewers: clayborg, tfiala

Subscribers: lldb-commits

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

llvm-svn: 232966

9 years agoImplement half_sqrt builtin v2
Tom Stellard [Mon, 23 Mar 2015 17:01:37 +0000 (17:01 +0000)]
Implement half_sqrt builtin v2

This is a generic implementation which just calls sqrt.  Targets should
override this if they want a faster implementation.

v2:
  - Alphabetize SOURCES

llvm-svn: 232965

9 years agoImplement distance builtin v2
Tom Stellard [Mon, 23 Mar 2015 17:01:35 +0000 (17:01 +0000)]
Implement distance builtin v2

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

v2:
  - Remove unnecessary copyright.

llvm-svn: 232964

9 years agoFix implementation of length builtin v2
Tom Stellard [Mon, 23 Mar 2015 17:01:33 +0000 (17:01 +0000)]
Fix implementation of length builtin v2

v2:
  - Move common code into a macro
  - Use the same constant for all vector types.

llvm-svn: 232963

9 years agoRevert "[ARM] Add more pattern matching for f16 <-> f64 conversions"
Bradley Smith [Mon, 23 Mar 2015 16:52:52 +0000 (16:52 +0000)]
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

9 years agoSimplify boolean expressions with true and false using clang-tidy
Eli Bendersky [Mon, 23 Mar 2015 16:26:23 +0000 (16:26 +0000)]
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

9 years agoAdd __clc_ prefix to functions in sincos_helpers.cl
Tom Stellard [Mon, 23 Mar 2015 16:20:24 +0000 (16:20 +0000)]
Add __clc_ prefix to functions in sincos_helpers.cl

This will help avoid naming conflicts with functions defined in
kernels linking with libclc.

llvm-svn: 232960

9 years agoShorten executable name in WatchpointLLDBCommandTestCase
Tamas Berghammer [Mon, 23 Mar 2015 16:17:47 +0000 (16:17 +0000)]
Shorten executable name in WatchpointLLDBCommandTestCase

It is required because the name of the executable exceeded the maximum
allowed file name on android.

llvm-svn: 232959

9 years ago[ARM] Remove target-specific ITOFP/FPTOI nodes
James Molloy [Mon, 23 Mar 2015 16:15:16 +0000 (16:15 +0000)]
[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

9 years agoR600/SI: Fix crash in SIInstrInfo::areLoadsFromSameBasePtr()
Tom Stellard [Mon, 23 Mar 2015 16:06:01 +0000 (16:06 +0000)]
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

9 years agoOpenMPClause.h: Fix typo in \param. [-Wdocumentation]
NAKAMURA Takumi [Mon, 23 Mar 2015 16:05:50 +0000 (16:05 +0000)]
OpenMPClause.h: Fix typo in \param. [-Wdocumentation]

llvm-svn: 232956

9 years ago[Hexagon] Simplify boolean expression
Colin LeMahieu [Mon, 23 Mar 2015 16:01:03 +0000 (16:01 +0000)]
[Hexagon] Simplify boolean expression

Patch by Richard
http://reviews.llvm.org/D8523

llvm-svn: 232955

9 years ago[ARM] Add more pattern matching for f16 <-> f64 conversions
Bradley Smith [Mon, 23 Mar 2015 15:59:54 +0000 (15:59 +0000)]
[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

9 years agoFix the CMake shared build.
Benjamin Kramer [Mon, 23 Mar 2015 15:55:00 +0000 (15:55 +0000)]
Fix the CMake shared build.

The ELF backends now depend on lld::script::Sema, which is in libReaderWriter.
Link it explicitly.

llvm-svn: 232953

9 years agoRemove virtual and add override to all virtual functions in Process/gdb-remote.
Tamas Berghammer [Mon, 23 Mar 2015 15:50:03 +0000 (15:50 +0000)]
Remove virtual and add override to all virtual functions in Process/gdb-remote.

llvm-svn: 232952

9 years agoFix ObjCDataFormatterTestCase.test_nsdate_* tests (ver. 2)
Ilia K [Mon, 23 Mar 2015 14:22:27 +0000 (14:22 +0000)]
Fix ObjCDataFormatterTestCase.test_nsdate_* tests (ver. 2)

This commit reverts r232946 because it caused an another error with absolute time.

llvm-svn: 232951

9 years agoConvert CRLF to LF in CODE_OWNERS.txt
Ilia K [Mon, 23 Mar 2015 14:00:54 +0000 (14:00 +0000)]
Convert CRLF to LF in CODE_OWNERS.txt

llvm-svn: 232950

9 years ago[gcov] Move formatBranchInfo into an anonymous namespace.
Benjamin Kramer [Mon, 23 Mar 2015 13:59:13 +0000 (13:59 +0000)]
[gcov] Move formatBranchInfo into an anonymous namespace.

NFC.

llvm-svn: 232949

9 years agoMake helpers static. clang-tools edition.
Benjamin Kramer [Mon, 23 Mar 2015 12:49:15 +0000 (12:49 +0000)]
Make helpers static. clang-tools edition.

Also purge dead code found by it. NFC.

llvm-svn: 232948

9 years ago[tooling] Move ArgumentsAdjustingCompilations into an anonymous namespace.
Benjamin Kramer [Mon, 23 Mar 2015 12:47:15 +0000 (12:47 +0000)]
[tooling] Move ArgumentsAdjustingCompilations into an anonymous namespace.

NFC.

llvm-svn: 232947

9 years agoFix ObjCDataFormatterTestCase.test_nsdate_* tests
Ilia K [Mon, 23 Mar 2015 12:44:54 +0000 (12:44 +0000)]
Fix ObjCDataFormatterTestCase.test_nsdate_* tests

The time/date strings (like "6pm April 10, 1985") are interpreted as a local time but CFDateGetAbsoluteTime() returns time in UTC. It caused a problem when local time was UTC+0100 or more (0200, 0300 etc.):
```
======================================================================
FAIL: test_nsdate_with_dsym_and_run_command (TestDataFormatterObjC.ObjCDataFormatterTestCase)
    Test formatters for NSDate.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 462, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py", line 157, in test_nsdate_with_dsym_and_run_command
    self.appkit_tester_impl(self.buildDsym,self.nsdate_data_formatter_commands)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py", line 34, in appkit_tester_impl
    commands()
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py", line 475, in nsdate_data_formatter_commands
    substrs = ['1985-04','2011-01'])
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2146, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : '2011-01' returns expected result
Config=x86_64-clang
======================================================================
FAIL: test_nsdate_with_dwarf_and_run_command (TestDataFormatterObjC.ObjCDataFormatterTestCase)
    Test formatters for NSDate.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 479, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py", line 163, in test_nsdate_with_dwarf_and_run_command
    self.appkit_tester_impl(self.buildDwarf,self.nsdate_data_formatter_commands)
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py", line 34, in appkit_tester_impl
    commands()
  File "/Users/IliaK/p/llvm/tools/lldb/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py", line 475, in nsdate_data_formatter_commands
    substrs = ['1985-04','2011-01'])
  File "/Users/IliaK/p/llvm/tools/lldb/test/lldbtest.py", line 2146, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : '2011-01' returns expected result
Config=x86_64-clang
```

llvm-svn: 232946

9 years agoMove private classes into anonymous namespaces
Benjamin Kramer [Mon, 23 Mar 2015 12:31:05 +0000 (12:31 +0000)]
Move private classes into anonymous namespaces

Also merge anonymous namespaces in Targets.cpp a bit. NFC.

llvm-svn: 232945

9 years agoMove private classes into anonymous namespaces
Benjamin Kramer [Mon, 23 Mar 2015 12:30:58 +0000 (12:30 +0000)]
Move private classes into anonymous namespaces

NFC.

llvm-svn: 232944

9 years agoFix sign extension for MIPS64 in makeLibCall function
Petar Jovanovic [Mon, 23 Mar 2015 12:28:13 +0000 (12:28 +0000)]
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

9 years ago[ARM] Fix entry point for Thumb code
Denis Protivensky [Mon, 23 Mar 2015 11:38:24 +0000 (11:38 +0000)]
[ARM] Fix entry point for Thumb code

Test cases for both entry functions in ARM and Thumb
code are added.

llvm-svn: 232942

9 years ago[aarch64] Distinguish the 'Q' and 'm' inline assembly memory constraints.
Daniel Sanders [Mon, 23 Mar 2015 11:33:15 +0000 (11:33 +0000)]
[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

9 years agohandle armeb/thumb/thumbeb consistently in gnutools::Assemble::ConstructJob
Scott Douglass [Mon, 23 Mar 2015 10:54:24 +0000 (10:54 +0000)]
handle armeb/thumb/thumbeb consistently in gnutools::Assemble::ConstructJob

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

llvm-svn: 232940

9 years agoConvert cascading if-else-if to switch. NFC
Scott Douglass [Mon, 23 Mar 2015 10:46:28 +0000 (10:46 +0000)]
Convert cascading if-else-if to switch. NFC

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

llvm-svn: 232939

9 years ago[ELF] Add missing override keyword
Simon Atanasyan [Mon, 23 Mar 2015 10:33:46 +0000 (10:33 +0000)]
[ELF] Add missing override keyword

No functional changes.

llvm-svn: 232938

9 years ago[libsanitizer] Fix OpenFile() usage in TSan and DFSan.
Alexander Potapenko [Mon, 23 Mar 2015 10:32:28 +0000 (10:32 +0000)]
[libsanitizer] Fix OpenFile() usage in TSan and DFSan.
This is a follow-up for r232936.

llvm-svn: 232937

9 years ago[ASan] Distinguish between read, write and read-write file access modes in OpenFile.
Alexander Potapenko [Mon, 23 Mar 2015 10:10:46 +0000 (10:10 +0000)]
[ASan] Distinguish between read, write and read-write file access modes in OpenFile.
This is to fix mapping coverage files into memory on OSX.

llvm-svn: 232936

9 years ago[SDAG] Don't widen VSETCC during type legalization for split operands
Hal Finkel [Mon, 23 Mar 2015 08:22:43 +0000 (08:22 +0000)]
[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

9 years agoDrop -polly-vectorizer-unroll-only option
Tobias Grosser [Mon, 23 Mar 2015 07:00:36 +0000 (07:00 +0000)]
Drop -polly-vectorizer-unroll-only option

This options was earlier used for experiments with the vectorizer, but to my
knowledge is not really used anymore. If anybody needs this, we can always
reintroduce this feature.

llvm-svn: 232934

9 years ago[OPENMP] Fixed test for 'single' directive codegen.
Alexey Bataev [Mon, 23 Mar 2015 06:40:37 +0000 (06:40 +0000)]
[OPENMP] Fixed test for 'single' directive codegen.

llvm-svn: 232933

9 years ago[OPENMP] Codegen for 'copyprivate' clause ('single' directive).
Alexey Bataev [Mon, 23 Mar 2015 06:18:07 +0000 (06:18 +0000)]
[OPENMP] Codegen for 'copyprivate' clause ('single' directive).

If there is at least one 'copyprivate' clause is associated with the single directive, the following code is generated:

```
i32 did_it = 0;                                  \\ for 'copyprivate' clause
if(__kmpc_single(ident_t *, gtid)) {
  SingleOpGen();
  __kmpc_end_single(ident_t *, gtid);
  did_it = 1;                                    \\ for 'copyprivate' clause
}
<copyprivate_list>[0] = &var0;
...
<copyprivate_list>[n] = &varn;
call __kmpc_copyprivate(ident_t *, gtid, <copyprivate_list_size>,
                        <copyprivate_list>, <copy_func>, did_it);

...

void<copy_func>(void *LHSArg, void *RHSArg) {
  Dst = (void * [n])(LHSArg);
  Src = (void * [n])(RHSArg);
  Dst[0] = Src[0];
  ... Dst[n] = Src[n];
}
```
All list items from all 'copyprivate' clauses are gathered into single <copyprivate list> (<copyprivate_list_size> is a size in bytes of this list) and <copy_func> is used to propagate values of private or threadprivate variables from the 'single' region to other implicit threads from outer 'parallel' region.
Differential Revision: http://reviews.llvm.org/D8410

llvm-svn: 232932

9 years ago[Orc] Add missing -use-orcmcjit flag to a number of Orc regression tests.
Lang Hames [Mon, 23 Mar 2015 06:02:49 +0000 (06:02 +0000)]
[Orc] Add missing -use-orcmcjit flag to a number of Orc regression tests.

llvm-svn: 232931

9 years agoRevert "Add CodeGen support for adding cpu attributes on functions based on"
Daniel Jasper [Mon, 23 Mar 2015 05:52:28 +0000 (05:52 +0000)]
Revert "Add CodeGen support for adding cpu attributes on functions based on"

This breaks CodeGen for an internal target. I'll get repro instructions
to you.

llvm-svn: 232930

9 years agoFix typo 'AVX too' instead of 'AVX2'
Craig Topper [Mon, 23 Mar 2015 04:17:11 +0000 (04:17 +0000)]
Fix typo 'AVX too' instead of 'AVX2'

llvm-svn: 232929

9 years ago[modules] Remove redundant import of lexical decls when building a lookup table
Richard Smith [Mon, 23 Mar 2015 03:25:59 +0000 (03:25 +0000)]
[modules] Remove redundant import of lexical decls when building a lookup table
for a DeclContext, and fix propagation of exception specifications along
redeclaration chains.

This reverts r232905, r232907, and r232907, which reverted r232793, r232853,
and r232853.

One additional change is present here to resolve issues with LLDB: distinguish
between whether lexical decls missing from the lookup table are local or are
provided by the external AST source, and still look in the external source if
that's where they came from.

llvm-svn: 232928

9 years ago[X86] Add one stepping of Broadwell to the CPU name autodetection for march=native.
Craig Topper [Mon, 23 Mar 2015 00:15:06 +0000 (00:15 +0000)]
[X86] Add one stepping of Broadwell to the CPU name autodetection for march=native.

llvm-svn: 232927

9 years agoUse POSIX pid_t and not lldb::pid_t.
Davide Italiano [Sun, 22 Mar 2015 23:43:58 +0000 (23:43 +0000)]
Use POSIX pid_t and not lldb::pid_t.

The latter is uint64_t beacuse lldb supports arbitrary pid/platforms
but in this case we're using it as return value for fork() which might
return -1 to the parent in case the syscall fails.

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

llvm-svn: 232926

9 years agoAdd missing #include to fix libc++ Linux build.
Richard Smith [Sun, 22 Mar 2015 23:18:46 +0000 (23:18 +0000)]
Add missing #include to fix libc++ Linux build.

llvm-svn: 232925

9 years ago[ASTMatchers] Factor wrapping matcher classes into a common base class.
Benjamin Kramer [Sun, 22 Mar 2015 21:57:53 +0000 (21:57 +0000)]
[ASTMatchers] Factor wrapping matcher classes into a common base class.

The deduplication here is negligible, but it allows the compiler to
skip emission of many templated base class destructors. Shrinks
clang-query by 53k. No functionality change intended.

llvm-svn: 232924

9 years agoSilence a GCC warning
David Majnemer [Sun, 22 Mar 2015 21:27:10 +0000 (21:27 +0000)]
Silence a GCC warning

llvm-svn: 232923

9 years agoFoldingSet: Make FoldingSetImpl's dtor protected and non-virtual
Benjamin Kramer [Sun, 22 Mar 2015 18:22:33 +0000 (18:22 +0000)]
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

9 years ago[Analyzer] Don't inherit from FoldingSet.
Benjamin Kramer [Sun, 22 Mar 2015 18:16:22 +0000 (18:16 +0000)]
[Analyzer] Don't inherit from FoldingSet.

That's not really necessary here. NFCI.

llvm-svn: 232921

9 years agoFix a flaky heap-overflow-large.cc test
Kuba Brecka [Sun, 22 Mar 2015 18:00:58 +0000 (18:00 +0000)]
Fix a flaky heap-overflow-large.cc test

Reviewed at http://reviews.llvm.org/D8515

llvm-svn: 232920

9 years ago[Mips] Pass type of relocation and addendum to the `calculateRelocation`
Simon Atanasyan [Sun, 22 Mar 2015 16:35:08 +0000 (16:35 +0000)]
[Mips] Pass type of relocation and addendum to the `calculateRelocation`
separately

This change reduce difference between the trunk and upcoming patch and
simplify the future code review.

No functional changes.

llvm-svn: 232919

9 years agoUpdate unit test for r232916.
Benjamin Kramer [Sun, 22 Mar 2015 16:05:46 +0000 (16:05 +0000)]
Update unit test for r232916.

llvm-svn: 232918

9 years agoPrevent CHECK-NOTs from matching file paths
Duncan P. N. Exon Smith [Sun, 22 Mar 2015 15:58:21 +0000 (15:58 +0000)]
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

9 years ago[multilib] Turn virtual functor into functin_ref
Benjamin Kramer [Sun, 22 Mar 2015 15:56:12 +0000 (15:56 +0000)]
[multilib] Turn virtual functor into functin_ref

And update code to use lambdas where possible, plus random cleanup. NFCI.

llvm-svn: 232916

9 years ago[Mips] Rename template argument ELFType => ELFT
Simon Atanasyan [Sun, 22 Mar 2015 15:41:16 +0000 (15:41 +0000)]
[Mips] Rename template argument ELFType => ELFT

No functional changes.

llvm-svn: 232915

9 years ago[Mips] Use allocator from the base class
Simon Atanasyan [Sun, 22 Mar 2015 15:41:10 +0000 (15:41 +0000)]
[Mips] Use allocator from the base class

No functional changes.

llvm-svn: 232914

9 years agoFixed MSVC compile warning issue introduced in r232837
Simon Pilgrim [Sun, 22 Mar 2015 13:38:36 +0000 (13:38 +0000)]
Fixed MSVC compile warning issue introduced in r232837

- was reporting 'warning C4715: 'getType32' : not all control paths return a value'

llvm-svn: 232913

9 years agoAdd a dump function to Stmt that takes only an output stream. No functionality change.
Faisal Vali [Sun, 22 Mar 2015 13:35:56 +0000 (13:35 +0000)]
Add a dump function to Stmt that takes only an output stream.  No functionality change.

This allows dumping to any given output stream but without requiring a SourceManager, similar to the interface provided by Decl.

It's useful when writing certain generic debug functions, external to the clang code base (for e.g.).

llvm-svn: 232912

9 years agoUse schedule trees to perform post-scheduling transformations
Tobias Grosser [Sun, 22 Mar 2015 12:06:39 +0000 (12:06 +0000)]
Use schedule trees to perform post-scheduling transformations

Replacing the old band_tree based code with code that is based on the new
schedule tree [1] interface makes applying complex schedule transformations a lot
more straightforward. We now do not need to reason about the meaning of flat
schedules, but can use a more straightforward tree structure. We do not yet
exploit this a lot in the current code, but hopefully we will be able to do so
soon.

This change also allows us to drop some code, as isl now provides some higher
level interfaces to apply loop transformations such as tiling.

This change causes some small test case changes as isl uses a slightly different
way to perform loop tiling, but no significant functional changes are intended.

[1] http://impact.gforge.inria.fr/impact2014/papers/impact2014-verdoolaege.pdf

llvm-svn: 232911

9 years agoDemangling for DlAddrSymbolizer
Kuba Brecka [Sun, 22 Mar 2015 11:38:55 +0000 (11:38 +0000)]
Demangling for DlAddrSymbolizer

On OS X, dladdr() provides mangled names only, so we need need to demangle in
DlAddrSymbolizer::SymbolizePC.

Reviewed at http://reviews.llvm.org/D8291

llvm-svn: 232910

9 years agoRemove empty files left behind by r232907.
Benjamin Kramer [Sun, 22 Mar 2015 10:08:31 +0000 (10:08 +0000)]
Remove empty files left behind by r232907.

llvm-svn: 232909

9 years agoAdd AtosSymbolizer and DlAddrSymbolizer as fallbacks for OS X
Kuba Brecka [Sun, 22 Mar 2015 10:02:50 +0000 (10:02 +0000)]
Add AtosSymbolizer and DlAddrSymbolizer as fallbacks for OS X

This patch changes the symbolizer chain on OS X (which currently only uses 1
symbolizer at most) to use this behavior:

* By default, use LLVMSymbolizer -> DlAddrSymbolizer.
* If the llvm-symbolizer binary is not found, use AtosSymbolizer
    -> DlAddrSymbolizer.
* If the user specifies ASAN_SYMBOLIZER_PATH=.../atos, then use AtosSymbolizer
    -> DlAddrSymbolizer.
* If neither llvm-symbolizer or atos is found, or external symbolication is
    disabled with ASAN_SYMBOLIZER_PATH="", use DlAddrSymbolizer.

Reviewed at http://reviews.llvm.org/D8285

llvm-svn: 232908

9 years agoReverting 232853 and 232870 because they depend on 232793,
Vince Harron [Sun, 22 Mar 2015 08:47:07 +0000 (08:47 +0000)]
Reverting 232853 and 232870 because they depend on 232793,
which was reverted because it was causing LLDB test failures

llvm-svn: 232907

9 years agoMS ABI: Implement driver-level support for thread-safe statics
David Majnemer [Sun, 22 Mar 2015 08:39:22 +0000 (08:39 +0000)]
MS ABI: Implement driver-level support for thread-safe statics

Decide whether or not to use thread-safe statics depending on whether or
not we have an explicit request from the driver.  If we don't have an
explicit request, infer which behavior to use depending on the
compatibility version we are targeting.

N.B. CodeGen support is still ongoing.

llvm-svn: 232906

9 years agoReverting r232793 until some new LLDB failures are discussed
Vince Harron [Sun, 22 Mar 2015 05:59:59 +0000 (05:59 +0000)]
Reverting r232793 until some new LLDB failures are discussed

llvm-svn: 232905