platform/upstream/llvm.git
10 years agoMake consistent use of MCPhysReg instead of uint16_t throughout the tree.
Craig Topper [Fri, 4 Apr 2014 05:16:06 +0000 (05:16 +0000)]
Make consistent use of MCPhysReg instead of uint16_t throughout the tree.

llvm-svn: 205610

10 years agoBasic: rename VisualStudio to Windows
Saleem Abdulrasool [Fri, 4 Apr 2014 05:08:53 +0000 (05:08 +0000)]
Basic: rename VisualStudio to Windows

Visual Studio is the Integrated Development Environment.  The toolchain is
generally referred to MSVC.  Rename the target information to be more precise as
per the recommendation of Reid Kleckner.

llvm-svn: 205609

10 years agoExtend -Wtautological-constant-out-of-range-compare to handle boolean values
Richard Trieu [Fri, 4 Apr 2014 04:13:47 +0000 (04:13 +0000)]
Extend -Wtautological-constant-out-of-range-compare to handle boolean values
better.  This warning will now trigger on the following conditionals:

bool b;
int i;

if (b > 1) {}  // always false
if (0 <= (i > 5)) {} // always true
if (-1 > b) {} // always false

Patch by Per Viberg.

llvm-svn: 205608

10 years agosweep up -Wformat warnings from gcc
Saleem Abdulrasool [Fri, 4 Apr 2014 04:06:10 +0000 (04:06 +0000)]
sweep up -Wformat warnings from gcc

This is a purely mechanical change explicitly casting any parameters for printf
style conversion.  This cleans up the warnings emitted by gcc 4.8 on Linux.

llvm-svn: 205607

10 years agoCodeGen: Don't create branch weight metadata from empty profiles
Justin Bogner [Fri, 4 Apr 2014 02:48:51 +0000 (02:48 +0000)]
CodeGen: Don't create branch weight metadata from empty profiles

If all of our weights are zero when calculating branch weights, it
means we haven't profiled the code in question. Avoid creating a
metadata node that says all branches are equally likely in this case.

The test also checks constructs that hit the other createBranchWeights
overload. These were already working.

llvm-svn: 205606

10 years agoFix spelling. Sigh.
Jim Grosbach [Fri, 4 Apr 2014 02:14:38 +0000 (02:14 +0000)]
Fix spelling. Sigh.

llvm-svn: 205605

10 years agoARM: Range based for-loop over block predecessors.
Jim Grosbach [Fri, 4 Apr 2014 02:11:03 +0000 (02:11 +0000)]
ARM: Range based for-loop over block predecessors.

No functional change.

llvm-svn: 205604

10 years agoAdd iterator_ranges for block pred/succ.
Jim Grosbach [Fri, 4 Apr 2014 02:10:59 +0000 (02:10 +0000)]
Add iterator_ranges for block pred/succ.

llvm-svn: 205603

10 years agoARM: Use range-based for loops in frame lowering.
Jim Grosbach [Fri, 4 Apr 2014 02:10:55 +0000 (02:10 +0000)]
ARM: Use range-based for loops in frame lowering.

No functional change.

llvm-svn: 205602

10 years ago[RegAllocGreedy][Last Chance Recoloring] Emit diagnostics when last chance
Quentin Colombet [Fri, 4 Apr 2014 02:05:21 +0000 (02:05 +0000)]
[RegAllocGreedy][Last Chance Recoloring] Emit diagnostics when last chance
recoloring cut-offs are encountered and register allocation failed.

This is related to PR18747

Patch by MAYUR PANDEY <mayur.p@samsung.com>.

llvm-svn: 205601

10 years agoRevert r205599, the commit was not intended to have so many changes
Quentin Colombet [Fri, 4 Apr 2014 02:02:49 +0000 (02:02 +0000)]
Revert r205599, the commit was not intended to have so many changes

llvm-svn: 205600

10 years ago[RegAllocGreedy][Last Chance Recoloring] Emit diagnostics when last chance
Quentin Colombet [Fri, 4 Apr 2014 01:58:57 +0000 (01:58 +0000)]
[RegAllocGreedy][Last Chance Recoloring] Emit diagnostics when last chance
recoloring cut-offs are hit.

This is related to PR18747.

Patch by MAYUR PANDEY <mayur.p@samsung.com>

llvm-svn: 205599

10 years agoAdd clang-cl alias to allow users to disable c4005
Reid Kleckner [Fri, 4 Apr 2014 01:36:55 +0000 (01:36 +0000)]
Add clang-cl alias to allow users to disable c4005

If we ever want three or more aliases, at that point we should put MSVC
warning ids in DiagnosticGroups.td.  We can use that to support #pragma
warning.

llvm-svn: 205598

10 years agoSymbolTable::size() returns an unsigned int.
Rui Ueyama [Fri, 4 Apr 2014 01:22:51 +0000 (01:22 +0000)]
SymbolTable::size() returns an unsigned int.

It's better to use the same type rather than a fixed width integer type
that may be different from the return type.

llvm-svn: 205597

