platform/upstream/llvm.git
11 years agoFix ivar ordering for Process ctor to match the order they're
Jason Molenda [Tue, 5 Mar 2013 03:33:59 +0000 (03:33 +0000)]
Fix ivar ordering for Process ctor to match the order they're
declared in the .h file.

llvm-svn: 176473

11 years agoscan-build: explicitly say "No bugs found" if there are no reports.
Jordan Rose [Tue, 5 Mar 2013 02:33:08 +0000 (02:33 +0000)]
scan-build: explicitly say "No bugs found" if there are no reports.

Patch by Martin Storsjo!

llvm-svn: 176472

11 years agollvm/test/CodeGen/Mips/mips64-f128.ll: Add explicit -mtriple=mips64el-unknown-unknown...
NAKAMURA Takumi [Tue, 5 Mar 2013 02:18:59 +0000 (02:18 +0000)]
llvm/test/CodeGen/Mips/mips64-f128.ll: Add explicit -mtriple=mips64el-unknown-unknown to appease win32.

FIXME: Is it expected for win32 to affect mips targets?
llvm-svn: 176471

11 years agollvm/test/CodeGen/Thumb/iabs.ll: Add explicit -mtriple=thumb-unknown-unknown to appea...
NAKAMURA Takumi [Tue, 5 Mar 2013 02:18:52 +0000 (02:18 +0000)]
llvm/test/CodeGen/Thumb/iabs.ll: Add explicit -mtriple=thumb-unknown-unknown to appease win32 hosts.

llvm-svn: 176470

11 years agoSilence a number of static analyzer warnings with assertions and such.
Jordan Rose [Tue, 5 Mar 2013 01:27:54 +0000 (01:27 +0000)]
Silence a number of static analyzer warnings with assertions and such.

No functionality change.

llvm-svn: 176469

11 years agodoc parsing. We want to issue a strong warning when
Fariborz Jahanian [Tue, 5 Mar 2013 01:05:07 +0000 (01:05 +0000)]
doc parsing. We want to issue a strong warning when
an @function comment is not followed by a function decl.
// rdar://13094352

llvm-svn: 176468

11 years agoRemove unused #includes.
Bill Wendling [Tue, 5 Mar 2013 01:00:45 +0000 (01:00 +0000)]
Remove unused #includes.

llvm-svn: 176467

11 years agoupdate how libcompiler_rt.dylib links under libSystem.dylib on MacOSX
Nick Kledzik [Tue, 5 Mar 2013 00:16:52 +0000 (00:16 +0000)]
update how libcompiler_rt.dylib links under libSystem.dylib on MacOSX

llvm-svn: 176466

11 years agoAdded summary option to cpp11-migrate tool
Dmitri Gribenko [Tue, 5 Mar 2013 00:12:33 +0000 (00:12 +0000)]
Added summary option to cpp11-migrate tool

Added a summary option that enables output to stdout counting the number of
changes each transform has accepted, rejected or deferred.

Patch by Ariel Bernal.

llvm-svn: 176465

11 years agoThe current X86 NOP padding uses one long NOP followed by the remainder in
David Sehr [Tue, 5 Mar 2013 00:02:23 +0000 (00:02 +0000)]
The current X86 NOP padding uses one long NOP followed by the remainder in
one-byte NOPs.  If the processor actually executes those NOPs, as it sometimes
does with aligned bundling, this can have a performance impact.  From my
micro-benchmarks run on my one machine, a 15-byte NOP followed by twelve
one-byte NOPs is about 20% worse than a 15 followed by a 12.  This patch
changes NOP emission to emit as many 15-byte (the maximum) as possible followed
by at most one shorter NOP.

llvm-svn: 176464

11 years ago[analyzer] Don't let cf_audited_transfer override CFRetain semantics.
Jordan Rose [Mon, 4 Mar 2013 23:21:32 +0000 (23:21 +0000)]
[analyzer] Don't let cf_audited_transfer override CFRetain semantics.

We weren't treating a cf_audited_transfer CFRetain as returning +1 because
its name doesn't contain "Create" or "Copy". Oops! Fortunately, the
standard definitions of these functions are not marked audited.

<rdar://problem/13339601>

llvm-svn: 176463

11 years agoUn-skipping tests affected by llvm.org/pr15256
Daniel Malea [Mon, 4 Mar 2013 23:15:08 +0000 (23:15 +0000)]
Un-skipping tests affected by llvm.org/pr15256

patch by Ashok Thirumurthi!

llvm-svn: 176462

11 years agoComment parsing: refactor handling of command markers in AST
Dmitri Gribenko [Mon, 4 Mar 2013 23:06:15 +0000 (23:06 +0000)]
Comment parsing: refactor handling of command markers in AST

* Use the term 'command marker', because the semantics of 'backslash' and 'at'
  commands are the same.  (Talking about 'at commands' makes them look like a
  special entity.)

