platform/upstream/llvm.git
11 years agoFix for wrong instcombine on vector insert/extract
Benjamin Kramer [Thu, 11 Apr 2013 15:10:09 +0000 (15:10 +0000)]
Fix for wrong instcombine on vector insert/extract

When trying to collapse sequences of insertelement/extractelement
instructions into single shuffle instructions, there is one specific
case where the Instruction Combiner wrongly updates the resulting
Mask of shuffle indexes.

The problem is in function CollectShuffleElments.

If we have a sequence of insert/extract element instructions
like the one below:

  %tmp1 = extractelement <4 x float> %LHS, i32 0
  %tmp2 = insertelement <4 x float> %RHS, float %tmp1, i32 1
  %tmp3 = extractelement <4 x float> %RHS, i32 2
  %tmp4 = insertelement <4 x float> %tmp2, float %tmp3, i32 3

Where:
  . %RHS will have a mask of [4,5,6,7]
  . %LHS will have a mask of [0,1,2,3]

The Mask of shuffle indexes is wrongly computed to [4,1,6,7]
instead of [4,0,6,7].
When analyzing %tmp2 in order to compute the Mask for the
resulting shuffle instruction, the algorithm forgets to update
the mask index at position 1 with the index associated to the
element extracted from %LHS by instruction %tmp1.

Patch by Andrea DiBiagio!

llvm-svn: 179291

11 years agoAdd a CHECK-NOT for a more faithful translation of the original grep | count 2.
Eli Bendersky [Thu, 11 Apr 2013 14:43:19 +0000 (14:43 +0000)]
Add a CHECK-NOT for a more faithful translation of the original grep | count 2.
Thanks to Reid Kleckner for catching this.

llvm-svn: 179289

11 years ago[sanitizer] Syscall hooks.
Evgeniy Stepanov [Thu, 11 Apr 2013 14:37:04 +0000 (14:37 +0000)]
[sanitizer] Syscall hooks.

Pre- and post- hooks for linux syscalls. Not wired into anything, but exposed
through public interface.

llvm-svn: 179288

11 years agoChange clang-format's affinity for breaking after return types.
Daniel Jasper [Thu, 11 Apr 2013 14:29:13 +0000 (14:29 +0000)]
Change clang-format's affinity for breaking after return types.

Function declarations are now broken with the following preferences:
1) break amongst arguments.
2) break after return type.
3) break after (.
4) break before after nested name specifiers.

Options #2 or #3 are preferred over #1 only if a substantial number of
lines can be saved by that.

llvm-svn: 179287

11 years ago[asan] make heavy_uar_test a bit more heavy and fix he fake stack to pass this test
Kostya Serebryany [Thu, 11 Apr 2013 14:07:02 +0000 (14:07 +0000)]
[asan] make heavy_uar_test a bit more heavy and fix he fake stack to pass this test

llvm-svn: 179286

11 years agoAdd a function to check if an argument list is too long.
Rafael Espindola [Thu, 11 Apr 2013 14:06:34 +0000 (14:06 +0000)]
Add a function to check if an argument list is too long.

This will be used in clang to decide if it should create an @file or not. It
will be tested on the clang side.

Patch by Nathan Froyd.

llvm-svn: 179285

11 years agoFix failing dependencies-and-pp.c test
Reid Kleckner [Thu, 11 Apr 2013 13:43:19 +0000 (13:43 +0000)]
Fix failing dependencies-and-pp.c test

The bots seem to do more line wrapping because they have longer absolute
paths.

llvm-svn: 179284

11 years agoUse lit's internal shell runner on Windows for Clang tests
Reid Kleckner [Thu, 11 Apr 2013 13:34:18 +0000 (13:34 +0000)]
Use lit's internal shell runner on Windows for Clang tests

The behavior can be overridden by setting LIT_USE_INTERNAL_SHELL=0 in
the environment.

This fixes issues with /dev/null for me and brings the test suite time
down to 30s.  =D

llvm-svn: 179283

11 years agoFileCheck-ify more grep tests with quoted double quotes
Reid Kleckner [Thu, 11 Apr 2013 13:24:56 +0000 (13:24 +0000)]
FileCheck-ify more grep tests with quoted double quotes

This required some tedious reordering to match clang's order.
Presumably these ObjC tests were generated based on llvm-gcc's output
ordering.

llvm-svn: 179282

11 years ago[ASan] test source-based init-order blacklisting added in r179280
Alexey Samsonov [Thu, 11 Apr 2013 13:21:41 +0000 (13:21 +0000)]
[ASan] test source-based init-order blacklisting added in r179280