10 years agoARM: fix test case missed in previous roundup
Saleem Abdulrasool [Fri, 4 Apr 2014 01:19:56 +0000 (01:19 +0000)]
ARM: fix test case missed in previous roundup

This should hopefully bring the last MSVC buildbot back to green!

llvm-svn: 205596

10 years agoMIPS: remove vim swap file
Saleem Abdulrasool [Fri, 4 Apr 2014 01:19:54 +0000 (01:19 +0000)]
MIPS: remove vim swap file

llvm-svn: 205595

10 years agoUse range-based for loop. No functionality change.
Rui Ueyama [Fri, 4 Apr 2014 00:59:50 +0000 (00:59 +0000)]
Use range-based for loop. No functionality change.

llvm-svn: 205594

10 years agoDo not use temporary variables to pass them to forEachUndefines.
Rui Ueyama [Fri, 4 Apr 2014 00:39:37 +0000 (00:39 +0000)]
Do not use temporary variables to pass them to forEachUndefines.

So that it's obvious that we pass these callbacks only to forEachUndefines.

llvm-svn: 205593

10 years agoAdd an assert that this is only used with .o files.
Rafael Espindola [Fri, 4 Apr 2014 00:31:12 +0000 (00:31 +0000)]
Add an assert that this is only used with .o files.

I am not sure how to get a relocation in a .dylib, but this function would
return the wrong value if passed one.

llvm-svn: 205592

10 years agoPut macro redefinition warnings under -Wmacro-redefined
Reid Kleckner [Fri, 4 Apr 2014 00:17:16 +0000 (00:17 +0000)]
Put macro redefinition warnings under -Wmacro-redefined

This is consistent with -Wbuiltin-macro-redefined, and puts this common
extension warning under a flag.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D3283

llvm-svn: 205591

10 years agoReturn a vector rather than mutating a given one.
Rui Ueyama [Fri, 4 Apr 2014 00:15:52 +0000 (00:15 +0000)]
Return a vector rather than mutating a given one.

This is cleaner and as efficient as before.

Differential Revision: http://llvm-reviews.chandlerc.com/D3284

llvm-svn: 205590

10 years agoRename getInputGraph() and getNextFile().
Rui Ueyama [Fri, 4 Apr 2014 00:14:04 +0000 (00:14 +0000)]
Rename getInputGraph() and getNextFile().

Seems getSomething() is more common naming scheme than just a noun
to get something, so renaming these members.

Differential Revision: http://llvm-reviews.chandlerc.com/D3285

llvm-svn: 205589

10 years agoImplement getRelocationAddress for MachO and ET_REL elf files.
Rafael Espindola [Thu, 3 Apr 2014 23:54:35 +0000 (23:54 +0000)]
Implement getRelocationAddress for MachO and ET_REL elf files.

With that, fix the symbolizer to work with any ELF file.

llvm-svn: 205588

10 years agoImplement macho relocation iterators with section number + relocation number.
Rafael Espindola [Thu, 3 Apr 2014 23:51:28 +0000 (23:51 +0000)]
Implement macho relocation iterators with section number + relocation number.

This will make it possible to implement getRelocationAddress.

llvm-svn: 205587

10 years agoARM: yet another round of ARM test clean ups
Saleem Abdulrasool [Thu, 3 Apr 2014 23:47:24 +0000 (23:47 +0000)]
ARM: yet another round of ARM test clean ups

llvm-svn: 205586

10 years agoTidy up. Space before ':' in range-based for loops.
Jim Grosbach [Thu, 3 Apr 2014 23:43:26 +0000 (23:43 +0000)]
Tidy up. Space before ':' in range-based for loops.

llvm-svn: 205585

10 years agoTidy up. 80 columns.
Jim Grosbach [Thu, 3 Apr 2014 23:43:22 +0000 (23:43 +0000)]
Tidy up. 80 columns.

llvm-svn: 205584

10 years agoTidy up. Trailing whitespace.
Jim Grosbach [Thu, 3 Apr 2014 23:43:18 +0000 (23:43 +0000)]
Tidy up. Trailing whitespace.

llvm-svn: 205583

10 years agoFix typo.
Jim Grosbach [Thu, 3 Apr 2014 23:43:12 +0000 (23:43 +0000)]
Fix typo.

llvm-svn: 205582

10 years agoFix llvm-objdump crash.
Rafael Espindola [Thu, 3 Apr 2014 23:20:02 +0000 (23:20 +0000)]
Fix llvm-objdump crash.

llvm-svn: 205581

10 years agoTurn off -Wmissing-noreturn warning for blocks
Fariborz Jahanian [Thu, 3 Apr 2014 23:06:35 +0000 (23:06 +0000)]
Turn off -Wmissing-noreturn warning for blocks
as there is no way to attach this attribute to the
block literal. // rdar://16274746

llvm-svn: 205580

10 years agoUpdate comment.
Rui Ueyama [Thu, 3 Apr 2014 22:58:41 +0000 (22:58 +0000)]
Update comment.

llvm-svn: 205579