* Sink the flag down into bitfields, reducing the size of AST nodes.

* Change the flag into an enum for clarity.  Boolean function parameters are
  not very clear.

* Add unittests for new tok::at_command tokens.

llvm-svn: 176461

11 years agoFix makefile and re-enable test disabled due to llvm.org/pr15256
Daniel Malea [Mon, 4 Mar 2013 23:04:53 +0000 (23:04 +0000)]
Fix makefile and re-enable test disabled due to llvm.org/pr15256
- fix is: don't pass incompatible -stdlib option when building with GCC

llvm-svn: 176460

11 years agoCheck isDiscardableIfUnused, rather than hasLocalLinkage, when bumping
Lang Hames [Mon, 4 Mar 2013 22:40:44 +0000 (22:40 +0000)]
Check isDiscardableIfUnused, rather than hasLocalLinkage, when bumping
GlobalValue linkage up to ExternalLinkage in the ExtractGV pass. This
prevents linkonce and linkonce_odr symbols from being DCE'd.

llvm-svn: 176459

11 years agoAdd ARM v6m, v7m, and v7em architectures for Cortex-M series processors.
Bob Wilson [Mon, 4 Mar 2013 22:37:49 +0000 (22:37 +0000)]
Add ARM v6m, v7m, and v7em architectures for Cortex-M series processors.

<rdar://problem/11314476>

llvm-svn: 176458

11 years agoTidy up lists of Cortex-A series processors, adding entries for A7.
Bob Wilson [Mon, 4 Mar 2013 22:37:46 +0000 (22:37 +0000)]
Tidy up lists of Cortex-A series processors, adding entries for A7.

Also fix a missing entry for cortex-r5 in one copy of getLLVMArchSuffixForARM.

llvm-svn: 176457

11 years agoFix confused use of llvm::StringSwitch for armv7r architecture.
Bob Wilson [Mon, 4 Mar 2013 22:37:43 +0000 (22:37 +0000)]
Fix confused use of llvm::StringSwitch for armv7r architecture.

svn 170909 added support for cortex-r5 but in this case it was done
incorrectly. The last argument to StringSwitch.Cases() is the replacement
value, so by adding "cortex-r5" it changed the default cpu for armv7r to
cortex-r5 instead of cortex-r4.

llvm-svn: 176456

11 years ago[mips] Print move instructions.
Akira Hatanaka [Mon, 4 Mar 2013 22:25:01 +0000 (22:25 +0000)]
[mips] Print move instructions.

"move $4, $5" is printed instead of "or $4, $5, $zero".

llvm-svn: 176455

11 years ago<rdar://problem/13338643>
Greg Clayton [Mon, 4 Mar 2013 21:46:16 +0000 (21:46 +0000)]
<rdar://problem/13338643>

DWARF with .o files now uses 40-60% less memory!

Big fixes include:
- Change line table internal representation to contain "file addresses". Since each line table is owned by a compile unit that is owned by a module, it makes address translation into lldb_private::Address easy to do when needed.
- Removed linked address members/methods from lldb_private::Section and lldb_private::Address
- lldb_private::LineTable can now relink itself using a FileRangeMap to make it easier to re-link line tables in the future
- Added ObjectFile::ClearSymtab() so that we can get rid of the object file symbol tables after we parse them once since they are not needed and kept memory allocated for no reason
- Moved the m_sections_ap (std::auto_ptr to section list) and m_symtab_ap (std::auto_ptr to the lldb_private::Symtab) out of each of the ObjectFile subclasses and put it into lldb_private::ObjectFile.
- Changed how the debug map is parsed and stored to be able to:
    - Lazily parse the debug map for each object file
    - not require the address map for a .o file until debug information is linked for a .o file

llvm-svn: 176454

11 years agoMips specific inline assembler constraint 'R'
Jack Carter [Mon, 4 Mar 2013 21:36:11 +0000 (21:36 +0000)]
Mips specific inline assembler constraint 'R'

'R' An address that can be sued in a non-macro load or store.
This patch includes a positive test case.

llvm-svn: 176453

11 years agoMips specific inline assembler constraint 'R'
Jack Carter [Mon, 4 Mar 2013 21:33:15 +0000 (21:33 +0000)]
Mips specific inline assembler constraint 'R'

'R' An address that can be sued in a non-macro load or store.
This patch includes a positive test case.

llvm-svn: 176452

11 years ago<rdar://problem/13338758>
Han Ming Ong [Mon, 4 Mar 2013 21:25:51 +0000 (21:25 +0000)]
<rdar://problem/13338758>

Make it configurable what to profile.
For Mac, we don't use the dirty page size yet and hence there is no need to gather that. This should be way better in not draining the battery since we are operating between 0% to 0.1% on the Mac after this change.

llvm-svn: 176451