llvm-svn: 179281

11 years ago[ASan] Allow disabling init-order checks for globals by source file name.
Alexey Samsonov [Thu, 11 Apr 2013 13:20:00 +0000 (13:20 +0000)]
[ASan] Allow disabling init-order checks for globals by source file name.

llvm-svn: 179280

11 years agoAdd myself in the CREDITS.TXT
Sylvestre Ledru [Thu, 11 Apr 2013 13:15:39 +0000 (13:15 +0000)]
Add myself in the CREDITS.TXT

llvm-svn: 179279

11 years ago[asan] fix use-after-return functionality (PR15672) and enable the corresponding...
Kostya Serebryany [Thu, 11 Apr 2013 12:49:38 +0000 (12:49 +0000)]
[asan] fix use-after-return functionality (PR15672) and enable the corresponding test. We still don't guarantee anything with regard to use-after-return checking

llvm-svn: 179278

11 years agoAdd missing colons to check lines.
Benjamin Kramer [Thu, 11 Apr 2013 12:41:41 +0000 (12:41 +0000)]
Add missing colons to check lines.

llvm-svn: 179277

11 years agoFileCheckize a bunch of tests.
Benjamin Kramer [Thu, 11 Apr 2013 12:32:23 +0000 (12:32 +0000)]
FileCheckize a bunch of tests.

llvm-svn: 179276

11 years agoAdd braces around || in && to pacify GCC.
Benjamin Kramer [Thu, 11 Apr 2013 11:57:01 +0000 (11:57 +0000)]
Add braces around || in && to pacify GCC.

llvm-svn: 179275

11 years ago[ASan] Symbolize correct address when printint error summary
Alexey Samsonov [Thu, 11 Apr 2013 11:45:04 +0000 (11:45 +0000)]
[ASan] Symbolize correct address when printint error summary

llvm-svn: 179274

11 years ago[asan] move fake stack into a separate .h file; actually disable a failing test
Kostya Serebryany [Thu, 11 Apr 2013 11:39:19 +0000 (11:39 +0000)]
[asan] move fake stack into a separate .h file; actually disable a failing test

llvm-svn: 179273

11 years agoRename the C function to create a SLPVectorizerPass to something sane and expose...
Benjamin Kramer [Thu, 11 Apr 2013 11:36:36 +0000 (11:36 +0000)]
Rename the C function to create a SLPVectorizerPass to something sane and expose it in the header file.

llvm-svn: 179272

11 years ago[asan] add heavy_uar_test (disabled); fix lint
Kostya Serebryany [Thu, 11 Apr 2013 11:29:07 +0000 (11:29 +0000)]
[asan] add heavy_uar_test (disabled); fix lint

llvm-svn: 179271

11 years agoFix formatting of overloaded assignment operators.
Daniel Jasper [Thu, 11 Apr 2013 08:48:20 +0000 (08:48 +0000)]
Fix formatting of overloaded assignment operators.

Before: SomeType &operator=(const SomeType & S);
After:  SomeType &operator=(const SomeType &S);
llvm-svn: 179270

11 years ago[analyzer] Factor common code from {SymSym,SymInt,IntSym}Expr to BinarySymExpr
Ryan Govostes [Thu, 11 Apr 2013 06:04:50 +0000 (06:04 +0000)]
[analyzer] Factor common code from {SymSym,SymInt,IntSym}Expr to BinarySymExpr

llvm-svn: 179269

11 years agoScheduleOptimizer: Use isl_map_from_union_map to extract map.
Tobias Grosser [Thu, 11 Apr 2013 05:55:13 +0000 (05:55 +0000)]
ScheduleOptimizer: Use isl_map_from_union_map to extract map.

llvm-svn: 179268

11 years agoOptimize vector select from all 0s or all 1s
Michael Liao [Thu, 11 Apr 2013 05:15:54 +0000 (05:15 +0000)]
Optimize vector select from all 0s or all 1s

As packed comparisons in AVX/SSE produce all 0s or all 1s in each SIMD lane,
vector select could be simplified to AND/OR or removed if one or both values
being selected is all 0s or all 1s.

llvm-svn: 179267

11 years agoAdd CLAC/STAC instruction encoding/decoding support
Michael Liao [Thu, 11 Apr 2013 04:52:28 +0000 (04:52 +0000)]
Add CLAC/STAC instruction encoding/decoding support

As these two instructions in AVX extension are privileged instructions for
special purpose, it's only expected to be used in inlined assembly.

llvm-svn: 179266