10 years agoMinor cleanups.
Rui Ueyama [Thu, 3 Apr 2014 22:43:42 +0000 (22:43 +0000)]
Minor cleanups.

llvm-svn: 205578

10 years agoRemove section_rel_empty. Just compare begin() and end() instead.
Rafael Espindola [Thu, 3 Apr 2014 22:42:22 +0000 (22:42 +0000)]
Remove section_rel_empty. Just compare begin() and end() instead.

llvm-svn: 205577

10 years agoReplace a recursion with a loop for speed.
Rui Ueyama [Thu, 3 Apr 2014 22:36:55 +0000 (22:36 +0000)]
Replace a recursion with a loop for speed.

llvm-svn: 205576

10 years agoDo not check deadStripNever twice.
Rui Ueyama [Thu, 3 Apr 2014 22:24:40 +0000 (22:24 +0000)]
Do not check deadStripNever twice.

Atoms with deadStripNever attribute has already been added to the
dead strip root set at end of Resolver::doDefinedAtom, so no need
to check it for each atom again.

Differential Revision: http://llvm-reviews.chandlerc.com/D3282

llvm-svn: 205575

10 years agoMove code into a helper function.
Rui Ueyama [Thu, 3 Apr 2014 22:21:59 +0000 (22:21 +0000)]
Move code into a helper function.

Move code that always runs after doUndefinedAtom into doUndefinedAtom
for readability.

llvm-svn: 205574

10 years agoInclude stdlib.h for getenv when !NDEBUG.
Joerg Sonnenberger [Thu, 3 Apr 2014 22:00:08 +0000 (22:00 +0000)]
Include stdlib.h for getenv when !NDEBUG.

llvm-svn: 205573

10 years agoReuse existing variable.
Rafael Espindola [Thu, 3 Apr 2014 21:48:41 +0000 (21:48 +0000)]
Reuse existing variable.

llvm-svn: 205572

10 years agoOptimize away unnecessary address casts.
Eli Bendersky [Thu, 3 Apr 2014 21:18:25 +0000 (21:18 +0000)]
Optimize away unnecessary address casts.

Removes unnecessary casts from non-generic address spaces to the generic address
space for certain code patterns.

Patch by Jingyue Wu.

llvm-svn: 205571

10 years agoMinor cleanup.
Rui Ueyama [Thu, 3 Apr 2014 21:16:37 +0000 (21:16 +0000)]
Minor cleanup.

llvm-svn: 205570

10 years agoSimplify two if's.
Rui Ueyama [Thu, 3 Apr 2014 21:11:22 +0000 (21:11 +0000)]
Simplify two if's.

llvm-svn: 205569

10 years agoFix comments.
Rui Ueyama [Thu, 3 Apr 2014 21:06:23 +0000 (21:06 +0000)]
Fix comments.

llvm-svn: 205568

10 years agoEarly return.
Rui Ueyama [Thu, 3 Apr 2014 21:00:03 +0000 (21:00 +0000)]
Early return.

llvm-svn: 205567

10 years agoFix ELFFileNode::resetNextIndex().
Rui Ueyama [Thu, 3 Apr 2014 20:54:47 +0000 (20:54 +0000)]
Fix ELFFileNode::resetNextIndex().

ELFLinkingContext has a method addUndefinedAtomsFromSharedLibrary().
The method is being used to skip a shared library within --start-group
and --end-group if it's not the first iteration of the group.

We have the same, incomplete mechanism to skip a shared library within
a group too. That's implemented in ELFFileNode. It's intended to not
return a shared library on the second or further iterations in the
first place. This mechanism is preferred over
addUndefinedAtomsFromSharedLibrary because the policy is implemented
in Input Graph -- that's what Input Graph is for.

This patch removes the dupluicate feature and fixes ELFFileNode.

Differential Revision: http://llvm-reviews.chandlerc.com/D3280

llvm-svn: 205566

10 years ago[ARM64] Teach the ARM64DeadRegisterDefinition pass to respect implicit-defs.
Lang Hames [Thu, 3 Apr 2014 20:51:08 +0000 (20:51 +0000)]
[ARM64] Teach the ARM64DeadRegisterDefinition pass to respect implicit-defs.

When rematerializing through truncates, the coalescer may produce instructions
with dead defs, but live implicit-defs of subregs:
E.g.
  %X1<def,dead> = MOVi64imm 2, %W1<imp-def>; %X1:GPR64, %W1:GPR32

These instructions are live, and their definitions should not be rewritten.

Fixes <rdar://problem/16492408>

llvm-svn: 205565

10 years agoExpand 'auto' that's hard for human to deduce its real type.
Rui Ueyama [Thu, 3 Apr 2014 20:47:50 +0000 (20:47 +0000)]
Expand 'auto' that's hard for human to deduce its real type.

llvm-svn: 205564

10 years agounconditional-branch.ll is broken for targeting x86_64-cygming. Add an explicit tripl...
NAKAMURA Takumi [Thu, 3 Apr 2014 20:40:37 +0000 (20:40 +0000)]
unconditional-branch.ll is broken for targeting x86_64-cygming. Add an explicit triple for now.