11 years ago[PCH] In HeaderFileInfoTrait::EqualKey(), use FileManager::getFile() to compare two...
Argyrios Kyrtzidis [Mon, 4 Mar 2013 20:33:40 +0000 (20:33 +0000)]
[PCH] In HeaderFileInfoTrait::EqualKey(), use FileManager::getFile() to compare two filenames, instead of llvm::sys::fs::equivalent().

llvm::sys::fs::equivalent() does 2 stat calls every time it's called. Use FileManager::getFile() to take advantage
of the stat caching that FileManager is providing.

llvm-svn: 176450

11 years agoComment parsing tests: move a test into a group of similar tests
Dmitri Gribenko [Mon, 4 Mar 2013 20:23:16 +0000 (20:23 +0000)]
Comment parsing tests: move a test into a group of similar tests

llvm-svn: 176449

11 years ago[comment parsing] source fidelity for tparam command too.
Fariborz Jahanian [Mon, 4 Mar 2013 20:08:47 +0000 (20:08 +0000)]
[comment parsing] source fidelity for tparam command too.
// rdar://13066276

llvm-svn: 176448

11 years agoMake sure to not split string literals at the first character.
Manuel Klimek [Mon, 4 Mar 2013 20:03:38 +0000 (20:03 +0000)]
Make sure to not split string literals at the first character.

llvm-svn: 176447

11 years agoPrint function names under --polly-report
Tobias Grosser [Mon, 4 Mar 2013 19:49:51 +0000 (19:49 +0000)]
Print function names under --polly-report

llvm-svn: 176446

11 years agowarn-documentation.cpp: reorganize tests
Dmitri Gribenko [Mon, 4 Mar 2013 19:39:33 +0000 (19:39 +0000)]
warn-documentation.cpp: reorganize tests

Tests are ordered by command in this file.  It is nice to keep it that way.

llvm-svn: 176445

11 years agocomment parsing. Missed a case of referring
Fariborz Jahanian [Mon, 4 Mar 2013 18:53:41 +0000 (18:53 +0000)]
comment parsing. Missed a case of referring
to original command in diagnostic. // rdar://13066276

llvm-svn: 176444

11 years agoReapply r176381, writing the CHECKs in a more forgiving manner to account for
Eli Bendersky [Mon, 4 Mar 2013 18:20:31 +0000 (18:20 +0000)]
Reapply r176381, writing the CHECKs in a more forgiving manner to account for
running llvm-objdump on Darwin.

llvm-svn: 176443

11 years agoBypass Slow Divides
Preston Gurd [Mon, 4 Mar 2013 18:13:57 +0000 (18:13 +0000)]
Bypass Slow Divides

* Only apply divide bypass optimization when not optimizing for size.
* Fixed bug caused by constant for 0 value of type Int32,
  used dividend type to generate the constant instead.
* For atom x86-64 apply the divide bypass to use 16-bit divides instead of
  64-bit divides when operand values are small enough.
* Added lit tests for 64-bit divide bypass.

Patch by Tyler Nowicki!

llvm-svn: 176442

11 years agohasQualifer() matcher should return false if there's no qualifier
Edwin Vane [Mon, 4 Mar 2013 17:51:00 +0000 (17:51 +0000)]
hasQualifer() matcher should return false if there's no qualifier

Instead of passing NULL on to sub-matcher, just return false. Updated tests and
regenerated docs.

Author: Tareq A Siraj <tareq.a.siraj@intel.com>
llvm-svn: 176441

11 years agoR600: Use the GPU type to determine the correct DataLayout v2
Tom Stellard [Mon, 4 Mar 2013 17:40:53 +0000 (17:40 +0000)]
R600: Use the GPU type to determine the correct DataLayout v2

v2:
  - Add R600_DOUBLE_OPS for RV670
  - s/CPU/GPU/

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
llvm-svn: 176440

11 years agoR600: Clean up datalayout strings so they better match hardware capabilities
Tom Stellard [Mon, 4 Mar 2013 17:40:28 +0000 (17:40 +0000)]
R600: Clean up datalayout strings so they better match hardware capabilities

llvm-svn: 176439

11 years ago<rdar://problem/12897838>
Enrico Granata [Mon, 4 Mar 2013 17:20:57 +0000 (17:20 +0000)]
<rdar://problem/12897838>

Making sure we do not try to copy memory at address 0 - that would make us crash

llvm-svn: 176438

11 years agoAdding failing LoopConvert testcase
Edwin Vane [Mon, 4 Mar 2013 16:56:04 +0000 (16:56 +0000)]
Adding failing LoopConvert testcase

LoopConvert isn't properly handling iterators whose dereference operator
returns by value. This test case demonstrates the failure.

See PR15437.

llvm-svn: 176437

11 years agoProperly identify 'this' as range-based for container
Edwin Vane [Mon, 4 Mar 2013 16:35:04 +0000 (16:35 +0000)]
Properly identify 'this' as range-based for container

The Loop-Convert transform was mistransforming loops using 'this' implicitly.
Fixed and added tests.

Fixes PR15411.