11 years agoEnhance bool simplifcation in X86 to handle more cases
Michael Liao [Thu, 11 Apr 2013 04:43:09 +0000 (04:43 +0000)]
Enhance bool simplifcation in X86 to handle more cases

This patch is revised based on patch from Victor Umansky
<victor.umansky@intel.com>. More cases are handled in X86's bool
simplification, i.e.
- SETCC_CARRY
- value is truncated to i1 with AND

As a by-product, PR5443 is also fixed.

llvm-svn: 179265

11 years ago[test] missing underscore while checking for test output
Shankar Easwaran [Thu, 11 Apr 2013 04:20:21 +0000 (04:20 +0000)]
[test] missing underscore while checking for test output

llvm-svn: 179264

11 years agoR600ControlFlowFinalizer.cpp: Fix a warning. [-Wunused-variable]
NAKAMURA Takumi [Thu, 11 Apr 2013 04:16:27 +0000 (04:16 +0000)]
R600ControlFlowFinalizer.cpp: Fix a warning. [-Wunused-variable]

llvm-svn: 179263

11 years agoWhitespace.
NAKAMURA Takumi [Thu, 11 Apr 2013 04:16:22 +0000 (04:16 +0000)]
Whitespace.

llvm-svn: 179262

11 years agoARCMigrate/Transforms.h: Remove \arg in comment. [-Wdocumentation]
NAKAMURA Takumi [Thu, 11 Apr 2013 04:16:11 +0000 (04:16 +0000)]
ARCMigrate/Transforms.h: Remove \arg in comment. [-Wdocumentation]

llvm-svn: 179261

11 years ago[test] fix failing test, the test was not accounting for - in the path
Shankar Easwaran [Thu, 11 Apr 2013 04:08:11 +0000 (04:08 +0000)]
[test] fix failing test, the test was not accounting for - in the path

llvm-svn: 179260

11 years agoSimplify the code. No functionality change.
Rafael Espindola [Thu, 11 Apr 2013 03:34:37 +0000 (03:34 +0000)]
Simplify the code. No functionality change.

llvm-svn: 179259

11 years agoChange the disassemble option to specify the architecture from '-a'
Jason Molenda [Thu, 11 Apr 2013 03:14:01 +0000 (03:14 +0000)]
Change the disassemble option to specify the architecture from '-a'
to '-A'.

Add option '-a' / '--address' to disassemble which will find the
function that contains that address, and disassemble the entire function.

<rdar://problem/13436207>

llvm-svn: 179258

11 years agoThis adds functionality for undefined atoms from dynamic libraries to be added
Shankar Easwaran [Thu, 11 Apr 2013 02:56:30 +0000 (02:56 +0000)]
This adds functionality for undefined atoms from dynamic libraries to be added
to the list of undefined atoms.

The processing of undefined atoms from dynamic libraries is controlled by
use-shlib-undefines command line option.

This patch also adds additional command line arguments to allow/disallow
unresolved symbols from shared libraries and mimics GNU ld behavior.

llvm-svn: 179257

11 years agoAdd MachO-x86-64 tests.
Rafael Espindola [Thu, 11 Apr 2013 02:52:29 +0000 (02:52 +0000)]
Add MachO-x86-64 tests.

The object was already checked in, but was not being tested.

llvm-svn: 179256

11 years agoFix MachO's getRelocationAdditionalInfo.
Rafael Espindola [Thu, 11 Apr 2013 02:21:31 +0000 (02:21 +0000)]
Fix MachO's getRelocationAdditionalInfo.

It was returning the loaded address of the section containing the relocation,
which really doesn't seem to be the intent of this function.

llvm-svn: 179255

11 years agoDrop ObjCIndirectCopyRestoreExprs during template instantiation.
John McCall [Thu, 11 Apr 2013 02:14:26 +0000 (02:14 +0000)]
Drop ObjCIndirectCopyRestoreExprs during template instantiation.

It's a kind of implicit conversion, which we generally drop, but
more importantly it's got very specific placement requirements.

rdar://13617051

llvm-svn: 179254

11 years agoChanged the way ClangExpressionDeclMap registers
Sean Callanan [Thu, 11 Apr 2013 02:05:11 +0000 (02:05 +0000)]
Changed the way ClangExpressionDeclMap registers
entities with the new Materializer so that it only
registers those entities that actually need to be
placed in the struct.

llvm-svn: 179253

11 years agoMake PPCInstrInfo::isPredicated always return false
Hal Finkel [Thu, 11 Apr 2013 01:23:34 +0000 (01:23 +0000)]
Make PPCInstrInfo::isPredicated always return false

Because of how predication in implemented on PPC (only for branches), I think
that this is the right thing to do.  No functionality change intended.