llvm-svn: 205563

10 years agoR600: Correct opcode for BFE_INT
Tom Stellard [Thu, 3 Apr 2014 20:19:29 +0000 (20:19 +0000)]
R600: Correct opcode for BFE_INT

Acording to AMD documentation, the correct opcode for
BFE_INT is 0x5, not 0x4

Fixes Arithm/Absdiff.Mat/3 OpenCV test

Patch by: Bruno Jiménez

llvm-svn: 205562

10 years agoR600/SI: Lower 64-bit immediates using REG_SEQUENCE
Tom Stellard [Thu, 3 Apr 2014 20:19:27 +0000 (20:19 +0000)]
R600/SI: Lower 64-bit immediates using REG_SEQUENCE

llvm-svn: 205561

10 years agoRevert r205551, "Attempt to XFAIL this on mingw and cygwin hosts." It didn't fail...
NAKAMURA Takumi [Thu, 3 Apr 2014 20:08:02 +0000 (20:08 +0000)]
Revert r205551, "Attempt to XFAIL this on mingw and cygwin hosts." It didn't fail on cygming.

That said, it emits errors to the stderr (with exit(0));

  error: failed to compute relocation: IMAGE_REL_I386_SECREL
  error: failed to compute relocation: IMAGE_REL_I386_SECREL
  error: failed to compute relocation: IMAGE_REL_I386_SECREL
  error: failed to compute relocation: IMAGE_REL_I386_SECREL
  error: failed to compute relocation: IMAGE_REL_I386_SECREL
  error: failed to compute relocation: IMAGE_REL_I386_DIR32
  error: failed to compute relocation: IMAGE_REL_I386_SECREL
  error: failed to compute relocation: IMAGE_REL_I386_DIR32
  error: failed to compute relocation: IMAGE_REL_I386_SECREL
  error: failed to compute relocation: IMAGE_REL_I386_SECREL
  error: failed to compute relocation: IMAGE_REL_I386_DIR32

llvm-svn: 205560

10 years agollvm/test/CodeGen/X86/peephole-multiple-folds.ll: Relax expressions to satisfy win32.
NAKAMURA Takumi [Thu, 3 Apr 2014 20:07:51 +0000 (20:07 +0000)]
llvm/test/CodeGen/X86/peephole-multiple-folds.ll: Relax expressions to satisfy win32.

llvm-svn: 205559

10 years agoAdd empty() to atom_collection.
Rui Ueyama [Thu, 3 Apr 2014 19:51:14 +0000 (19:51 +0000)]
Add empty() to atom_collection.

"x.empty()" is more idiomatic than "x.size() == 0". This patch is to
add such method and use it in LLD.

Differential Revision: http://llvm-reviews.chandlerc.com/D3279

llvm-svn: 205558

10 years agovector [Sema]. Check for proper use of 's' char prefix
Fariborz Jahanian [Thu, 3 Apr 2014 19:43:01 +0000 (19:43 +0000)]
vector [Sema]. Check for proper use of 's' char prefix
(which indicates vector expression is a string of hex
values) instead of crashing in code gen. // rdar://16492792

llvm-svn: 205557

10 years agoAdd another hint for fixing check-polly errors to get_started.html
Tobias Grosser [Thu, 3 Apr 2014 19:38:38 +0000 (19:38 +0000)]
Add another hint for fixing check-polly errors to get_started.html

Reversed the order in which LD_LIBRARY_PATH is defined in order to make sure the
${CLOOG_INSTALL} prefix is found first.

Contributed-by: Christian Bielert <cib123@googlemail.com>
llvm-svn: 205556

10 years agoAvoid crash if symbol returns a null name
Ed Maste [Thu, 3 Apr 2014 19:27:39 +0000 (19:27 +0000)]
Avoid crash if symbol returns a null name

llvm-svn: 205555

10 years ago-fms-extensions: Error out on #pragma init_seg
Reid Kleckner [Thu, 3 Apr 2014 19:04:24 +0000 (19:04 +0000)]
-fms-extensions: Error out on #pragma init_seg

By ignoring this pragma with a warning, we're essentially miscompiling
the user's program.  WebKit / Blink use this pragma to disable dynamic
initialization and finalization of some static data, and running the
dtors crashes the program.

Error out for now, so that /fallback compiles the TU correctly with
MSVC.  This pragma should be implemented some time this month, and we
can remove this hack.

llvm-svn: 205554

10 years agoNote of last Polly phone call
Tobias Grosser [Thu, 3 Apr 2014 18:56:13 +0000 (18:56 +0000)]
Note of last Polly phone call

llvm-svn: 205553

10 years agoRemove "virtual" and add "override".
Rui Ueyama [Thu, 3 Apr 2014 18:25:36 +0000 (18:25 +0000)]
Remove "virtual" and add "override".

Seems clang-modernize couldn't add "override" to nested classes, so
doing it by hand. Also removed unused virtual member function that
is not overriding anything, that seems to have been added by mistake.