llvm-svn: 176436

11 years agoFormat a line if a range in its leading whitespace was selected.
Daniel Jasper [Mon, 4 Mar 2013 13:43:19 +0000 (13:43 +0000)]
Format a line if a range in its leading whitespace was selected.

With [] marking the selected range, clang-format invoked on

    [  ]   int a;

Would so far not reformat anything. With this patch, it formats a
line if its leading whitespace is touched.

llvm-svn: 176435

11 years agoMake the tutorial easier to compile by adding in some of the details.
Manuel Klimek [Mon, 4 Mar 2013 11:31:46 +0000 (11:31 +0000)]
Make the tutorial easier to compile by adding in some of the details.

Patch by BĂ©atrice Creusillet.

llvm-svn: 176434

11 years agoCorrection to r176432: the bug actually fixed was <rdar://13025708>.
John McCall [Mon, 4 Mar 2013 07:35:41 +0000 (07:35 +0000)]
Correction to r176432: the bug actually fixed was <rdar://13025708>.

llvm-svn: 176433

11 years agoCentralize and refine the __unknown_anytype argument rules
John McCall [Mon, 4 Mar 2013 07:34:02 +0000 (07:34 +0000)]
Centralize and refine the __unknown_anytype argument rules
and be sure to apply them whether or not the debugger gave
us a method declaration.

rdar://12565338

llvm-svn: 176432

11 years agoFix the emission of the copy-initialization of a block capture
John McCall [Mon, 4 Mar 2013 06:32:36 +0000 (06:32 +0000)]
Fix the emission of the copy-initialization of a block capture
from a lambda capture when the capture is not trivially-copyable.

rdar://13295759

llvm-svn: 176431

11 years ago[ELF] no functionality change, update dynamicTable functionality
Shankar Easwaran [Mon, 4 Mar 2013 02:21:16 +0000 (02:21 +0000)]
[ELF] no functionality change, update dynamicTable functionality

llvm-svn: 176430

11 years agoCheck for warnings in a bunch of the linker invocations, and add one
Chandler Carruth [Mon, 4 Mar 2013 02:07:55 +0000 (02:07 +0000)]
Check for warnings in a bunch of the linker invocations, and add one
with both -static-libgcc and -static on the commandline.

Fix a warning in the latter case due to a backwards short circuiting ||
operator in the driver. No real functionality changed here, just allows
the driver to properly consume -static-libgcc when -static is also
specified.

llvm-svn: 176429

11 years agoPerform non-overload placeholder conversions on the operands
John McCall [Mon, 4 Mar 2013 01:30:55 +0000 (01:30 +0000)]
Perform non-overload placeholder conversions on the operands
to a subscript operator.

rdar://13332183

llvm-svn: 176428

11 years agoBeef up the testing of our 'ld' invocation on linux to cover static
Chandler Carruth [Mon, 4 Mar 2013 01:27:49 +0000 (01:27 +0000)]
Beef up the testing of our 'ld' invocation on linux to cover static
linking. About to fix a bug here and there was no good test case.

llvm-svn: 176427

11 years agoMips ISD typo
Jia Liu [Mon, 4 Mar 2013 01:06:54 +0000 (01:06 +0000)]
Mips ISD typo

llvm-svn: 176426

11 years ago[lld][ELF] Add modified writer
Shankar Easwaran [Sun, 3 Mar 2013 22:10:57 +0000 (22:10 +0000)]
[lld][ELF] Add modified writer

llvm-svn: 176425

11 years ago[lld][ELF] rename to add new support in the ELF Writer
Shankar Easwaran [Sun, 3 Mar 2013 22:09:22 +0000 (22:09 +0000)]
[lld][ELF] rename to add new support in the ELF Writer

llvm-svn: 176424

11 years agoAdd an idea for a cpp11-migrate tool: TR1 migration
Dmitri Gribenko [Sun, 3 Mar 2013 17:54:36 +0000 (17:54 +0000)]
Add an idea for a cpp11-migrate tool: TR1 migration

Idea by Marshall Clow.

llvm-svn: 176423

11 years agoRemove unused check from test.
David Chisnall [Sun, 3 Mar 2013 17:50:06 +0000 (17:50 +0000)]
Remove unused check from test.

llvm-svn: 176422

11 years ago[docs] Spelling
Sean Silva [Sun, 3 Mar 2013 17:07:35 +0000 (17:07 +0000)]
[docs] Spelling

llvm-svn: 176421

11 years agoImprove C11 atomics support:
David Chisnall [Sun, 3 Mar 2013 16:02:42 +0000 (16:02 +0000)]
Improve C11 atomics support:

- Generate atomicrmw operations in most of the cases when it's sensible to do
  so.
- Don't crash in several common cases (and hopefully don't crash in more of
  them).
- Add some better tests.

We now generate significantly better code for things like:
_Atomic(int) x;
...
x++;

