platform/upstream/llvm.git
9 years ago[Hexagon] Use single tailcall pseudoinst and fix checking for label jumping versus...
Colin LeMahieu [Mon, 9 Mar 2015 22:05:21 +0000 (22:05 +0000)]
[Hexagon] Use single tailcall pseudoinst and fix checking for label jumping versus tail calling.

llvm-svn: 231713

9 years agoRevert "Revert "[UBSan] Add testcases for -fsanitize=shift-base and -fsanitize=shift...
Alexey Samsonov [Mon, 9 Mar 2015 21:50:40 +0000 (21:50 +0000)]
Revert "Revert "[UBSan] Add testcases for -fsanitize=shift-base and -fsanitize=shift-exponent.""

Re-land r231151 now that -fsanitize=shift-base implementation should not
introduce undefined behavior.

llvm-svn: 231712

9 years ago[UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent.
Alexey Samsonov [Mon, 9 Mar 2015 21:50:19 +0000 (21:50 +0000)]
[UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent.

This is a recommit of r231150, reverted in r231409. Turns out
that -fsanitize=shift-base check implementation only works if the
shift exponent is valid, otherwise it contains undefined behavior
itself.

Make sure we check that exponent is valid before we proceed to
check the base. Make sure that we actually report invalid values
of base or exponent if -fsanitize=shift-base or
-fsanitize=shift-exponent is specified, respectively.

llvm-svn: 231711

9 years ago[Hexagon] Reapply r231699. Remove assumption that second operand is an immediate...
Colin LeMahieu [Mon, 9 Mar 2015 21:48:13 +0000 (21:48 +0000)]
[Hexagon] Reapply r231699.  Remove assumption that second operand is an immediate when checking if A2_tfrsi is combinable.

llvm-svn: 231710

9 years ago[SCEV] Unify getUnsignedRange and getSignedRange
Sanjoy Das [Mon, 9 Mar 2015 21:43:43 +0000 (21:43 +0000)]
[SCEV] Unify getUnsignedRange and getSignedRange

Summary:
This removes some duplicated code, and also helps optimization: e.g. in
the test case added, `%idx ULT 128` in `@x` is not currently optimized
to `true` by `-indvars` but will be, after this change.

The only functional change in ths commit is that for add recurrences,
ScalarEvolution::getRange will be more aggressive -- computing the
unsigned (resp. signed) range for a SCEVAddRecExpr will now look at the
NSW (resp. NUW) bits and check for signed (resp. unsigned) overflow.
This can be a strict improvement in some cases (such as the attached
test case), and should be no worse in other cases.

Reviewers: atrick, nlewycky

Subscribers: llvm-commits

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

llvm-svn: 231709

9 years ago[SCEV] Add a `scalar-evolution-print-constant-ranges' option
Sanjoy Das [Mon, 9 Mar 2015 21:43:39 +0000 (21:43 +0000)]
[SCEV] Add a `scalar-evolution-print-constant-ranges' option

Summary:
Unused in this commit, but will be used in a subsequent change (D8142)
by a FileCheck test.

Reviewers: atrick

Subscribers: llvm-commits

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

llvm-svn: 231708

9 years ago[LinkerScript] Implement linker script expression evaluation
Rafael Auler [Mon, 9 Mar 2015 21:43:35 +0000 (21:43 +0000)]
[LinkerScript] Implement linker script expression evaluation

The expression evaluation is needed when interpreting linker scripts, in order
to calculate the value for new symbols or to determine a new position to load
sections in memory. This commit extends Expression nodes from the linker script
AST with evaluation functions, and also contains a unit test.

http://reviews.llvm.org/D8156

llvm-svn: 231707

9 years agoARM: use ABI-specified alignment for byval parameters.
Tim Northover [Mon, 9 Mar 2015 21:40:42 +0000 (21:40 +0000)]
ARM: use ABI-specified alignment for byval parameters.

When passing a type with large alignment byval, we were specifying the type's
alignment rather than the alignment that the backend is actually capable of
producing (ABIAlign).

This would be OK (if odd) assuming the backend dealt with it prooperly,
unfortunately it doesn't and trying to pass types with "byval align 16" can
cause it to set fp incorrectly and trash the stack during the prologue. I'll be
fixing that in a separate patch, but Clang should still be emitting IR that's
as close to its intent as possible.

rdar://20059039

llvm-svn: 231706

9 years agoFix another -Wunused-local-typedef warning in include/__tree.
Dimitry Andric [Mon, 9 Mar 2015 21:39:02 +0000 (21:39 +0000)]
Fix another -Wunused-local-typedef warning in include/__tree.

The _Pp typedef in __tree<_Tp, _Compare, _Allocator>::__count_multi()
isn't used anywhere, so adding _LIBCPP_UNUSED is unecessary.

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

llvm-svn: 231705

9 years agoMove test to use correct suffix
Eric Fiselier [Mon, 9 Mar 2015 21:30:48 +0000 (21:30 +0000)]
Move test to use correct suffix

llvm-svn: 231704

9 years ago[Hexagon] Reverting r231699
Colin LeMahieu [Mon, 9 Mar 2015 21:19:02 +0000 (21:19 +0000)]
[Hexagon] Reverting r231699

llvm-svn: 231703

9 years agoDwarfAccelTable: fix obvious typo.
Frederic Riss [Mon, 9 Mar 2015 21:09:50 +0000 (21:09 +0000)]
DwarfAccelTable: fix obvious typo.

I have a test for that issue, but I didn't include it in the commit as it's
a 200KB file for a pretty minor issue. (The reason the file is so big is
that it needs > 1024 variables/functions to trigger and that with debug
information.

The issue/fix on the other side is totally trivial. If poeple want the test
commited, I can do that. It just didn't seem worth it to me.

llvm-svn: 231701

9 years ago[PATCH Sema Objective-C]. Patch to warn on missing designated initializer
Fariborz Jahanian [Mon, 9 Mar 2015 20:39:51 +0000 (20:39 +0000)]
[PATCH Sema Objective-C]. Patch to warn on missing designated initializer
override where at least a declaration of a designated initializer is in a super
class and not necessarily in the current class. rdar://19653785.

llvm-svn: 231700

9 years ago[Hexagon] Updating constant set to simpler versions.
Colin LeMahieu [Mon, 9 Mar 2015 20:33:12 +0000 (20:33 +0000)]
[Hexagon] Updating constant set to simpler versions.

llvm-svn: 231699

9 years agoTableGen: Use 'enum : uint64_t' for feature flags to fix -Wmicrosoft
Reid Kleckner [Mon, 9 Mar 2015 20:23:14 +0000 (20:23 +0000)]
TableGen: Use 'enum : uint64_t' for feature flags to fix -Wmicrosoft

clang-cl would warn that this value is not representable in 'int':
  enum { FeatureX = 1ULL << 31 };
All MS enums are 'ints' unless otherwise specified, so we have to use an
explicit type.  The AMDGPU target just hit 32 features, triggering this
warning.

Now that we have C++11 strong enum types, we can also eliminate the
'const uint64_t' codepath from tablegen and just use 'enum : uint64_t'.

llvm-svn: 231697

9 years agoRemove the remaining uses of abs64 and nuke it.
Benjamin Kramer [Mon, 9 Mar 2015 20:20:16 +0000 (20:20 +0000)]
Remove the remaining uses of abs64 and nuke it.

std::abs works just fine and we're already using it in many places. NFC intended.

llvm-svn: 231696

9 years ago[Hexagon] Removing old halfword codegen instructions and updating const32/64 splitting.
Colin LeMahieu [Mon, 9 Mar 2015 20:11:02 +0000 (20:11 +0000)]
[Hexagon] Removing old halfword codegen instructions and updating const32/64 splitting.

llvm-svn: 231695

9 years agoDon't prime the section map.
Rafael Espindola [Mon, 9 Mar 2015 20:09:58 +0000 (20:09 +0000)]
Don't prime the section map.

This was just creating unused labels for .text when the module had no
functions.

llvm-svn: 231694

9 years ago[Hexagon] Eliminating immediate condition set.
Colin LeMahieu [Mon, 9 Mar 2015 19:57:18 +0000 (19:57 +0000)]
[Hexagon] Eliminating immediate condition set.

llvm-svn: 231693

9 years agoFix debugserver warnings on MacOSX.
Greg Clayton [Mon, 9 Mar 2015 19:45:23 +0000 (19:45 +0000)]
Fix debugserver warnings on MacOSX.

llvm-svn: 231692

9 years agoUnwind: define more interfaces more often
Saleem Abdulrasool [Mon, 9 Mar 2015 19:35:12 +0000 (19:35 +0000)]
Unwind: define more interfaces more often

These are also part of the Unwind interfaces.  However, their implementation is
different in EHABI vs frame tables based exception handling.  Always provide a
definition.  This partially undoes a movement change from earlier to make the
handling a bit simpler rather than grouping the two implementations together.

llvm-svn: 231690

9 years ago[Hexagon] Removing TFR_condset_ir/TFR_condset_ri modeling.
Colin LeMahieu [Mon, 9 Mar 2015 19:31:25 +0000 (19:31 +0000)]
[Hexagon] Removing TFR_condset_ir/TFR_condset_ri modeling.

llvm-svn: 231689

9 years agoRemove dead code.
Rui Ueyama [Mon, 9 Mar 2015 18:59:55 +0000 (18:59 +0000)]
Remove dead code.

llvm-svn: 231688

9 years ago[Hexagon] Changing AddrFI back to ADDRri to address test issue.
Colin LeMahieu [Mon, 9 Mar 2015 18:57:33 +0000 (18:57 +0000)]
[Hexagon] Changing AddrFI back to ADDRri to address test issue.

llvm-svn: 231687

9 years agoInstrProf: Use the proftext format for these coverage tests
Justin Bogner [Mon, 9 Mar 2015 18:54:58 +0000 (18:54 +0000)]
InstrProf: Use the proftext format for these coverage tests

This format's easier to understand and update by hand.

llvm-svn: 231686

9 years agoInstrProf: Allow hexadecimal function hashes in proftext format
Justin Bogner [Mon, 9 Mar 2015 18:54:49 +0000 (18:54 +0000)]
InstrProf: Allow hexadecimal function hashes in proftext format

llvm-svn: 231685

9 years agoR600/SI: Move gds operand to the end of operand list
Tom Stellard [Mon, 9 Mar 2015 18:49:54 +0000 (18:49 +0000)]
R600/SI: Move gds operand to the end of operand list

Also print it in the assembly string.

llvm-svn: 231684

9 years agoR600/SI: Refactor DS instruction defs
Tom Stellard [Mon, 9 Mar 2015 18:49:45 +0000 (18:49 +0000)]
R600/SI: Refactor DS instruction defs

llvm-svn: 231683

9 years agoDelete dead code. NFC.
Rafael Espindola [Mon, 9 Mar 2015 18:48:29 +0000 (18:48 +0000)]
Delete dead code. NFC.

llvm-svn: 231682

9 years agoAdd support for Nuxi CloudABI.
Ed Schouten [Mon, 9 Mar 2015 18:40:45 +0000 (18:40 +0000)]
Add support for Nuxi CloudABI.

CloudABI is a POSIX-like runtime environment built around the concept of
capability-based security. More details:

https://github.com/NuxiNL/cloudlibc

CloudABI uses its own ELFOSABI number. This number has been allocated by
the maintainers of ELF a couple of days ago.

Reviewed by: echristo

llvm-svn: 231681

9 years agoSymbolizer refactoring: Merge common parts of POSIXSymbolizer and WinSymbolizer
Kuba Brecka [Mon, 9 Mar 2015 18:36:28 +0000 (18:36 +0000)]
Symbolizer refactoring: Merge common parts of POSIXSymbolizer and WinSymbolizer

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

llvm-svn: 231680

9 years agoDrop the hacks used for partial C99 math libraries.
Benjamin Kramer [Mon, 9 Mar 2015 18:35:18 +0000 (18:35 +0000)]
Drop the hacks used for partial C99 math libraries.

All supported platforms have half-way decent C99 support.

llvm-svn: 231679

9 years ago[Hexagon] Adding PackHL nodes and some missing modeling instructions and patterns
Colin LeMahieu [Mon, 9 Mar 2015 18:34:05 +0000 (18:34 +0000)]
[Hexagon] Adding PackHL nodes and some missing modeling instructions and patterns

llvm-svn: 231678

9 years agoPrint jump tables before exception tables.
Rafael Espindola [Mon, 9 Mar 2015 18:29:12 +0000 (18:29 +0000)]
Print jump tables before exception tables.

In the case where just tables are part of the function section, this produces
more readable assembly by avoiding switching to the eh section and back
to .text.

This would also break with non unique section names, as trying to switch to
a unique section actually creates a new one.

llvm-svn: 231677

9 years agoDon't repeat name in comment. NFC.
Rafael Espindola [Mon, 9 Mar 2015 18:11:42 +0000 (18:11 +0000)]
Don't repeat name in comment. NFC.

llvm-svn: 231676

9 years agoAdd TrackedValue to test/support. Thanks to Louis Dionne
Eric Fiselier [Mon, 9 Mar 2015 18:02:16 +0000 (18:02 +0000)]
Add TrackedValue to test/support. Thanks to Louis Dionne

llvm-svn: 231674

9 years agoRemove dummy method implementations.
Rafael Espindola [Mon, 9 Mar 2015 17:58:49 +0000 (17:58 +0000)]
Remove dummy method implementations.

These are pure virtual in the base class, so the compiler checks that they
are implemented.

llvm-svn: 231673

9 years agoFix an exception-safety bug in <deque>. Reference: PR#22650. Not closing the bug...
Marshall Clow [Mon, 9 Mar 2015 17:08:51 +0000 (17:08 +0000)]
Fix an exception-safety bug in <deque>. Reference: PR#22650. Not closing the bug because there's more work to do here

llvm-svn: 231672

9 years agoRoll functions back into namespaces, msvc has problems with name lookup outside of it.
Benjamin Kramer [Mon, 9 Mar 2015 17:00:48 +0000 (17:00 +0000)]
Roll functions back into namespaces, msvc has problems with name lookup outside of it.

llvm-svn: 231671

9 years agoCorrect doxygen for matcher macros that require a body. NFC.
Alexander Kornienko [Mon, 9 Mar 2015 16:57:49 +0000 (16:57 +0000)]
Correct doxygen for matcher macros that require a body. NFC.

http://reviews.llvm.org/D8146

Patch by Richard Thomson!

llvm-svn: 231670

9 years ago[clang-tidy] Fixed header guards using clang-tidy llvm-header-guard check. NFC.
Alexander Kornienko [Mon, 9 Mar 2015 16:52:33 +0000 (16:52 +0000)]
[clang-tidy] Fixed header guards using clang-tidy llvm-header-guard check. NFC.

The patch was generated using this command:
$ clang-tidy/tool/run-clang-tidy.py -header-filter=.*clang-tidy.* -fix \
    -checks=-*,llvm-header-guard clang-tidy.*
$ svn revert --recursive clangt-tidy/llvm/
(to revert a few buggy fixes)

llvm-svn: 231669

9 years agoMake helper functions static. NFC.
Benjamin Kramer [Mon, 9 Mar 2015 16:47:52 +0000 (16:47 +0000)]
Make helper functions static. NFC.

Found by -Wmissing-prototypes.

llvm-svn: 231668

9 years agoFixed a bug where the expression parser relied on having symbols for things even...
Greg Clayton [Mon, 9 Mar 2015 16:46:57 +0000 (16:46 +0000)]
Fixed a bug where the expression parser relied on having symbols for things even if they were in the debug info.

The issue can happen if you strip your main executable and then run an expression and it would fail to find the stripped symbol and it would then not be able to make the function call. The issue was fixed by doing our normal FindFunctions call.

<rdar://problem/20072750>

llvm-svn: 231667

9 years agoUnwind: always define unwind APIs
Saleem Abdulrasool [Mon, 9 Mar 2015 16:46:43 +0000 (16:46 +0000)]
Unwind: always define unwind APIs

These interfaces are not zero cost related, but rather generic unwind APIs used
by consumers of the Unwind library.  Always provide the definition as they are
needed for both Zero Cost and Frame Table based implementations.

llvm-svn: 231666

9 years agoAdd logical ops to Mips fast-isel
Reed Kotler [Mon, 9 Mar 2015 16:28:10 +0000 (16:28 +0000)]
Add logical ops to Mips fast-isel

Summary:
Code is mostly copied from AArch64 port and modified where needed for Mips.

This handles the "non" legal cases of logical ops. Legal cases are handled by tablegen patterns.

Test Plan:
Make check test logopm.ll

All of test-suite passes at O0/O2 and mips32 r1/r2 with this new change.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: echristo, llvm-commits, aemerson, rfuhler

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

llvm-svn: 231665

9 years agoMake helper functions static.
Benjamin Kramer [Mon, 9 Mar 2015 16:23:46 +0000 (16:23 +0000)]
Make helper functions static.

Found by -Wmissing-prototypes. NFC.

llvm-svn: 231664

9 years agoR600/SI: Fix DS definitions and add missing instructions
Tom Stellard [Mon, 9 Mar 2015 16:03:45 +0000 (16:03 +0000)]
R600/SI: Fix DS definitions and add missing instructions

llvm-svn: 231663

9 years agoR600/SI: Fix opcode for ds_read2_b64 and ds_read2st64_b64
Tom Stellard [Mon, 9 Mar 2015 16:03:39 +0000 (16:03 +0000)]
R600/SI: Fix opcode for ds_read2_b64 and ds_read2st64_b64

llvm-svn: 231662

9 years agoMove unreferenced passes into the cpp file
Benjamin Kramer [Mon, 9 Mar 2015 15:50:58 +0000 (15:50 +0000)]
Move unreferenced passes into the cpp file

NFC.

llvm-svn: 231661

9 years agoSymbolRewriter: Hide implementation details
Benjamin Kramer [Mon, 9 Mar 2015 15:50:47 +0000 (15:50 +0000)]
SymbolRewriter: Hide implementation details

NFC.

llvm-svn: 231660

9 years agoR600/SI: Limit SGPRs to 80 on Tonga and Iceland
Marek Olsak [Mon, 9 Mar 2015 15:48:09 +0000 (15:48 +0000)]
R600/SI: Limit SGPRs to 80 on Tonga and Iceland

This is a candidate for stable.

llvm-svn: 231659

9 years agoR600/SI: Fix getNumSGPRsAllowed for VI
Marek Olsak [Mon, 9 Mar 2015 15:48:00 +0000 (15:48 +0000)]
R600/SI: Fix getNumSGPRsAllowed for VI

llvm-svn: 231658

9 years agoMake helper functions static
Benjamin Kramer [Mon, 9 Mar 2015 15:03:32 +0000 (15:03 +0000)]
Make helper functions static

NFC.

llvm-svn: 231657

9 years agoTooling: Hide implementation details
Benjamin Kramer [Mon, 9 Mar 2015 15:03:26 +0000 (15:03 +0000)]
Tooling: Hide implementation details

NFC.

llvm-svn: 231656

9 years agoInheritViz: Hide implementation details
Benjamin Kramer [Mon, 9 Mar 2015 15:03:20 +0000 (15:03 +0000)]
InheritViz: Hide implementation details

NFC.

llvm-svn: 231655

9 years agoFix line ending in test CodeGen/X86/pr22774.ll. NFC.
Andrea Di Biagio [Mon, 9 Mar 2015 15:02:01 +0000 (15:02 +0000)]
Fix line ending in test CodeGen/X86/pr22774.ll. NFC.

Also, replaced line with 'target triple' with flag -mtriple on the RUN line.
Removed the data layout string as it is not needed.

llvm-svn: 231654

9 years agoHide away implementation details of the ThreadSafetyAnalysis in anonymous namespaces
Benjamin Kramer [Mon, 9 Mar 2015 14:19:54 +0000 (14:19 +0000)]
Hide away implementation details of the ThreadSafetyAnalysis in anonymous namespaces

NFC.

llvm-svn: 231653

9 years agoUpdate PTX generator to latest LLVM changes
Tobias Grosser [Mon, 9 Mar 2015 13:35:19 +0000 (13:35 +0000)]
Update PTX generator to latest LLVM changes

llvm-svn: 231652

9 years agoFix AttachDeniedTestCase on android
Tamas Berghammer [Mon, 9 Mar 2015 13:11:42 +0000 (13:11 +0000)]
Fix AttachDeniedTestCase on android

Failure caused by a missing mkfifo command in the android OS. This fix
replace mkfifo with "mknode p" command on android.

llvm-svn: 231651

9 years ago[clang-tidy] Refactor: Rename clang-tidy readability check files and classes to follo...
Alexander Kornienko [Mon, 9 Mar 2015 12:18:39 +0000 (12:18 +0000)]
[clang-tidy] Refactor: Rename clang-tidy readability check files and classes to follow naming conventions

Classes are named WhateverCheck, files are WhateverCheck.cpp and`
WhateverCheck.h`

http://reviews.llvm.org/D8144

Patch by Richard Thomson!

llvm-svn: 231650

9 years agoAdd CloudABI locale names to platform_support.h.
Ed Schouten [Mon, 9 Mar 2015 12:04:16 +0000 (12:04 +0000)]
Add CloudABI locale names to platform_support.h.

On CloudABI we should append the timezone name to the end of the locale
(e.g., nl_NL.UTF-8@Europe/Amsterdam). By fixing the locale names we can
already let a lot of locale related tests pass.

llvm-svn: 231649

9 years ago[clang-tidy] Refactor: Rename clang-tidy misc check files and classes to follow namin...
Alexander Kornienko [Mon, 9 Mar 2015 11:48:54 +0000 (11:48 +0000)]
[clang-tidy] Refactor: Rename clang-tidy misc check files and classes to follow naming conventions

Classes are named WhateverCheck, files are named WhateverCheck.cpp and
WhateverCheck.h.

http://reviews.llvm.org/D8145

Patch by Richard Thomson!

llvm-svn: 231648

9 years agoAt least on NetBSD, sys/errno.h and errno.h are different, so use the
Joerg Sonnenberger [Mon, 9 Mar 2015 11:23:29 +0000 (11:23 +0000)]
At least on NetBSD, sys/errno.h and errno.h are different, so use the
correct header to get errno.

llvm-svn: 231647

9 years ago[Mips] Remove unused include
Simon Atanasyan [Mon, 9 Mar 2015 10:54:11 +0000 (10:54 +0000)]
[Mips] Remove unused include

No functional changes.

llvm-svn: 231646

9 years ago[Mips] Remove redundant namespace qualifiers
Simon Atanasyan [Mon, 9 Mar 2015 10:54:05 +0000 (10:54 +0000)]
[Mips] Remove redundant namespace qualifiers

No functional changes.

llvm-svn: 231645

9 years ago[Mips] Rename local variables
Simon Atanasyan [Mon, 9 Mar 2015 10:53:58 +0000 (10:53 +0000)]
[Mips] Rename local variables

No functional changes.

llvm-svn: 231644

9 years ago[Mips] Implement R_MIPS_SUB relocation handling
Simon Atanasyan [Mon, 9 Mar 2015 10:53:50 +0000 (10:53 +0000)]
[Mips] Implement R_MIPS_SUB relocation handling

llvm-svn: 231643

9 years ago[Mips] Implement R_MIPS_64 relocation handling
Simon Atanasyan [Mon, 9 Mar 2015 10:53:41 +0000 (10:53 +0000)]
[Mips] Implement R_MIPS_64 relocation handling

llvm-svn: 231642

9 years ago[Mips] Refactoring of relocation handling functions
Simon Atanasyan [Mon, 9 Mar 2015 10:53:32 +0000 (10:53 +0000)]
[Mips] Refactoring of relocation handling functions

1. Move relocation addendum reading code to the MipsRelocationHandler
class to reduce code duplication.
2. Factor out the relocations calculation code into the separate
function to be ready to handle MIPS N64 ABI relocation chains.

No functional changes.

llvm-svn: 231641

9 years ago[Mips] Show error message and stop linking in case of cross mode jump errors
Simon Atanasyan [Mon, 9 Mar 2015 10:53:24 +0000 (10:53 +0000)]
[Mips] Show error message and stop linking in case of cross mode jump errors

llvm-svn: 231640

9 years ago[Mips] Fix incorrect handling of cross mode jumps
Simon Atanasyan [Mon, 9 Mar 2015 10:53:15 +0000 (10:53 +0000)]
[Mips] Fix incorrect handling of cross mode jumps

We should not take in account a type of "source" symbol. Cross mode jump
adjustment is requred when target symbol and relocation belong to
different (regular/microMIPS) instruction sets.

llvm-svn: 231639

9 years agoReport the actual user register count from NativeRegisterContextLinux_x86_64
Tamas Berghammer [Mon, 9 Mar 2015 10:48:23 +0000 (10:48 +0000)]
Report the actual user register count from NativeRegisterContextLinux_x86_64

Thic change have effect wehn the AVX registers aren't available with
reporting the count of user registers without them.

Differential revision: http://reviews.llvm.org/D8111

llvm-svn: 231638

9 years agoFix a menu issue. patch by Vassil Vassilev
Sylvestre Ledru [Mon, 9 Mar 2015 09:09:55 +0000 (09:09 +0000)]
Fix a menu issue. patch by Vassil Vassilev

llvm-svn: 231637

9 years agoclang-format: Don't remove newline if macro ends in access specifier.
Daniel Jasper [Mon, 9 Mar 2015 08:13:55 +0000 (08:13 +0000)]
clang-format: Don't remove newline if macro ends in access specifier.

I.e.:

  #define A public:

  // The new line before this line would be removed.
  int a;

llvm-svn: 231636

9 years agoRevert r231630 - Run LICM pass after loop unrolling pass.
Kevin Qin [Mon, 9 Mar 2015 07:26:37 +0000 (07:26 +0000)]
Revert r231630 - Run LICM pass after loop unrolling pass.

As it broke llvm bootstrap.

llvm-svn: 231635

9 years agoFix a bug in the LLParser where we failed to diagnose landingpads with non-constant...
Owen Anderson [Mon, 9 Mar 2015 07:13:42 +0000 (07:13 +0000)]
Fix a bug in the LLParser where we failed to diagnose landingpads with non-constant clause operands.

Fixing this also exposed a related issue where the landingpad under construction was not
cleaned up when an error was raised, which would cause bad reference errors before the
error could actually be printed.

llvm-svn: 231634

9 years agoShorten user report message slightly
Tobias Grosser [Mon, 9 Mar 2015 06:59:16 +0000 (06:59 +0000)]
Shorten user report message slightly

llvm-svn: 231633

9 years ago[AArch64] Enable partial & runtime unrolling on cortex-a57
Kevin Qin [Mon, 9 Mar 2015 06:14:28 +0000 (06:14 +0000)]
[AArch64] Enable partial & runtime unrolling on cortex-a57

For inner one of nested loops, it is more likely to be a hot loop,
and the runtime check can be promoted out from patch 0001, so the
overhead is less, we can try a doubled threshold to unroll more loops.

llvm-svn: 231632

9 years agoIntroduce runtime unrolling disable matadata and use it to mark the scalar loop from...
Kevin Qin [Mon, 9 Mar 2015 06:14:18 +0000 (06:14 +0000)]
Introduce runtime unrolling disable matadata and use it to mark the scalar loop from vectorization.

Runtime unrolling is an expensive optimization which can bring benefit
only if the loop is hot and iteration number is relatively large enough.
For some loops, we know they are not worth to be runtime unrolled.
The scalar loop from vectorization is one of the cases.

llvm-svn: 231631

9 years agoRun LICM pass after loop unrolling pass.
Kevin Qin [Mon, 9 Mar 2015 06:14:07 +0000 (06:14 +0000)]
Run LICM pass after loop unrolling pass.

Runtime unrollng will introduce a runtime check in loop prologue.
If the unrolled loop is a inner loop, then the proglogue will be inside
the outer loop. LICM pass can help to promote the runtime check out if
the checked value is loop invariant.

llvm-svn: 231630

9 years ago[MachO] Use setter for globalsAreDeadStripRoots. NFC intended.
Davide Italiano [Mon, 9 Mar 2015 06:05:42 +0000 (06:05 +0000)]
[MachO] Use setter for globalsAreDeadStripRoots. NFC intended.

llvm-svn: 231629

9 years agoWarn when jumping out of a __finally block via goto.
Nico Weber [Mon, 9 Mar 2015 04:27:56 +0000 (04:27 +0000)]
Warn when jumping out of a __finally block via goto.

This only warns on direct gotos and indirect gotos with a unique label
(`goto *&&label;`).  Jumping out ith a true indirect goto is already an error.

This isn't O(1), but goto statements are less common than continue, break, and
return.  Also, the GetDeepestCommonScope() call in the same function does the
same amount of work, so this isn't worse than what's there in a complexity
sense, and it should be pretty fast in practice.

This is the last piece that was missing in r231623.

llvm-svn: 231628

9 years agoTest: Use layout-after instead of layout-before.
Rui Ueyama [Mon, 9 Mar 2015 04:00:29 +0000 (04:00 +0000)]
Test: Use layout-after instead of layout-before.

Update the tests so that they use layout-after instead of layout-before.
In all other places, we use layout-afters as primary edges.

llvm-svn: 231627

9 years agoInstCombine: fix fold "fcmp x, undef" to account for NaN
Mehdi Amini [Mon, 9 Mar 2015 03:20:25 +0000 (03:20 +0000)]
InstCombine: fix fold "fcmp x, undef" to account for NaN

Summary:
See the two test cases.

; Can fold fcmp with undef on one side by choosing NaN for the undef

; Can fold fcmp with undef on both side
;   fcmp u_pred undef, undef -> true
;   fcmp o_pred undef, undef -> false
; because whatever you choose for the first undef
; you can choose NaN for the other undef

Reviewers: hfinkel, chandlerc, majnemer

Reviewed By: majnemer

Subscribers: majnemer, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231626

9 years agoFix a theoretical bug when ParseCompoundStatement() returns StmtError.
Nico Weber [Mon, 9 Mar 2015 03:17:15 +0000 (03:17 +0000)]
Fix a theoretical bug when ParseCompoundStatement() returns StmtError.

ParseCompoundStatement() currently never returns StmtError, but if it did,
Sema would keep the __finally scope on its stack indefinitely.  Explicitly
add an error callback that clears it.

llvm-svn: 231625

9 years agoDCE: isArrayMalloc() is not used neither in LLVM nor Clang
Mehdi Amini [Mon, 9 Mar 2015 02:57:32 +0000 (02:57 +0000)]
DCE: isArrayMalloc() is not used neither in LLVM nor Clang

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231624

9 years agoWarn when jumping out of a __finally block via continue, break, return, __leave.
Nico Weber [Mon, 9 Mar 2015 02:47:59 +0000 (02:47 +0000)]
Warn when jumping out of a __finally block via continue, break, return, __leave.

Since continue, break, return are much more common than __finally, this tries
to keep the work for continue, break, return O(1).  Sema keeps a stack of active
__finally scopes (to do this, ActOnSEHFinally() is split into
ActOnStartSEHFinally() and ActOnFinishSEHFinally()), and the various jump
statements then check if the current __finally scope (if present) is deeper
than then destination scope of the jump.

The same warning for goto statements is still missing.

This is the moral equivalent of MSVC's C4532.

llvm-svn: 231623

9 years agoFix typo in comment.
Nico Weber [Mon, 9 Mar 2015 02:34:29 +0000 (02:34 +0000)]
Fix typo in comment.

llvm-svn: 231622

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Mon, 9 Mar 2015 02:33:32 +0000 (02:33 +0000)]
Wrap to 80 columns. No behavior change.

llvm-svn: 231621

9 years ago[clang-tidy] Fix assertion when a dependent expression is used in an assert.
Alexander Kornienko [Mon, 9 Mar 2015 02:27:57 +0000 (02:27 +0000)]
[clang-tidy] Fix assertion when a dependent expression is used in an assert.

llvm-svn: 231620

9 years agoSimplify boolean expressions in clang with clang-tidy
David Blaikie [Mon, 9 Mar 2015 02:02:07 +0000 (02:02 +0000)]
Simplify boolean expressions in clang with clang-tidy

Patch by Richard (legalize at xmission dot com).

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

llvm-svn: 231619

9 years agoResolver: Fix incorrect DenseMap mapping info.
Rui Ueyama [Mon, 9 Mar 2015 02:00:54 +0000 (02:00 +0000)]
Resolver: Fix incorrect DenseMap mapping info.

Previously, getEmptyKey and getTombstoneKey return the same value
in the sense of isEqual defined by the same class, although they
need to be distinct values. This could confuse DenseMap.

We didn't see any issue by this wrong code because we don't delete
elements from the symbol table. We only add or replace elements.
But this is a bug and needs to be fixed anyway.

llvm-svn: 231618

9 years agoSimplify expressions involving boolean constants with clang-tidy
David Blaikie [Mon, 9 Mar 2015 01:57:13 +0000 (01:57 +0000)]
Simplify expressions involving boolean constants with clang-tidy

Patch by Richard (legalize at xmission dot com).

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

llvm-svn: 231617

9 years agoRemove unused function.
Rui Ueyama [Mon, 9 Mar 2015 01:05:04 +0000 (01:05 +0000)]
Remove unused function.

llvm-svn: 231616

9 years agoPECOFF: Create layout-afters instead of layout-befores.
Rui Ueyama [Mon, 9 Mar 2015 00:06:07 +0000 (00:06 +0000)]
PECOFF: Create layout-afters instead of layout-befores.

All readers except PE/COFF reader create layout-after edges to preserve
the original symbol order. PE/COFF uses layout-before edges as primary
edges for no reason.

This patch makes PE/COFF reader to create layout-after edges.
Resolver is updated to recognize reverse edges of layout-after edges
in the garbage collection pass.

Now we can retire layout-before edges. I don't do that in this patch
because if I do, I would have updated many tests to replace all
occurrrences of "layout-before" with "layout-after". So that's a TODO.

llvm-svn: 231615

9 years agoPECOFF: Define and use BaseReloc type instead of std::pair.
Rui Ueyama [Sun, 8 Mar 2015 22:49:27 +0000 (22:49 +0000)]
PECOFF: Define and use BaseReloc type instead of std::pair.

"first" and "second" are not easy to memorize.
Define a type to use meaningful names.

llvm-svn: 231614

9 years agoTeach DataLayout to infer a plausible alignment for things even when nothing is speci...
Owen Anderson [Sun, 8 Mar 2015 21:53:59 +0000 (21:53 +0000)]
Teach DataLayout to infer a plausible alignment for things even when nothing is specified by the user.

llvm-svn: 231613

9 years ago[Formating] Fix formating
Johannes Doerfert [Sun, 8 Mar 2015 21:38:35 +0000 (21:38 +0000)]
[Formating] Fix formating

llvm-svn: 231612

9 years agoRevert r231552: Resolver: optimize fallback atoms.
Rui Ueyama [Sun, 8 Mar 2015 21:31:38 +0000 (21:31 +0000)]
Revert r231552: Resolver: optimize fallback atoms.

This patch broke a buildbot.

llvm-svn: 231611

9 years agoRe-commit r231545: PECOFF: Do not add extraneous symbols to the dead strip root
Rui Ueyama [Sun, 8 Mar 2015 21:31:36 +0000 (21:31 +0000)]
Re-commit r231545: PECOFF: Do not add extraneous symbols to the dead strip root

That commit was reverted in r231582 as it was a culprit for
buildbot breakage. Turned out it's not.

llvm-svn: 231610