llvm-svn: 205552

10 years agoAttempt to XFAIL this on mingw and cygwin hosts. The line table on
Eric Christopher [Thu, 3 Apr 2014 18:23:52 +0000 (18:23 +0000)]
Attempt to XFAIL this on mingw and cygwin hosts. The line table on
these is very much off and is more than just the branch
from this bug incorrect:

Address            Line   Column File   ISA Discriminator Flags
------------------ ------ ------ ------ --- ------------- -------------
0x30830a0100000002      3      0      1   0             0  is_stmt
0x30830a0100000008      3      0      1   0             0  is_stmt end_sequence

llvm-svn: 205551

10 years agoRemove "this->".
Rui Ueyama [Thu, 3 Apr 2014 18:13:14 +0000 (18:13 +0000)]
Remove "this->".

For most member function calls we do not use "this->" in this file.
Remove the rest for consistency.

llvm-svn: 205550

10 years agoAdd a paragraph describing how to configure the python interpreter.
Tobias Grosser [Thu, 3 Apr 2014 18:12:13 +0000 (18:12 +0000)]
Add a paragraph describing how to configure the python interpreter.

Contributed-by: cib123@googlemail.com
llvm-svn: 205549

10 years agoRevert r205436:
Roman Divacky [Thu, 3 Apr 2014 18:04:52 +0000 (18:04 +0000)]
Revert r205436:

        Extend the SSE2 comment lexing to AVX2. Only 16byte align when not on AVX2.

        This provides some 3% speedup when preprocessing gcc.c as a single file.

The patch is wrong, it always uses SSE2, and when I fix that there's no speedup
at all. I am not sure where the 3% came from previously.

--Thi lie, and those below, will be ignored--

M    Lex/Lexer.cpp

llvm-svn: 205548

10 years agoFix PR19270 - type mismatch caused by invalid optimization.
Eli Bendersky [Thu, 3 Apr 2014 17:51:58 +0000 (17:51 +0000)]
Fix PR19270 - type mismatch caused by invalid optimization.

Patch by Jingyue Wu.

llvm-svn: 205547

10 years agoLoosen up check so that we can pass on platforms that generate
Eric Christopher [Thu, 3 Apr 2014 17:40:08 +0000 (17:40 +0000)]
Loosen up check so that we can pass on platforms that generate
slightly more verbose than needed line tables, e.g.:

Address            Line   Column File   ISA Discriminator Flags
------------------ ------ ------ ------ --- ------------- -------------
0x0000000000000000      1      0      1   0             0  is_stmt
0x0000000000000000      1      0      1   0             0  is_stmt prologue_end
0x0000000000000010      2      0      1   0             0  is_stmt
0x0000000000000018      4      0      1   0             0  is_stmt

these should probably be looked at, but it isn't affecting the correctness
of the testcase.

llvm-svn: 205546

10 years agoARM: update even more tests
Saleem Abdulrasool [Thu, 3 Apr 2014 17:35:22 +0000 (17:35 +0000)]
ARM: update even more tests

More updating of tests to be explicit about the target triple rather than
relying on the default target triple supporting ARM mode.

Indicate to lit that object emission is not yet available for Windows on ARM.

llvm-svn: 205545

10 years agoGet "dis -c -s" working again.
Jim Ingham [Thu, 3 Apr 2014 17:16:17 +0000 (17:16 +0000)]
Get "dis -c -s" working again.

pr19324

llvm-svn: 205544

10 years agoTeach getTemplateInstantiationPattern to deal with generic lambdas.
Faisal Vali [Thu, 3 Apr 2014 16:32:21 +0000 (16:32 +0000)]
Teach getTemplateInstantiationPattern to deal with generic lambdas.

No functionality change.