On MIPS, this now generates a 4-instruction ll/sc loop, where previously it
generated about 30 instructions in two nested loops.  On x86-64, we generate a
single lock incl, instead of a lock cmpxchgl loop (one instruction instead of
ten).

llvm-svn: 176420

11 years agoDefault to enabling default-synthesized ivars on all platforms
David Chisnall [Sun, 3 Mar 2013 15:36:10 +0000 (15:36 +0000)]
Default to enabling default-synthesized ivars on all platforms

llvm-svn: 176419

11 years ago[docs] Use vim code-block instead of console.
Sean Silva [Sun, 3 Mar 2013 15:17:35 +0000 (15:17 +0000)]
[docs] Use vim code-block instead of console.

llvm-svn: 176418

11 years ago.gitignore: ignore docs/_build
Sean Silva [Sun, 3 Mar 2013 15:15:12 +0000 (15:15 +0000)]
.gitignore: ignore docs/_build

That is where the documentation gets built to.

I'm pretty much clueless about SVN; I would appreciate if someone more
knowledgeable about SVN made the equivalent change.

llvm-svn: 176417

11 years ago[ELF] rename Writer to ExecutableWriter
Shankar Easwaran [Sun, 3 Mar 2013 07:37:17 +0000 (07:37 +0000)]
[ELF] rename Writer to ExecutableWriter

llvm-svn: 176416

11 years ago[ELF][Hexagon] add initial changes to add GOT/PLT
Shankar Easwaran [Sun, 3 Mar 2013 07:34:56 +0000 (07:34 +0000)]
[ELF][Hexagon] add initial changes to add GOT/PLT

llvm-svn: 176415

11 years agoProcess #pragma weak only after we know the linkage of the function or variable
Rafael Espindola [Sat, 2 Mar 2013 21:41:48 +0000 (21:41 +0000)]
Process #pragma weak only after we know the linkage of the function or variable
we are looking at.

llvm-svn: 176414

11 years agoARM: Creating a vector from a lane of another.
Jim Grosbach [Sat, 2 Mar 2013 20:16:24 +0000 (20:16 +0000)]
ARM: Creating a vector from a lane of another.

The VDUP instruction source register doesn't allow a non-constant lane
index, so make sure we don't construct a ARM::VDUPLANE node asking it to
do so.

rdar://13328063
http://llvm.org/bugs/show_bug.cgi?id=13963

llvm-svn: 176413

11 years agoClean up code format a bit.
Jim Grosbach [Sat, 2 Mar 2013 20:16:19 +0000 (20:16 +0000)]
Clean up code format a bit.

llvm-svn: 176412

11 years agoTidy up. Trailing whitespace.
Jim Grosbach [Sat, 2 Mar 2013 20:16:15 +0000 (20:16 +0000)]
Tidy up. Trailing whitespace.

llvm-svn: 176411

11 years agoARM NEON: Fix v2f32 float intrinsics
Arnold Schwaighofer [Sat, 2 Mar 2013 19:38:33 +0000 (19:38 +0000)]
ARM NEON: Fix v2f32 float intrinsics

Mark them as expand, they are not legal as our backend does not match them.

llvm-svn: 176410

11 years agoMake gen_my_std.h.py compatible with python 2.5 too.
Benjamin Kramer [Sat, 2 Mar 2013 15:52:55 +0000 (15:52 +0000)]
Make gen_my_std.h.py compatible with python 2.5 too.

llvm-svn: 176409

11 years agorecommit r172363 & r171325 (reverted in r172756)
Nuno Lopes [Sat, 2 Mar 2013 11:36:24 +0000 (11:36 +0000)]
recommit r172363 & r171325 (reverted in r172756)
This adds minimalistic support for PHI nodes to llvm.objectsize() evaluation

fingers crossed so that it does break clang boostrap again..

llvm-svn: 176408

11 years agoadd getUnderlyingObjectSize()
Nuno Lopes [Sat, 2 Mar 2013 11:23:34 +0000 (11:23 +0000)]
add getUnderlyingObjectSize()
this is similar to getObjectSize(), but doesnt subtract the offset
tweak the BasicAA code accordingly (per PR14988)

llvm-svn: 176407

11 years agoMake the UseAuto test case generator compatible with python 2.5.
Benjamin Kramer [Sat, 2 Mar 2013 09:24:42 +0000 (09:24 +0000)]
Make the UseAuto test case generator compatible with python 2.5.

llvm-svn: 176406

11 years agoProcessMachCore had (until 2013-01-29) some simple checks to find a kernel
Jason Molenda [Sat, 2 Mar 2013 07:19:32 +0000 (07:19 +0000)]
ProcessMachCore had (until 2013-01-29) some simple checks to find a kernel
in a core file if it didn't start at the beginning of a memory segment.
I added more sophisticated kernel location code to DynamicLoaderDarwinKernel
and removed the simple one in ProcessMachCore.  Unfortunately the kernel
DynamicLoader doesn't get a chance to search around in memory unless there's
a hint that this might be a kernel debug session.  It was easy ot make the
kernel location code static in DynamicLoaderDarwinKernel and call it from
ProcessMachCore on the start of the session, so that's what I did.
<rdar://problem/13326647>