llvm-svn: 179252

11 years ago[libclang] Expose record layout info via new libclang functions:
Argyrios Kyrtzidis [Thu, 11 Apr 2013 01:20:11 +0000 (01:20 +0000)]
[libclang] Expose record layout info via new libclang functions:

clang_Type_getAlignOf
clang_Type_getSizeOf
clang_Type_getOffsetOf
clang_Cursor_isBitField

Patch by Loïc Jaquemet!

llvm-svn: 179251

11 years agoForce a load when creating a reference to a temporary copied from a bitfield.
Jordan Rose [Thu, 11 Apr 2013 00:58:58 +0000 (00:58 +0000)]
Force a load when creating a reference to a temporary copied from a bitfield.

For this source:
  const int &ref = someStruct.bitfield;

We used to generate this AST:

  DeclStmt [...]
  `-VarDecl [...] ref 'const int &'
    `-MaterializeTemporaryExpr [...] 'const int' lvalue
      `-ImplicitCastExpr [...] 'const int' lvalue <NoOp>
        `-MemberExpr [...] 'int' lvalue bitfield .bitfield [...]
          `-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X'

Notice the lvalue inside the MaterializeTemporaryExpr, which is very
confusing (and caused an assertion to fire in the analyzer - PR15694).

We now generate this:

  DeclStmt [...]
  `-VarDecl [...] ref 'const int &'
    `-MaterializeTemporaryExpr [...] 'const int' lvalue
      `-ImplicitCastExpr [...] 'int' <LValueToRValue>
        `-MemberExpr [...] 'int' lvalue bitfield .bitfield [...]
          `-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X'

Which makes a lot more sense. This allows us to remove code in both
CodeGen and AST that hacked around this special case.

The commit also makes Clang accept this (legal) C++11 code:

  int &&ref = std::move(someStruct).bitfield

PR15694 / <rdar://problem/13600396>

llvm-svn: 179250

11 years agolit: Don't descend into .git directories during test discovery.
Daniel Dunbar [Thu, 11 Apr 2013 00:31:35 +0000 (00:31 +0000)]
lit: Don't descend into .git directories during test discovery.

llvm-svn: 179249

11 years agolit: Shorten a metavar to make --help look nicer.
Daniel Dunbar [Thu, 11 Apr 2013 00:31:27 +0000 (00:31 +0000)]
lit: Shorten a metavar to make --help look nicer.

llvm-svn: 179248

11 years agolit: Add a test for discovery when exact test names are given.
Daniel Dunbar [Thu, 11 Apr 2013 00:31:22 +0000 (00:31 +0000)]
lit: Add a test for discovery when exact test names are given.

llvm-svn: 179247

11 years agoUpdated the line on which to break for the formatters test
Enrico Granata [Thu, 11 Apr 2013 00:28:12 +0000 (00:28 +0000)]
Updated the line on which to break for the formatters test

Moving over to source-regex might be a good idea, but it’s not what we really want to test. Ideally, we would set a regex breakpoint to find the right line, then delete it and set one by file and line with the right line info from before.

llvm-svn: 179246

11 years agoAdded a Materializer class that contains
Sean Callanan [Thu, 11 Apr 2013 00:09:05 +0000 (00:09 +0000)]
Added a Materializer class that contains
information about each variable that needs to
be materialized for an expression to work.  The
next step is to migrate all materialization code
from ClangExpressionDeclMap to Materializer, and
to use it for variable materialization.

llvm-svn: 179245

11 years agoAdd man page for llvm-readobj
Nico Rieck [Thu, 11 Apr 2013 00:05:57 +0000 (00:05 +0000)]
Add man page for llvm-readobj

llvm-svn: 179244

11 years agolit: Add a trivial test of the basic progress bar.
Daniel Dunbar [Thu, 11 Apr 2013 00:05:37 +0000 (00:05 +0000)]
lit: Add a trivial test of the basic progress bar.

llvm-svn: 179243

11 years ago[analyzer] Refactoring: better doxygen comment; renaming isTrackedFamily to isTracked...
Anton Yartsev [Thu, 11 Apr 2013 00:05:20 +0000 (00:05 +0000)]
[analyzer] Refactoring: better doxygen comment; renaming isTrackedFamily to isTrackedByCurrentChecker

llvm-svn: 179242

11 years agoRewrite some of the test/CodeGen/X86 tests to use FileCheck instead of grep
Eli Bendersky [Wed, 10 Apr 2013 23:30:20 +0000 (23:30 +0000)]
Rewrite some of the test/CodeGen/X86 tests to use FileCheck instead of grep