When determining the pattern for instantiating a generic lambda call operator specialization - we must not go drilling down for the 'prototype' (i.e. as written) pattern - rather we must use our partially transformed  pattern (whose DeclRefExprs are wired correctly to any enclosing lambda's decls that should be mapped correctly in a local instantiation scope) that is the templated pattern of the specialization's primary template (even though the primary template might be instantiated from a 'prototype' member-template).  Previously, the drilling down was haltted by marking the instantiated-from primary template as a member-specialization (incorrectly).

This prompted Richard to remark (http://llvm-reviews.chandlerc.com/D1784?id=4687#inline-10272)
"It's a bit nasty to (essentially) set this bit incorrectly. Can you put the check into getTemplateInstantiationPattern instead?"

In my reckless youth, I chose to ignore that comment.  With the passage of time, I have come to learn the value of bowing to the will of the angry Gods ;)

llvm-svn: 205543

10 years agoArrayRef: use std::vector::data() now that we are building in C++11 mode
Dmitri Gribenko [Thu, 3 Apr 2014 16:29:11 +0000 (16:29 +0000)]
ArrayRef: use std::vector::data() now that we are building in C++11 mode

llvm-svn: 205542

10 years agoARM: fixup more tests to specify the target more explicitly
Saleem Abdulrasool [Thu, 3 Apr 2014 16:01:44 +0000 (16:01 +0000)]
ARM: fixup more tests to specify the target more explicitly

This changes the tests that were targeting ARM EABI to explicitly specify the
environment rather than relying on the default.  This breaks with the new
Windows on ARM support when running the tests on Windows where the default
environment is no longer EABI.

Take the opportunity to avoid a pointless redirect (helps when trying to debug
with providing a command line invocation which can be copy and pasted) and
removing a few greps in favour of FileCheck.

llvm-svn: 205541

10 years agoARM: tell LLVM about zext properties of ldrexb/ldrexh
Tim Northover [Thu, 3 Apr 2014 15:10:35 +0000 (15:10 +0000)]
ARM: tell LLVM about zext properties of ldrexb/ldrexh

Implementing this via ComputeMaskedBits has two advantages:
  + It actually works. DAGISel doesn't deal with the chains properly
    in the previous pattern-based solution, so they never trigger.
  + The information can be used in other DAG combines, as well as the
    trivial "get rid of truncs". For example if the trunc is in a
    different basic block.

rdar://problem/16227836

llvm-svn: 205540

10 years agoAdd explict dependencies on swig .i files for cmake builds
Ed Maste [Thu, 3 Apr 2014 15:03:11 +0000 (15:03 +0000)]
Add explict dependencies on swig .i files for cmake builds

llvm.org/pr19316

llvm-svn: 205539

10 years ago[mips] Add negative tests confirm that supported ISA's don't allow instructions added...
Daniel Sanders [Thu, 3 Apr 2014 14:14:22 +0000 (14:14 +0000)]
[mips] Add negative tests confirm that supported ISA's don't allow instructions added in later ISA's

Summary:
test/MC/Mips/<isa1>/invalid-<isa2>.s
    Test that <isa1> does not support <isa2>'s instructions.
test/MC/Mips/<isa1>/invalid-<isa2>-xfail.s
    Things that should be invalid but currently aren't. Will XPASS if any
    become invalid.

Reviewers: matheusalmeida

Reviewed By: matheusalmeida

Differential Revision: http://llvm-reviews.chandlerc.com/D3262

llvm-svn: 205538

10 years ago[mips] Implement ehb, ssnop, and pause in assembler
Daniel Sanders [Thu, 3 Apr 2014 13:21:51 +0000 (13:21 +0000)]
[mips] Implement ehb, ssnop, and pause in assembler

Summary: Add negative tests for pause

Reviewers: matheusalmeida

Reviewed By: matheusalmeida

Differential Revision: http://llvm-reviews.chandlerc.com/D3246

llvm-svn: 205537

10 years agoCode cleanup (re-indent)
Logan Chien [Thu, 3 Apr 2014 13:12:44 +0000 (13:12 +0000)]
Code cleanup (re-indent)

llvm-svn: 205536

10 years agoARM: skip cmpxchg failure barrier if ordering is monotonic.
Tim Northover [Thu, 3 Apr 2014 13:06:54 +0000 (13:06 +0000)]
ARM: skip cmpxchg failure barrier if ordering is monotonic.

The terminal barrier of a cmpxchg expansion will be either Acquire or
SequentiallyConsistent. In either case it can be skipped if the
operation has Monotonic requirements on failure.

rdar://problem/15996804

llvm-svn: 205535

10 years ago[TSan] Fix a rare deadlock on multithreaded fork.
Alexey Samsonov [Thu, 3 Apr 2014 12:51:26 +0000 (12:51 +0000)]
[TSan] Fix a rare deadlock on multithreaded fork.

If a multi-threaded program calls fork(), TSan ignores all memory accesses
in the child to prevent deadlocks in TSan runtime. This is OK, as child is
probably going to call exec() as soon as possible. However, a rare deadlocks
could be caused by ThreadIgnoreBegin() function itself.

ThreadIgnoreBegin() remembers the current stack trace and puts it into the
StackDepot to report a warning later if a thread exited with ignores enabled.
Using StackDepotPut in a child process is dangerous: it locks a mutex on
a slow path, which could be already locked in a parent process.

The fix is simple: just don't put current stack traces to StackDepot in
ThreadIgnoreBegin() and ThreadIgnoreSyncBegin() functions if we're
running after a multithreaded fork. We will not report any
"thread exited with ignores enabled" errors in this case anyway.

Submitting this without a testcase, as I believe the standalone reproducer
is pretty hard to construct.

llvm-svn: 205534

10 years agoRevert "Add support for named values in the parser."
Samuel Benzaquen [Thu, 3 Apr 2014 12:50:47 +0000 (12:50 +0000)]
Revert "Add support for named values in the parser."
This was submitted before it was ready.

This reverts commit 62060a01e095cf35eb9ca42a333752d12714f35c.

llvm-svn: 205533

10 years agoImplementation of 16-bit microMIPS instructions MFHI and MFLO.
Zoran Jovanovic [Thu, 3 Apr 2014 12:47:34 +0000 (12:47 +0000)]
Implementation of 16-bit microMIPS instructions MFHI and MFLO.
Differential Revision: http://llvm-reviews.chandlerc.com/D3141

llvm-svn: 205532

10 years ago[TSan] Fix a typo ThreadIgnoreSyncEnd. Found by inspection
Alexey Samsonov [Thu, 3 Apr 2014 12:28:16 +0000 (12:28 +0000)]
[TSan] Fix a typo ThreadIgnoreSyncEnd. Found by inspection

llvm-svn: 205531

10 years ago[mips] Add initial (experimental) MIPS-IV support.
Daniel Sanders [Thu, 3 Apr 2014 12:13:36 +0000 (12:13 +0000)]
[mips] Add initial (experimental) MIPS-IV support.

Summary:
Adds the 'mips4' processor and a simple test of the ELF e_flags.

Patch by David Chisnall
His work was sponsored by: DARPA, AFRL

I made one small change to the testcase so that it uses
mips64-unknown-linux instead of mips4-unknown-linux.

This patch indirectly adds FeatureCondMov to FeatureMips64. This is ok
because it's supposed to be there anyway and it turns out that
FeatureCondMov is not a predicate of any instructions at the moment
(this is a bug that hasn't been noticed because there are no targets
without the conditional move instructions yet).

CC: theraven
Differential Revision: http://llvm-reviews.chandlerc.com/D3244

llvm-svn: 205530

10 years agoFix for PR 19261:
Eric Christopher [Thu, 3 Apr 2014 12:11:51 +0000 (12:11 +0000)]
Fix for PR 19261:

llc doesn't generate nodes for unconditional fall-through branches for targets
without FastISel implementation (X86 has it, but can be disabled by
"-fast-isel=false") in SelectionDAGBuilder::visitBr().

So for line 4 in the following testcase

1: void foo(int i){
2:   switch(i){
3:   default:
4:     break;
5:   }
6:   return;
7: }

there is no corresponding line in .debug_line section, and a debugger
cannot set a breakpoint at line 4.

Fix this by always emitting a branch when we're not optimizing and add a
testcase to ensure that there's code on every line we'd want to break.

Patch by Daniil Fukalov.

llvm-svn: 205529

10 years agoMicroMIPS specific little endian fixup data byte ordering.
Zoran Jovanovic [Thu, 3 Apr 2014 12:01:01 +0000 (12:01 +0000)]
MicroMIPS specific little endian fixup data byte ordering.
Differential Revision: http://llvm-reviews.chandlerc.com/D3245

llvm-svn: 205528

10 years agoclang-format: Prefer an additional line-break over hanging indent.
Daniel Jasper [Thu, 3 Apr 2014 12:00:33 +0000 (12:00 +0000)]
clang-format: Prefer an additional line-break over hanging indent.

Don't allow the RHS of an operator to be split over multiple
lines unless there is a line-break right after the operator.

Before:
  if (aaaa && bbbbb || // break
                  cccc) {
  }

After:
  if (aaaa &&
      bbbbb || // break
          cccc) {
  }

In most cases, this seems to increase readability.

llvm-svn: 205527

10 years agox
Daniel Jasper [Thu, 3 Apr 2014 12:00:27 +0000 (12:00 +0000)]
x

llvm-svn: 205526

10 years agoARM: expand atomic ldrex/strex loops in IR
Tim Northover [Thu, 3 Apr 2014 11:44:58 +0000 (11:44 +0000)]
ARM: expand atomic ldrex/strex loops in IR

The previous situation where ATOMIC_LOAD_WHATEVER nodes were expanded
at MachineInstr emission time had grown to be extremely large and
involved, to account for the subtly different code needed for the
various flavours (8/16/32/64 bit, cmpxchg/add/minmax).

Moving this transformation into the IR clears up the code
substantially, and makes future optimisations much easier:

1. an atomicrmw followed by using the *new* value can be more
   efficient. As an IR pass, simple CSE could handle this
   efficiently.
2. Making use of cmpxchg success/failure orderings only has to be done
   in one (simpler) place.
3. The common "cmpxchg; did we store?" idiom can be exposed to
   optimisation.

I intend to gradually improve this situation within the ARM backend
and make sure there are no hidden issues before moving the code out
into CodeGen to be shared with (at least ARM64/AArch64, though I think
PPC & Mips could benefit too).

llvm-svn: 205525

10 years agoPR19320:
Stepan Dyatkovskiy [Thu, 3 Apr 2014 11:29:15 +0000 (11:29 +0000)]
PR19320:
The trouble as in ARMAsmParser, in ParseInstruction method. It assumes that ARM::R12 + 1 == ARM::SP.
It is wrong, since ARM::<Register> codes are generated by tablegen and actually could be any random numbers.

llvm-svn: 205524

10 years ago[ARM] When generating a vpaddl node the input lane type is not always the type of the
Silviu Baranga [Thu, 3 Apr 2014 10:44:27 +0000 (10:44 +0000)]
[ARM] When generating a vpaddl node the input lane type is not always the type of the
add operation since extract_vector_elt can perform an extend operation. Get the input lane
type from the vector on which we're performing the vpaddl operation on and extend or
truncate it to the output type of the original add node.

llvm-svn: 205523

10 years ago[mips] Extend MipsMCExpr class to handle %higher(sym1 - sym2 + const) and
Sasa Stankovic [Thu, 3 Apr 2014 10:37:45 +0000 (10:37 +0000)]
[mips] Extend MipsMCExpr class to handle %higher(sym1 - sym2 + const) and
%highest(sym1 - sym2 + const) relocations. Remove "ABS_" from VK_Mips_HI
and VK_Mips_LO enums in MipsMCExpr, to be consistent with VK_Mips_HIGHER
and VK_Mips_HIGHEST.

This change also deletes test file test/MC/Mips/higher_highest.ll and moves
its CHECK's to the new test file test/MC/Mips/higher-highest-addressing.s.
The deleted file tests that R_MIPS_HIGHER and R_MIPS_HIGHEST relocations are
emitted in the .o file. Since it uses -force-mips-long-branch option, it was
created when MipsLongBranch's implementation was emitting R_MIPS_HIGHER and
R_MIPS_HIGHEST relocations in the .o file. It was disabled when MipsLongBranch
started to directly calculate offsets.

Differential Revision: http://llvm-reviews.chandlerc.com/D3230

llvm-svn: 205522

10 years agoImproved semantics for implicit scalar -> extvector conversions.
Stephen Canon [Thu, 3 Apr 2014 10:33:25 +0000 (10:33 +0000)]
Improved semantics for implicit scalar -> extvector conversions.

llvm-svn: 205521

10 years agoARM64: add regression test for r205519.
Tim Northover [Thu, 3 Apr 2014 09:36:05 +0000 (09:36 +0000)]
ARM64: add regression test for r205519.

llvm-svn: 205520

10 years agoARM64: always use i64 for the RHS of shift operations
Tim Northover [Thu, 3 Apr 2014 09:26:16 +0000 (09:26 +0000)]
ARM64: always use i64 for the RHS of shift operations

Switching between i32 and i64 based on the LHS type is a good idea in
theory, but pre-legalisation uses i64 regardless of our choice,
leading to potential ISel errors.

Should fix PR19294.

llvm-svn: 205519

10 years agoRTTI Uniqueness: remove __name_for_load function.
Tim Northover [Thu, 3 Apr 2014 09:12:38 +0000 (09:12 +0000)]
RTTI Uniqueness: remove __name_for_load function.

It's identical to name() these days. (At one point it avoided masking
of the RTTI uniqueness bit because ARM64 ignored it architecturally,
but no longer).