llvm-svn: 176405

11 years agoCommandLineArgumentParser: handle single quotes.
Peter Collingbourne [Sat, 2 Mar 2013 06:00:16 +0000 (06:00 +0000)]
CommandLineArgumentParser: handle single quotes.

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

llvm-svn: 176404

11 years agoX86 cost model: Adjust cost for custom lowered vector multiplies
Arnold Schwaighofer [Sat, 2 Mar 2013 04:02:52 +0000 (04:02 +0000)]
X86 cost model: Adjust cost for custom lowered vector multiplies

This matters for example in following matrix multiply:

int **mmult(int rows, int cols, int **m1, int **m2, int **m3) {
  int i, j, k, val;
  for (i=0; i<rows; i++) {
    for (j=0; j<cols; j++) {
      val = 0;
      for (k=0; k<cols; k++) {
        val += m1[i][k] * m2[k][j];
      }
      m3[i][j] = val;
    }
  }
  return(m3);
}

Taken from the test-suite benchmark Shootout.

We estimate the cost of the multiply to be 2 while we generate 9 instructions
for it and end up being quite a bit slower than the scalar version (48% on my
machine).

Also, properly differentiate between avx1 and avx2. On avx-1 we still split the
vector into 2 128bits and handle the subvector muls like above with 9
instructions.
Only on avx-2 will we have a cost of 9 for v4i64.

I changed the test case in test/Transforms/LoopVectorize/X86/avx1.ll to use an
add instead of a mul because with a mul we now no longer vectorize. I did
verify that the mul would be indeed more expensive when vectorized with 3
kernels:

for (i ...)
   r += a[i] * 3;
for (i ...)
  m1[i] = m1[i] * 3; // This matches the test case in avx1.ll
and a matrix multiply.

In each case the vectorized version was considerably slower.

radar://13304919

llvm-svn: 176403

11 years ago[analyzer] Simple inline defensive checks suppression
Anna Zaks [Sat, 2 Mar 2013 03:20:52 +0000 (03:20 +0000)]
[analyzer] Simple inline defensive checks suppression

Inlining brought a few "null pointer use" false positives, which occur because
the callee defensively checks if a pointer is NULL, whereas the caller knows
that the pointer cannot be NULL in the context of the given call.

This is a first attempt to silence these warnings by tracking the symbolic value
along the execution path in the BugReporter. The new visitor finds the node
in which the symbol was first constrained to NULL. If the node belongs to
a function on the active stack, the warning is reported, otherwise, it is
suppressed.

There are several areas for follow up work, for example:
 - How do we differentiate the cases where the first check is followed by
another one, which does happen on the active stack?

Also, this only silences a fraction of null pointer use warnings. For example, it
does not do anything for the cases where NULL was assigned inside a callee.

llvm-svn: 176402

11 years agoSome refactoring in my patch on document
Fariborz Jahanian [Sat, 2 Mar 2013 02:39:57 +0000 (02:39 +0000)]
Some refactoring in my patch on document
command source fidelity. // rdar://13066276

llvm-svn: 176401

11 years agoAdded FIXME for future Hexagon cleanup.
Andrew Trick [Sat, 2 Mar 2013 01:43:08 +0000 (01:43 +0000)]
Added FIXME for future Hexagon cleanup.

llvm-svn: 176400

11 years agoPR14448 - prevent the loop vectorizer from vectorizing the same loop twice.
Nadav Rotem [Sat, 2 Mar 2013 01:33:49 +0000 (01:33 +0000)]
PR14448 - prevent the loop vectorizer from vectorizing the same loop twice.
The LoopVectorizer often runs multiple times on the same function due to inlining.
When this happens the loop vectorizer often vectorizes the same loops multiple times, increasing code size and adding unneeded branches.
With this patch, the vectorizer during vectorization puts metadata on scalar loops and marks them as 'already vectorized' so that it knows to ignore them when it sees them a second time.

PR14448.

llvm-svn: 176399

11 years agoLLVM API changes.
Peter Collingbourne [Sat, 2 Mar 2013 01:20:22 +0000 (01:20 +0000)]
LLVM API changes.

llvm-svn: 176398

11 years agoModify {Call,Invoke}Inst::addAttribute to take an AttrKind.
Peter Collingbourne [Sat, 2 Mar 2013 01:20:18 +0000 (01:20 +0000)]
Modify {Call,Invoke}Inst::addAttribute to take an AttrKind.

llvm-svn: 176397

11 years agoCMake: Always include the CheckCXXCompilerFlag in HandleLLVMOptions.cmake.
Jordan Rose [Sat, 2 Mar 2013 01:00:40 +0000 (01:00 +0000)]
CMake: Always include the CheckCXXCompilerFlag in HandleLLVMOptions.cmake.