llvm-svn: 179241

11 years agoMC: Support COFF image-relative MCSymbolRefs
Nico Rieck [Wed, 10 Apr 2013 23:28:17 +0000 (23:28 +0000)]
MC: Support COFF image-relative MCSymbolRefs

Add support for the COFF relocation types IMAGE_REL_I386_DIR32NB and
IMAGE_REL_AMD64_ADDR32NB for 32- and 64-bit respectively. These are
similar to normal 4-byte relocations except that they do not include
the base address of the image.

Image-relative relocations are used for debug information (32-bit) and
SEH unwind tables (64-bit).

A new MCSymbolRef variant called 'VK_COFF_IMGREL32' is introduced to
specify such relocations. For AT&T assembly, this variant can be accessed
using the symbol suffix '@imgrel'.

llvm-svn: 179240

11 years agoDelete the functions F1 and F2 to appease the valgrind bot.
Joey Gouly [Wed, 10 Apr 2013 23:21:26 +0000 (23:21 +0000)]
Delete the functions F1 and F2 to appease the valgrind bot.

llvm-svn: 179239

11 years agocomment parsing. Add couple more needed doxygen tags.
Fariborz Jahanian [Wed, 10 Apr 2013 23:10:42 +0000 (23:10 +0000)]
comment parsing. Add couple more needed doxygen tags.
// rdar://12379053

llvm-svn: 179238

11 years agoget rid of stdio.h include in testcase
Adrian Prantl [Wed, 10 Apr 2013 23:09:00 +0000 (23:09 +0000)]
get rid of stdio.h include in testcase

llvm-svn: 179237

11 years agoadd mips target requirement to testcase
Adrian Prantl [Wed, 10 Apr 2013 23:08:57 +0000 (23:08 +0000)]
add mips target requirement to testcase

llvm-svn: 179236

11 years ago[analyzer] Address Jordan’s review of r179219
Anna Zaks [Wed, 10 Apr 2013 22:56:33 +0000 (22:56 +0000)]
[analyzer] Address Jordan’s review of r179219

llvm-svn: 179235

11 years ago[analyzer] Address Jordan’s code review of r 179221
Anna Zaks [Wed, 10 Apr 2013 22:56:30 +0000 (22:56 +0000)]
[analyzer] Address Jordan’s code review of r 179221

llvm-svn: 179234

11 years agoScheduleOpt: Do not crash on statements with empty iteration domains
Tobias Grosser [Wed, 10 Apr 2013 22:48:08 +0000 (22:48 +0000)]
ScheduleOpt: Do not crash on statements with empty iteration domains

Statements with an empty iteration domain may not have a schedule assigned by
the isl schedule optimizer. As Polly expects each statement to have a schedule,
we keep the old schedule for such statements.

This fixes http://llvm.org/PR15645`

Reported-by: Johannes Doerfert <johannesdoerfert@gmx.de>
llvm-svn: 179233

11 years ago[analyzer] +Testcase: several used-after-free args passed to a function.
Anton Yartsev [Wed, 10 Apr 2013 22:36:16 +0000 (22:36 +0000)]
[analyzer] +Testcase: several used-after-free args passed to a function.

llvm-svn: 179232

11 years ago[analyzer] Switched to checkPreCall interface for detecting usage after free.
Anton Yartsev [Wed, 10 Apr 2013 22:21:41 +0000 (22:21 +0000)]
[analyzer] Switched to checkPreCall interface for detecting usage after free.

Now the check is also applied to arguments for Objective-C method calls and to 'this' pointer.

llvm-svn: 179230

11 years agoMips specific inline asm memory operand modifier test case
Jack Carter [Wed, 10 Apr 2013 22:10:45 +0000 (22:10 +0000)]
Mips specific inline asm memory operand modifier test case

These changes are based on commit responses for r179135.

llvm-svn: 179229

11 years ago[analyzer] Fix a crash in SyntaxCString checker when given a custom strncat.
Anna Zaks [Wed, 10 Apr 2013 22:06:29 +0000 (22:06 +0000)]
[analyzer] Fix a crash in SyntaxCString checker when given a custom strncat.

Fixes PR13476

llvm-svn: 179228

11 years agoManually remove successors in if conversion when CopyAndPredicateBlock is used
Hal Finkel [Wed, 10 Apr 2013 22:05:25 +0000 (22:05 +0000)]
Manually remove successors in if conversion when CopyAndPredicateBlock is used