llvm-svn: 205518

10 years agoclang-format: Understand that "auto" is a type.
Daniel Jasper [Thu, 3 Apr 2014 09:00:49 +0000 (09:00 +0000)]
clang-format: Understand that "auto" is a type.

Before:
  MACRO(auto * a);

After:
  MACRO(auto *a);

llvm-svn: 205517

10 years agoARM: Use __STACK_LIMIT symbol for segmented stacks
Oliver Stannard [Thu, 3 Apr 2014 08:45:16 +0000 (08:45 +0000)]
ARM: Use __STACK_LIMIT symbol for segmented stacks

We cannot use STACK_LIMIT, as it is not reserved for the compiler
by the C spec.

llvm-svn: 205516

10 years agoStack map docs. Remove some stray markup.
Andrew Trick [Thu, 3 Apr 2014 07:08:21 +0000 (07:08 +0000)]
Stack map docs. Remove some stray markup.

llvm-svn: 205515

10 years agoARM64: don't generate __sincos_stret calls unless on MachO
Tim Northover [Thu, 3 Apr 2014 07:06:13 +0000 (07:06 +0000)]
ARM64: don't generate __sincos_stret calls unless on MachO

This should fix PR19314.

llvm-svn: 205514

10 years agoMinor update to the stack map documentation.
Andrew Trick [Thu, 3 Apr 2014 07:03:28 +0000 (07:03 +0000)]
Minor update to the stack map documentation.

llvm-svn: 205513

10 years agoDebugInfo: Use a 64 bit type for the subrange
David Blaikie [Thu, 3 Apr 2014 06:28:20 +0000 (06:28 +0000)]
DebugInfo: Use a 64 bit type for the subrange

While we were encoding 64 bit values (data8) in the subrange itself,
using a 32 bit type for the subrange was still confusing the gdb. Oh,
and make it unsigned too.

As the comment points out, this could be pushed into the frontend so
that it would be 32 or 64 bit as appropriate, etc.

llvm-svn: 205512

10 years ago[CodeGen] Fix peephole optimizer bug introduced in r205481. Fixes PR19318.
Lang Hames [Thu, 3 Apr 2014 05:03:20 +0000 (05:03 +0000)]
[CodeGen] Fix peephole optimizer bug introduced in r205481. Fixes PR19318.

I should have read that comment a little more carefully. ;)

Regression test in the works, committing in the mean time to un-break people.

llvm-svn: 205511