Previously we relied on it being included by config-ix.cmake.

llvm-svn: 176396

11 years agoRevert "Rewrite a test to count emitted instructions without using -stats"
Michael Gottesman [Sat, 2 Mar 2013 00:53:20 +0000 (00:53 +0000)]
Revert "Rewrite a test to count emitted instructions without using -stats"

This reverts commit aac7922b8fe7ae733d3fe6697e6789fd730315dc. I am reverting the
commit since it broke the phase 1 public buildbot for a few hours.

http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RA/builds/2137

llvm-svn: 176394

11 years agoCMake: -Wno-nested-anon-types for Clang.
Jordan Rose [Sat, 2 Mar 2013 00:49:47 +0000 (00:49 +0000)]
CMake: -Wno-nested-anon-types for Clang.

In LLVM, -pedantic is not set unless LLVM_ENABLE_PEDANTIC is set.
However, Clang's CMakeLists.txt unilaterally adds -pedantic to the run
line, so we need to disable -Wnested-anon-types explicitly.

llvm-svn: 176393

11 years agoConvert from the C-based LLVM Disassembler shim to the full MC Disassembler API's.
Jim Ingham [Sat, 2 Mar 2013 00:26:47 +0000 (00:26 +0000)]
Convert from the C-based LLVM Disassembler shim to the full MC Disassembler API's.
Calculate "can branch" using the MC API's rather than our hand-rolled regex'es.
As extra credit, allow setting the disassembly flavor for x86 based architectures to intel or att.

<rdar://problem/11319574>
<rdar://problem/9329275>

llvm-svn: 176392

11 years agoRemove duplicate line and move another closer to its actual use
Eli Bendersky [Fri, 1 Mar 2013 23:32:40 +0000 (23:32 +0000)]
Remove duplicate line and move another closer to its actual use

llvm-svn: 176391

11 years agoMIsched machine model: tablegen subtarget emitter improvement.
Andrew Trick [Fri, 1 Mar 2013 23:31:26 +0000 (23:31 +0000)]
MIsched machine model: tablegen subtarget emitter improvement.

Fix the way resources are counted. I'm taking some time to cleanup the
way MachineScheduler handles in-order machine resources. Eventually
we'll need more PPC/Atom test cases in tree.

llvm-svn: 176390

11 years ago[analyzer] Update open source checker build to checker-272.
Jordan Rose [Fri, 1 Mar 2013 23:26:05 +0000 (23:26 +0000)]
[analyzer] Update open source checker build to checker-272.

See http://clang-analyzer.llvm.org/release_notes.html for what's new
in this build.

llvm-svn: 176389

11 years ago[analyzer] Special-case bitfields when finding sub-region bindings.
Jordan Rose [Fri, 1 Mar 2013 23:03:17 +0000 (23:03 +0000)]
[analyzer] Special-case bitfields when finding sub-region bindings.

Previously we were assuming that we'd never ask for the sub-region bindings
of a bitfield, since a bitfield cannot have subregions. However,
unification of code paths has made that assumption invalid. While we could
take advantage of this by just checking for the single possible binding,
it's probably better to do the right thing, so that if/when we someday
support unions we'll do the right thing there, too.

This fixes a handful of false positives in analyzing LLVM.

<rdar://problem/13325522>

llvm-svn: 176388

11 years agocomment parsing. Keep the original command format
Fariborz Jahanian [Fri, 1 Mar 2013 22:51:30 +0000 (22:51 +0000)]
comment parsing. Keep the original command format
in AST for source fidelity and use it in diagnostics
to refer to the original format. // rdar://13066276

llvm-svn: 176387

11 years agoIn llvm::MemoryBuffer::getFile() remove an unnecessary stat call check.
Argyrios Kyrtzidis [Fri, 1 Mar 2013 22:48:51 +0000 (22:48 +0000)]
In llvm::MemoryBuffer::getFile() remove an unnecessary stat call check.

The sys::fs::is_directory() check is unnecessary because, if the filename is
a directory, the function will fail anyway with the same error code returned.
Remove the check to avoid an unnecessary stat call.

Someone needs to review on windows and see if the check is necessary there or not.

llvm-svn: 176386

11 years agoFix my email address in CREDITS.TXT.
Stefanus Du Toit [Fri, 1 Mar 2013 22:20:03 +0000 (22:20 +0000)]
Fix my email address in CREDITS.TXT.

Checking to see if svn notifications also use correct address now.

llvm-svn: 176385

11 years ago[mips] Fix inefficient code generation.
Akira Hatanaka [Fri, 1 Mar 2013 21:52:08 +0000 (21:52 +0000)]
[mips] Fix inefficient code generation.

This patch eliminates the need to emit a constant move instruction when this
pattern is matched:

(select (setgt a, Constant), T, F)

The pattern above effectively turns into this:

(conditional-move (setlt a, Constant + 1), F, T)

llvm-svn: 176384

11 years agoFix typos: [Dd]iagnosic -> [Dd]iagnostic
Stefanus Du Toit [Fri, 1 Mar 2013 21:41:22 +0000 (21:41 +0000)]
Fix typos: [Dd]iagnosic -> [Dd]iagnostic

These all appear in comments or (ironically) diagnostics output.

llvm-svn: 176383

11 years agoRemoved extraneous #include "LLVMContextImpl.h" from lib/IR/Module.cpp
Jean-Luc Duprat [Fri, 1 Mar 2013 21:37:24 +0000 (21:37 +0000)]
Removed extraneous #include "LLVMContextImpl.h" from lib/IR/Module.cpp

llvm-svn: 176382

11 years agoRewrite a test to count emitted instructions without using -stats
Eli Bendersky [Fri, 1 Mar 2013 21:34:37 +0000 (21:34 +0000)]
Rewrite a test to count emitted instructions without using -stats

Also removed the comments of "should produce..." because they completely
don't match the actually produced output.

llvm-svn: 176381

11 years agoFix indentation.
Akira Hatanaka [Fri, 1 Mar 2013 21:22:21 +0000 (21:22 +0000)]
Fix indentation.

llvm-svn: 176380

11 years agoAvoid parallelism problems generating lit.site.cfgs
Edwin Vane [Fri, 1 Mar 2013 21:21:37 +0000 (21:21 +0000)]
Avoid parallelism problems generating lit.site.cfgs

extra/test/cpp11-migrate/Makefile was using the same tmp file for generating
lit.site.cfg for two different directories. Parallelism caused conflicts so now
using differently named temp files.

llvm-svn: 176379

11 years agoSet properties for f128 type.
Akira Hatanaka [Fri, 1 Mar 2013 21:11:44 +0000 (21:11 +0000)]
Set properties for f128 type.

llvm-svn: 176378

11 years agoRewrite a test to check actual output rather than intermediate implementation
Eli Bendersky [Fri, 1 Mar 2013 20:54:00 +0000 (20:54 +0000)]
Rewrite a test to check actual output rather than intermediate implementation
detail.

The was this test was written, it was relying on an implementation detail
(fixups) and hence was very brittle (relying, among other things, on the
exact ordering of statistics printed by MC).

The test was rewritten to check a more observable output difference. While it
doesn't cover 100% of the things the original test covered, it's a good
practice to write regression tests this way. If we want to check that
internal details and invariants hold, such tests should be expressed as unit
tests.

llvm-svn: 176377

11 years agocpp11-migrate: Reduce the number of parsing passes.
Stefanus Du Toit [Fri, 1 Mar 2013 20:53:43 +0000 (20:53 +0000)]
cpp11-migrate: Reduce the number of parsing passes.

Previously we would check the syntax of the file before we transform
it, but that's redundant since it'll be checked as part of the
transformation. Remove that check completely.

We also had an unconditional syntax check after transforming. This
is only really useful to debug cpp11-migrate, since users will end
up compiling the transformed source anyways, and the transformations
*should* never introduce a failure. Made this an option, accessible
via "-final-syntax-check".

Resolves PR 15380.

llvm-svn: 176376

11 years agoMove m_destroy_in_process to Process (from ProcessKDP) since it is generally useful,
Jim Ingham [Fri, 1 Mar 2013 20:04:25 +0000 (20:04 +0000)]
Move m_destroy_in_process to Process (from ProcessKDP) since it is generally useful,
and use it to keep from doing the OS Plugin UpdateThreadList while destroying, since
if that does anything that requires the API lock it may deadlock against whoever is
running the Process::Destroy.

<rdar://problem/13308627>

llvm-svn: 176375

11 years agoNo need to force-create clang-tools-extra lit.site.cfg
Edwin Vane [Fri, 1 Mar 2013 19:58:58 +0000 (19:58 +0000)]
No need to force-create clang-tools-extra lit.site.cfg

The make (all) target takes care of creating lit configs and auto-generating
tests. The problem with the original 'lit.site.cfg' target is it's not
recursive and doesn't fully create everything necessary for testing
clang-tools-extra.

llvm-svn: 176374

11 years agoFix recursive make in clang-tools-extra
Edwin Vane [Fri, 1 Mar 2013 19:50:52 +0000 (19:50 +0000)]
Fix recursive make in clang-tools-extra

Autoconf make (all) now properly recurses from tools/extra/Makefile into
tools/extra/test/Makefile and tools/extra/test/cpp11-migrate/Makefile. The
'all' target is responsible for creating lit config files and autogenerating
tests. Subsequent 'check-all' targets will properly work.

Re-enabling UseAuto/iterator.cpp test.

General clean-up of clang-tools-extra makefiles; removing dead targets and
removing duplicated pieces of llvm/Makefile.rules.

llvm-svn: 176373