In the simple and triangle if-conversion cases, when CopyAndPredicateBlock is
used because the to-be-predicated block has other predecessors, we need to
explicitly remove the old copied block from the successors list. Normally if
conversion relies on TII->AnalyzeBranch combined with BB->CorrectExtraCFGEdges
to cleanup the successors list, but if the predicated block contained an
un-analyzable branch (such as a now-predicated return), then this will fail.

These extra successors were causing a problem on PPC because it was causing
later passes (such as PPCEarlyReturm) to leave dead return-only basic blocks in
the code.

llvm-svn: 179227

11 years agoNo need to have this return a bool.
Bill Wendling [Wed, 10 Apr 2013 22:03:59 +0000 (22:03 +0000)]
No need to have this return a bool.

llvm-svn: 179226

11 years agoMips specific inline asm memory operand modifier test case
Jack Carter [Wed, 10 Apr 2013 22:02:32 +0000 (22:02 +0000)]
Mips specific inline asm memory operand modifier test case

These changes are based on commit responses for r179135.

llvm-svn: 179225

11 years agoMove info to CREDITS.TXT file.
Bill Wendling [Wed, 10 Apr 2013 21:56:52 +0000 (21:56 +0000)]
Move info to CREDITS.TXT file.

llvm-svn: 179224

11 years agofixed xsave, xsaveopt, xrstor mnemonics with intel syntax; added test cases
Kay Tiong Khoo [Wed, 10 Apr 2013 21:52:25 +0000 (21:52 +0000)]
fixed xsave, xsaveopt, xrstor mnemonics with intel syntax; added test cases

llvm-svn: 179223

11 years agoRevert "Update the version of dwarf we say we're emitting to at least 3."
Eric Christopher [Wed, 10 Apr 2013 21:45:07 +0000 (21:45 +0000)]
Revert "Update the version of dwarf we say we're emitting to at least 3."
temporarily while we work on plumbing through some changes to continue
supporting gdb on darwin.

This reverts commit r179122.

llvm-svn: 179222

11 years ago[analyzer] When reporting a leak in RetainCount checker due to an early exit from...
Anna Zaks [Wed, 10 Apr 2013 21:42:06 +0000 (21:42 +0000)]
[analyzer] When reporting a leak in RetainCount checker due to an early exit from init, step into init.

The heuristic here (proposed by Jordan) is that, usually, if a leak is due to an early exit from init, the allocation site will be
a call to alloc. Note that in other cases init resets self to [super init], which becomes the allocation site of the object.

llvm-svn: 179221

11 years agoTrack the compact unwind encoding for when we are unable to generate compact unwind...
Bill Wendling [Wed, 10 Apr 2013 21:42:06 +0000 (21:42 +0000)]
Track the compact unwind encoding for when we are unable to generate compact unwind information.

Compact unwind has an encoding for when we're not able to generate compact
unwind and must generate an EH frame instead. Track that, but still emit that CU
encoding.

llvm-svn: 179220

11 years ago[analyzer] Cleanup leak warnings: do not print the names of variables from other...
Anna Zaks [Wed, 10 Apr 2013 21:42:02 +0000 (21:42 +0000)]
[analyzer] Cleanup leak warnings: do not print the names of variables from other functions.

llvm-svn: 179219

11 years agoFor split dwarf we should also run the objcopy action if we're
Eric Christopher [Wed, 10 Apr 2013 21:30:40 +0000 (21:30 +0000)]
For split dwarf we should also run the objcopy action if we're
just assembling a file and have passed the option.

llvm-svn: 179218

11 years agoRemove unused arguments.
Chad Rosier [Wed, 10 Apr 2013 21:30:03 +0000 (21:30 +0000)]
Remove unused arguments.

llvm-svn: 179217

11 years ago[driver] Add a -Ofast option, which enables -O3, -ffast-math, and
Chad Rosier [Wed, 10 Apr 2013 21:26:02 +0000 (21:26 +0000)]
[driver] Add a -Ofast option, which enables -O3, -ffast-math, and
-fstrict-aliasing.
rdar://13622687

llvm-svn: 179216

11 years agofixed to disassemble with tab after mnemonic rather than space
Kay Tiong Khoo [Wed, 10 Apr 2013 21:17:58 +0000 (21:17 +0000)]
fixed to disassemble with tab after mnemonic rather than space

llvm-svn: 179215

11 years agoFileCheck-ify some clang grep tests that use double quotes
Reid Kleckner [Wed, 10 Apr 2013 21:10:39 +0000 (21:10 +0000)]
FileCheck-ify some clang grep tests that use double quotes

The escaping interaction between Python and grep doesn't work on my
system.  This change fixes the tests for me.

llvm-svn: 179214

11 years agoUse a real union for IdentifyingPassPtr.
Benjamin Kramer [Wed, 10 Apr 2013 20:50:44 +0000 (20:50 +0000)]
Use a real union for IdentifyingPassPtr.

This avoids a nasty const correctness issue (AnalysisIDs are const, Pass* isn't).

llvm-svn: 179213

11 years agoMarking myself as release manager.
Bill Wendling [Wed, 10 Apr 2013 20:13:28 +0000 (20:13 +0000)]
Marking myself as release manager.

If anyone objects please let me know.

llvm-svn: 179212

11 years agoIn the X86 back end, getMemoryOperandNo() returns the offset
Preston Gurd [Wed, 10 Apr 2013 20:11:59 +0000 (20:11 +0000)]
In the X86 back end, getMemoryOperandNo() returns the offset
into the operand array of the start of the memory reference descriptor.

Additional code in EncodeInstruction provides an additional adjustment.

This patch places that additional code in a separate function,
called getOperandBias, so that any caller of getMemoryOperandNo
can also call getOperandBias.

llvm-svn: 179211

11 years agoTidy up, fix and simplify a few of the SMLocs. Prior to r179109 the Start SMLoc
Chad Rosier [Wed, 10 Apr 2013 20:07:47 +0000 (20:07 +0000)]
Tidy up, fix and simplify a few of the SMLocs.  Prior to r179109 the Start SMLoc
wasn't always the start of the operand.  If there was a symbol reference, then
Start pointed to that token.  It's very likely there are other places that need
to be updated.

llvm-svn: 179210

11 years agoAdd object-emission flag for lit tests. This flag is used
Jyotsna Verma [Wed, 10 Apr 2013 19:53:26 +0000 (19:53 +0000)]
Add object-emission flag for lit tests. This flag is used
to disable following tests for Hexagon that require direct object
generation support.

DebugInfo/dwarf-public-names.ll
DebugInfo/dwarf-version.ll
DebugInfo/member-pointers.ll
DebugInfo/namespace.ll
DebugInfo/two-cus-from-same-file.ll

Fixes bug 15616 - http://llvm.org/bugs/show_bug.cgi?id=15616

llvm-svn: 179209

11 years agoAdd capability to demangle invocation functions for ObjC blocks.
Howard Hinnant [Wed, 10 Apr 2013 19:44:03 +0000 (19:44 +0000)]
Add capability to demangle invocation functions for ObjC blocks.

llvm-svn: 179208

11 years agoMake the SLP store-merger less paranoid about function calls. We check for function...
Nadav Rotem [Wed, 10 Apr 2013 19:41:36 +0000 (19:41 +0000)]
Make the SLP store-merger less paranoid about function calls. We check for function calls when we check if it is safe to sink instructions.

llvm-svn: 179207

11 years agoWe require DataLayout for analyzing the size of stores.
Nadav Rotem [Wed, 10 Apr 2013 18:57:27 +0000 (18:57 +0000)]
We require DataLayout for analyzing the size of stores.

llvm-svn: 179206

11 years agoRemove unused variable.
Chad Rosier [Wed, 10 Apr 2013 18:46:58 +0000 (18:46 +0000)]
Remove unused variable.

llvm-svn: 179205

11 years ago-fparse-all-comments: remove redundant check, as suggested by Fariborz Jahanian
Dmitri Gribenko [Wed, 10 Apr 2013 18:43:09 +0000 (18:43 +0000)]
-fparse-all-comments: remove redundant check, as suggested by Fariborz Jahanian

llvm-svn: 179204

11 years agoPPC: Don't predicate a diamond with two counter decrements
Hal Finkel [Wed, 10 Apr 2013 18:30:16 +0000 (18:30 +0000)]
PPC: Don't predicate a diamond with two counter decrements

I've not seen this happen in practice, and probably can't until we start
allowing decrement-counter-based conditional branches to be double predicated,
but just in case, don't allow predication of a diamond in which both sides have
ctr-defining branches. Even though the branching behavior of these can be
predicated, the counter-decrementing behavior cannot be.

llvm-svn: 179199

11 years ago[ms-inline asm] Move a few test cases from the 32-bit version to the 64-bit
Chad Rosier [Wed, 10 Apr 2013 18:08:17 +0000 (18:08 +0000)]
[ms-inline asm] Move a few test cases from the 32-bit version to the 64-bit
version as lea is only available in 64-bit mode.

llvm-svn: 179190

11 years agoReapply r179115, but use parsePrimaryExpression a little more judiciously.
Chad Rosier [Wed, 10 Apr 2013 17:35:30 +0000 (17:35 +0000)]
Reapply r179115, but use parsePrimaryExpression a little more judiciously.
Test cases that regressed due to r179115, plus a few more, were added in
r179182.  Original commit message below:

[ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need to
parse an identifier.  Otherwise, parseExpression may parse multiple tokens,
which makes it impossible to properly compute an immediate displacement.
An example of such a case is the source operand (i.e., [Symbol + ImmDisp]) in
the below example:

 __asm mov eax, [Symbol + ImmDisp]

Part of rdar://13611297

llvm-svn: 179187

11 years agoR600/SI: Add pattern for AMDGPUurecip
Michel Danzer [Wed, 10 Apr 2013 17:17:56 +0000 (17:17 +0000)]
R600/SI: Add pattern for AMDGPUurecip

21 more little piglits with radeonsi.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 179186

11 years agoThis is for an experimental option -mips-os16. The idea is to compile all
Reed Kotler [Wed, 10 Apr 2013 16:58:04 +0000 (16:58 +0000)]
This is for an experimental option -mips-os16. The idea is to compile all
Mips32 code as Mips16 unless it can't be compiled as Mips 16. For now this
would happen as long as floating point instructions are not needed.
Probably it would also make sense to compile as mips32 if atomic operations
are needed too. There may be other cases too.

A module pass prescans the IR and adds the mips16 or nomips16 attribute
to functions depending on the functions needs.

Mips 16 mode can result in a 40% code compression by utililizing 16 bit
encoding of many instructions.

The hope is for this to replace the traditional gcc way of dealing with
Mips16 code using floating point which involves essentially using soft float
but with a library implemented using mips32 floating point. This gcc
method also requires creating stubs so that Mips32 code can interact with
these Mips 16 functions that have floating point needs. My conjecture is
that in reality this traditional gcc method would never win over this
new method.

I will be implementing the traditional gcc method also. Some of it is already
done but I needed to do the stubs to finish the work and those required
this mips16/32 mixed mode capability.

I have more ideas for to make this new method much better and I think the old
method will just live in llvm for anyone that needs the backward compatibility
but I don't for what reason that would be needed.

llvm-svn: 179185

11 years agoUse a scheme closer to that of GNU as when deciding the type of a
Peter Collingbourne [Wed, 10 Apr 2013 16:52:15 +0000 (16:52 +0000)]
Use a scheme closer to that of GNU as when deciding the type of a
symbol with multiple .type declarations.

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

llvm-svn: 179184

11 years agofix testcase
Sebastian Pop [Wed, 10 Apr 2013 16:44:08 +0000 (16:44 +0000)]
fix testcase

llvm-svn: 179183

11 years ago[ms-inline asm] Add a few test cases that were regressed by r179115. That
Chad Rosier [Wed, 10 Apr 2013 16:33:34 +0000 (16:33 +0000)]
[ms-inline asm] Add a few test cases that were regressed by r179115.  That
commit was reverted in r179120, but I do plan on reapplying with a fix shortly.
Part of rdar://13611297

llvm-svn: 179182

11 years agoAdd testcases for -fparse-all-comments
Dmitri Gribenko [Wed, 10 Apr 2013 16:31:58 +0000 (16:31 +0000)]
Add testcases for -fparse-all-comments

llvm-svn: 179181

11 years agoAdd an option to parse all comments as documentation comments
Dmitri Gribenko [Wed, 10 Apr 2013 15:35:17 +0000 (15:35 +0000)]
Add an option to parse all comments as documentation comments

Patch by Amin Shali.

llvm-svn: 179180

11 years agoTemplate MachOObjectFile over endianness too.
Rafael Espindola [Wed, 10 Apr 2013 15:33:44 +0000 (15:33 +0000)]
Template MachOObjectFile over endianness too.

llvm-svn: 179179

11 years agoSimplify the templating a bit.
Rafael Espindola [Wed, 10 Apr 2013 15:18:39 +0000 (15:18 +0000)]
Simplify the templating a bit.

Since we only ever instantiate with a type that is a MachOType instantiation,
we don't need to pass template argument.

llvm-svn: 179178

11 years ago[ASan] Do not check the shadow of NULL argument in the time() interceptor.
Alexander Potapenko [Wed, 10 Apr 2013 15:13:00 +0000 (15:13 +0000)]
[ASan] Do not check the shadow of NULL argument in the time() interceptor.
Add a test for time().

llvm-svn: 179177

11 years agoMove two methods out of line.
Rafael Espindola [Wed, 10 Apr 2013 14:57:48 +0000 (14:57 +0000)]
Move two methods out of line.

llvm-svn: 179176