platform/upstream/llvm.git
11 years agoChange TargetLowering::getCondCodeAction to take an MVT, instead of
Patrik Hagglund [Tue, 11 Dec 2012 09:48:14 +0000 (09:48 +0000)]
Change TargetLowering::getCondCodeAction to take an MVT, instead of
EVT.

llvm-svn: 169842

11 years agoChange TargetLowering::getTruncStoreAction to take MVTs, instead of EVTs.
Patrik Hagglund [Tue, 11 Dec 2012 09:42:24 +0000 (09:42 +0000)]
Change TargetLowering::getTruncStoreAction to take MVTs, instead of EVTs.

llvm-svn: 169841

11 years agoChange TargetLowering::getLoadExtAction to take an MVT, instead of EVT.
Patrik Hagglund [Tue, 11 Dec 2012 09:39:09 +0000 (09:39 +0000)]
Change TargetLowering::getLoadExtAction to take an MVT, instead of EVT.

llvm-svn: 169840

11 years agoChange TargetLowering::setTypeAction to take an MVT, instead fo EVT.
Patrik Hagglund [Tue, 11 Dec 2012 09:32:56 +0000 (09:32 +0000)]
Change TargetLowering::setTypeAction to take an MVT, instead fo EVT.

llvm-svn: 169839

11 years agoChange TargetLowering::getRepRegClassFor to take an MVT, instead of
Patrik Hagglund [Tue, 11 Dec 2012 09:31:43 +0000 (09:31 +0000)]
Change TargetLowering::getRepRegClassFor to take an MVT, instead of
EVT.

Accordingly, change RegDefIter to contain MVTs instead of EVTs.

llvm-svn: 169838

11 years agoChange TargetLowering::getRegClassFor to take an MVT, instead of EVT.
Patrik Hagglund [Tue, 11 Dec 2012 09:10:33 +0000 (09:10 +0000)]
Change TargetLowering::getRegClassFor to take an MVT, instead of EVT.

Accordingly, add helper funtions getSimpleValueType (in parallel to
getValueType) in SDValue, SDNode, and TargetLowering.

This is the first, in a series of patches.

llvm-svn: 169837

11 years ago[asan] more sceleton code for asan_allocator2
Kostya Serebryany [Tue, 11 Dec 2012 09:02:36 +0000 (09:02 +0000)]
[asan] more sceleton code for asan_allocator2

llvm-svn: 169836

11 years agoExtend stat query APIs to explicitly specify if the query is for
Argyrios Kyrtzidis [Tue, 11 Dec 2012 07:48:23 +0000 (07:48 +0000)]
Extend stat query APIs to explicitly specify if the query is for
a file or directory, allowing just a stat call if a file descriptor
is not needed.

Doing just 'stat' is faster than 'open/fstat/close'.
This has the effect of cutting down system time for validating the input files of a PCH.

llvm-svn: 169831

11 years ago[PCH] Remove redundant stat call when validating the input files.
Argyrios Kyrtzidis [Tue, 11 Dec 2012 07:48:14 +0000 (07:48 +0000)]
[PCH] Remove redundant stat call when validating the input files.

This became redundant after we removed the stat cache.

llvm-svn: 169830

11 years ago[PCH] When writing out the list of input files, avoid emitting duplicate
Argyrios Kyrtzidis [Tue, 11 Dec 2012 07:48:08 +0000 (07:48 +0000)]
[PCH] When writing out the list of input files, avoid emitting duplicate
entries of the same file.

This can happen because the file was "included" multiple times and is
referenced by multiple SLocEntries.

llvm-svn: 169829

11 years ago[asan] fix the Windows build
Kostya Serebryany [Tue, 11 Dec 2012 07:27:59 +0000 (07:27 +0000)]
[asan] fix the Windows build

llvm-svn: 169828

11 years agoclang/test/Driver/linker-opts.c: Fix XFAIL that I removed win32.
NAKAMURA Takumi [Tue, 11 Dec 2012 07:23:52 +0000 (07:23 +0000)]
clang/test/Driver/linker-opts.c: Fix XFAIL that I removed win32.

Sorry for my 3rd commit :(

llvm-svn: 169827

11 years agoclang/test/Driver/debug-options-as.c: Fixup not to use prefix=S. I didn't know "REQUI...
NAKAMURA Takumi [Tue, 11 Dec 2012 07:16:15 +0000 (07:16 +0000)]
clang/test/Driver/debug-options-as.c: Fixup not to use prefix=S. I didn't know "REQUIRES:" would match --check-prefix=S ...

llvm-svn: 169826

11 years agoclang/test/Driver: Introduce the feature "clang-driver", set if gcc driver is not...
NAKAMURA Takumi [Tue, 11 Dec 2012 07:06:09 +0000 (07:06 +0000)]
clang/test/Driver: Introduce the feature "clang-driver", set if gcc driver is not used.

It is not set at targetting cygming. See PR12920.

llvm-svn: 169824

11 years agorevert the test change
Hao Liu [Tue, 11 Dec 2012 06:25:18 +0000 (06:25 +0000)]
revert the test change

llvm-svn: 169823

11 years ago[asan] make ThreadNamesTest more flexible
Kostya Serebryany [Tue, 11 Dec 2012 06:23:10 +0000 (06:23 +0000)]
[asan] make ThreadNamesTest more flexible

llvm-svn: 169822

11 years agoA newbie try a test commit
Hao Liu [Tue, 11 Dec 2012 06:22:54 +0000 (06:22 +0000)]
A newbie try a test commit

llvm-svn: 169821

11 years ago[CMake] Remove dependencies to intrinsics_gen I introduced in r169724.
NAKAMURA Takumi [Tue, 11 Dec 2012 05:53:54 +0000 (05:53 +0000)]
[CMake] Remove dependencies to intrinsics_gen I introduced in r169724.

llvm-svn: 169819

11 years agollvm/Target/TargetMachine.h: Remove two dependent headers.
NAKAMURA Takumi [Tue, 11 Dec 2012 05:53:43 +0000 (05:53 +0000)]
llvm/Target/TargetMachine.h: Remove two dependent headers.

-#include "llvm/Target/TargetTransformImpl.h"
-#include "llvm/TargetTransformInfo.h"

llvm-svn: 169818

11 years agollvm/tools: Add #include "llvm/TargetTransformInfo.h"
NAKAMURA Takumi [Tue, 11 Dec 2012 05:53:37 +0000 (05:53 +0000)]
llvm/tools: Add #include "llvm/TargetTransformInfo.h"

llvm-svn: 169817

11 years agoBackendUtil.cpp: Add #include "llvm/TargetTransformInfo.h"
NAKAMURA Takumi [Tue, 11 Dec 2012 05:53:24 +0000 (05:53 +0000)]
BackendUtil.cpp: Add #include "llvm/TargetTransformInfo.h"

llvm/Target/TargetMachine.h will not provide "llvm/TargetTransformInfo.h" any more.

llvm-svn: 169816

11 years agoAdd tests for a corner case of when to relax all instructions:
Rafael Espindola [Tue, 11 Dec 2012 05:52:24 +0000 (05:52 +0000)]
Add tests for a corner case of when to relax all instructions:

We don't want to relax all instructions in

$ clang -c test.s

since most users don't pass -O when using the driver to assemble.

On the other hand, -save-temps should not change the output unnecessary, so in

$ clang -c test.c -save-temps

we should relax all instructions.

llvm-svn: 169815

11 years agoUse multiclass for new-value store instructions with MEMri operand.
Jyotsna Verma [Tue, 11 Dec 2012 05:12:25 +0000 (05:12 +0000)]
Use multiclass for new-value store instructions with MEMri operand.

llvm-svn: 169814

11 years agoFix PR14565. Don't if-convert loops that have switch statements in them.
Nadav Rotem [Tue, 11 Dec 2012 04:55:10 +0000 (04:55 +0000)]
Fix PR14565. Don't if-convert loops that have switch statements in them.

llvm-svn: 169813

11 years agoChange some functions to take const pointers.
Rafael Espindola [Tue, 11 Dec 2012 03:10:43 +0000 (03:10 +0000)]
Change some functions to take const pointers.

llvm-svn: 169812

11 years agoStylistic tweak.
Evan Cheng [Tue, 11 Dec 2012 02:31:57 +0000 (02:31 +0000)]
Stylistic tweak.

llvm-svn: 169811

11 years agoBroadcast an event when the selected thread is changed.
Jim Ingham [Tue, 11 Dec 2012 02:31:48 +0000 (02:31 +0000)]
Broadcast an event when the selected thread is changed.

<rdar://problem/10976636>

llvm-svn: 169810

11 years ago<rdar://problem/12639506>
Enrico Granata [Tue, 11 Dec 2012 02:17:22 +0000 (02:17 +0000)]
<rdar://problem/12639506>

Make sure that the user's choice of a format for dumping aggregate types is persisted to child members

llvm-svn: 169809

11 years agoUpdate comments around ABISysV_x86_64::RegisterIsCalleeSaved to
Jason Molenda [Tue, 11 Dec 2012 01:20:57 +0000 (01:20 +0000)]
Update comments around ABISysV_x86_64::RegisterIsCalleeSaved to
make it clear that this is the list of callee-saved registers,
add reference to the ABI doc that this comes from.

llvm-svn: 169807

11 years ago<rdar://problem/12842032>
Greg Clayton [Tue, 11 Dec 2012 01:20:51 +0000 (01:20 +0000)]
<rdar://problem/12842032>

Don't load __LINKEDIT segments when dynamically loading kexts.

llvm-svn: 169806

11 years agoPR14558: Compute triviality of special members (etc) at the end of the class
Richard Smith [Tue, 11 Dec 2012 01:14:52 +0000 (01:14 +0000)]
PR14558: Compute triviality of special members (etc) at the end of the class
definition, rather than at the end of the definition of the set of nested
classes. We still defer checking of the user-specified exception specification
to the end of the nesting -- we can't check that until we've parsed the
in-class initializers for non-static data members.

llvm-svn: 169805

11 years agoAdd a triple to this test.
Chad Rosier [Tue, 11 Dec 2012 00:51:36 +0000 (00:51 +0000)]
Add a triple to this test.

llvm-svn: 169803

11 years agoFix a miscompile in the DAG combiner. Previously, we would incorrectly
Chandler Carruth [Tue, 11 Dec 2012 00:36:57 +0000 (00:36 +0000)]
Fix a miscompile in the DAG combiner. Previously, we would incorrectly
try to reduce the width of this load, and would end up transforming:

  (truncate (lshr (sextload i48 <ptr> as i64), 32) to i32)
to
  (truncate (zextload i32 <ptr+4> as i64) to i32)

We lost the sext attached to the load while building the narrower i32
load, and replaced it with a zext because lshr always zext's the
results. Instead, bail out of this combine when there is a conflict
between a sextload and a zext narrowing. The rest of the DAG combiner
still optimize the code down to the proper single instruction:

  movswl 6(...),%eax

Which is exactly what we wanted. Previously we read past the end *and*
missed the sign extension:

  movl 6(...), %eax

llvm-svn: 169802

11 years agomove X86-specific test
Paul Redmond [Tue, 11 Dec 2012 00:36:43 +0000 (00:36 +0000)]
move X86-specific test

This test case uses -mcpu=corei7 so it belongs in CodeGen/X86

Reviewed by: Nadav

llvm-svn: 169801

11 years agoRemoved debugging code.
Han Ming Ong [Tue, 11 Dec 2012 00:24:58 +0000 (00:24 +0000)]
Removed debugging code.

llvm-svn: 169799

11 years agoFix grammar-o.
Bill Wendling [Tue, 11 Dec 2012 00:23:07 +0000 (00:23 +0000)]
Fix grammar-o.

llvm-svn: 169798

11 years agoFall back to the selection dag isel to select tail calls.
Chad Rosier [Tue, 11 Dec 2012 00:18:02 +0000 (00:18 +0000)]
Fall back to the selection dag isel to select tail calls.

This shouldn't affect codegen for -O0 compiles as tail call markers are not
emitted in unoptimized compiles.  Testing with the external/internal nightly
test suite reveals no change in compile time performance.  Testing with -O1,
-O2 and -O3 with fast-isel enabled did not cause any compile-time or
execution-time failures.  All tests were performed on my x86 machine.
I'll monitor our arm testers to ensure no regressions occur there.

In an upcoming clang patch I will be marking the objc_autoreleaseReturnValue
and objc_retainAutoreleaseReturnValue as tail calls unconditionally.  While
it's theoretically true that this is just an optimization, it's an
optimization that we very much want to happen even at -O0, or else ARC
applications become substantially harder to debug.

Part of rdar://12553082

llvm-svn: 169796

11 years ago[analyzer] Don't generate a summary for "freeWhenDone" if method is
Anna Zaks [Tue, 11 Dec 2012 00:17:53 +0000 (00:17 +0000)]
[analyzer] Don't generate a summary for "freeWhenDone" if method is
inlined.

Fixes a false positive that occurs if a user writes their own
initWithBytesNoCopy:freeWhenDone wrapper.

llvm-svn: 169795

11 years ago[CMake] Fix external llvm build. It needs to know where llvm-tblgen is.
Michael J. Spencer [Mon, 10 Dec 2012 23:52:34 +0000 (23:52 +0000)]
[CMake] Fix external llvm build. It needs to know where llvm-tblgen is.

llvm-svn: 169794

11 years agoRefactor out the abbreviation handling into a separate class that
Eric Christopher [Mon, 10 Dec 2012 23:34:43 +0000 (23:34 +0000)]
Refactor out the abbreviation handling into a separate class that
controls each of the abbreviation sets (only a single one at the
moment) and computes offsets separately as well for each set
of DIEs.

No real function change, ordering of abbreviations for the skeleton
CU changed but only because we're computing in a separate order. Fix
the testcase not to care.

llvm-svn: 169793

11 years ago<rdar://problem/12709976>
Enrico Granata [Mon, 10 Dec 2012 23:30:25 +0000 (23:30 +0000)]
<rdar://problem/12709976>

Adding a summary for NSError

llvm-svn: 169792

11 years agoSome enhancements for memcpy / memset inline expansion.
Evan Cheng [Mon, 10 Dec 2012 23:21:26 +0000 (23:21 +0000)]
Some enhancements for memcpy / memset inline expansion.
1. Teach it to use overlapping unaligned load / store to copy / set the trailing
   bytes. e.g. On 86, use two pairs of movups / movaps for 17 - 31 byte copies.
2. Use f64 for memcpy / memset on targets where i64 is not legal but f64 is. e.g.
   x86 and ARM.
3. When memcpy from a constant string, do *not* replace the load with a constant
   if it's not possible to materialize an integer immediate with a single
   instruction (required a new target hook: TLI.isIntImmLegal()).
4. Use unaligned load / stores more aggressively if target hooks indicates they
   are "fast".
5. Update ARM target hooks to use unaligned load / stores. e.g. vld1.8 / vst1.8.
   Also increase the threshold to something reasonable (8 for memset, 4 pairs
   for memcpy).

This significantly improves Dhrystone, up to 50% on ARM iOS devices.

rdar://12760078

llvm-svn: 169791

11 years agoOptimistically analyse Phi cycles
Arnold Schwaighofer [Mon, 10 Dec 2012 23:02:41 +0000 (23:02 +0000)]
Optimistically analyse Phi cycles

Analyse Phis under the starting assumption that they are NoAlias. Recursively
look at their inputs.
If they MayAlias/MustAlias there must be an input that makes them so.

Addresses bug 14351.

llvm-svn: 169788

11 years ago<rdar://problem/12850287>
Han Ming Ong [Mon, 10 Dec 2012 23:02:33 +0000 (23:02 +0000)]
<rdar://problem/12850287>

When there is XPC connection error, we will report it now.

llvm-svn: 169787

11 years agoDefer call to InitSections until after MCContext has been initialized. If
Lang Hames [Mon, 10 Dec 2012 22:49:11 +0000 (22:49 +0000)]
Defer call to InitSections until after MCContext has been initialized. If
InitSections is called before the MCContext is initialized it could cause
duplicate temporary symbols to be emitted later (after context initialization
resets the temporary label counter).

llvm-svn: 169785

11 years agoFix PR14568: Avoid the DFA packetizer from making an invalid read
Anshuman Dasgupta [Mon, 10 Dec 2012 22:45:57 +0000 (22:45 +0000)]
Fix PR14568: Avoid the DFA packetizer from making an invalid read
beyond array bounds.

No test case since I cannot reproduce an ICE with this bug. According
to Carlos -- the bug reporter -- a segfault occurs only when LLVM is
compiled with a specific version of GCC.

llvm-svn: 169783

11 years ago<rdar://problem/11844604>
Greg Clayton [Mon, 10 Dec 2012 22:26:34 +0000 (22:26 +0000)]
<rdar://problem/11844604>

When displaying function.name-with-args format will now print "varname=<unavailable>" instead of omitting argument names and values when there is an error reading the value.

llvm-svn: 169781

11 years agoRearrange vars and make comments more obvious.
Eric Christopher [Mon, 10 Dec 2012 22:25:41 +0000 (22:25 +0000)]
Rearrange vars and make comments more obvious.

llvm-svn: 169780

11 years agoRemove blank line at top of file.
Eric Christopher [Mon, 10 Dec 2012 22:25:38 +0000 (22:25 +0000)]
Remove blank line at top of file.

llvm-svn: 169779

11 years agoRemove until I can fix this.
Bill Wendling [Mon, 10 Dec 2012 22:10:53 +0000 (22:10 +0000)]
Remove until I can fix this.

llvm-svn: 169778

11 years agoFix a coding style nit.
Eric Christopher [Mon, 10 Dec 2012 22:00:20 +0000 (22:00 +0000)]
Fix a coding style nit.

llvm-svn: 169776

11 years agoAdd support to Darwin for the -export_dynamic' flag to the linker.
Bill Wendling [Mon, 10 Dec 2012 21:48:41 +0000 (21:48 +0000)]
Add support to Darwin for the -export_dynamic' flag to the linker.

llvm-svn: 169775

11 years agoEnable the loop vectorizer only on O2 and above. (Still disabled by default)
Nadav Rotem [Mon, 10 Dec 2012 21:45:01 +0000 (21:45 +0000)]
Enable the loop vectorizer only on O2 and above. (Still disabled by default)

llvm-svn: 169774

11 years agoLegalizeDAG: Allow type promotion of scalar loads
Tom Stellard [Mon, 10 Dec 2012 21:41:58 +0000 (21:41 +0000)]
LegalizeDAG: Allow type promotion of scalar loads

llvm-svn: 169773

11 years agoLegalizeDAG: Allow type promotion for scalar stores
Tom Stellard [Mon, 10 Dec 2012 21:41:54 +0000 (21:41 +0000)]
LegalizeDAG: Allow type promotion for scalar stores

llvm-svn: 169772

11 years agoSplit the LoopVectorizer into H and CPP.
Nadav Rotem [Mon, 10 Dec 2012 21:39:02 +0000 (21:39 +0000)]
Split the LoopVectorizer into H and CPP.

llvm-svn: 169771

11 years agoRevert r169656.
Bill Wendling [Mon, 10 Dec 2012 21:33:45 +0000 (21:33 +0000)]
Revert r169656.

The linker will call `lto_codegen_add_must_preserve_symbol' on all globals that
should be kept around. The linker will pretend that a dylib is being created.
<rdar://problem/12528059>

llvm-svn: 169770

11 years agoUse correct flags for this test.
Bill Wendling [Mon, 10 Dec 2012 21:15:22 +0000 (21:15 +0000)]
Use correct flags for this test.

llvm-svn: 169768

11 years agoEnable RTTI for liblldbCore.a when GCC is the compiler
Daniel Malea [Mon, 10 Dec 2012 21:05:57 +0000 (21:05 +0000)]
Enable RTTI for liblldbCore.a when GCC is the compiler
- gcc does not like -fno-rtti mixed with dynamic_cast<> (in cxa_demangle.cpp)

llvm-svn: 169767

11 years agoAdd a test for explicitly exercising the mc-relax-all flag.
Eli Bendersky [Mon, 10 Dec 2012 20:36:01 +0000 (20:36 +0000)]
Add a test for explicitly exercising the mc-relax-all flag.

llvm-svn: 169764

11 years agoFixup test case from r169755. These are driver options, not frontend options.
Chad Rosier [Mon, 10 Dec 2012 20:16:17 +0000 (20:16 +0000)]
Fixup test case from r169755.  These are driver options, not frontend options.
Also, add the -S option.

llvm-svn: 169763

11 years agoCleanup formatting, comments and naming.
Eli Bendersky [Mon, 10 Dec 2012 20:13:43 +0000 (20:13 +0000)]
Cleanup formatting, comments and naming.

llvm-svn: 169762

11 years agoReturn true from HeaderSearch::isFileMultipleIncludeGuarded if the file
Argyrios Kyrtzidis [Mon, 10 Dec 2012 20:08:37 +0000 (20:08 +0000)]
Return true from HeaderSearch::isFileMultipleIncludeGuarded if the file
was #import'ed.

llvm-svn: 169761

11 years ago[mips] Set HWEncoding field of registers. Use delete function
Akira Hatanaka [Mon, 10 Dec 2012 20:04:40 +0000 (20:04 +0000)]
[mips] Set HWEncoding field of registers. Use delete function
getMipsRegisterNumbering and use MCRegisterInfo::getEncodingValue instead.

llvm-svn: 169760

11 years ago<rdar://problem/12848118>
Enrico Granata [Mon, 10 Dec 2012 19:55:53 +0000 (19:55 +0000)]
<rdar://problem/12848118>

Making MightHaveChildren() always return true regardless for our own data formatters
This is meant to optimize performance for common most-often-not-empty container classes

llvm-svn: 169759

11 years agoUse the somewhat semantic term "split dwarf" it more matches what's
Eric Christopher [Mon, 10 Dec 2012 19:51:21 +0000 (19:51 +0000)]
Use the somewhat semantic term "split dwarf" it more matches what's
going on and makes a lot of the terminology in comments make more sense.

llvm-svn: 169758

11 years agoDelete the FissionCU.
Eric Christopher [Mon, 10 Dec 2012 19:51:18 +0000 (19:51 +0000)]
Delete the FissionCU.

llvm-svn: 169757

11 years agoReorder fission variables.
Eric Christopher [Mon, 10 Dec 2012 19:51:13 +0000 (19:51 +0000)]
Reorder fission variables.

llvm-svn: 169756

11 years agoSpecify if `-mno-red-zone' was used when creating the GCOV instrucmentation pass.
Bill Wendling [Mon, 10 Dec 2012 19:47:53 +0000 (19:47 +0000)]
Specify if `-mno-red-zone' was used when creating the GCOV instrucmentation pass.

This prevents the functions generated by that pass from using the red zone.
<rdar://problem/12843084>

llvm-svn: 169755

11 years agoDon't use a red zone for code coverage if the user specified `-mno-red-zone'.
Bill Wendling [Mon, 10 Dec 2012 19:46:49 +0000 (19:46 +0000)]
Don't use a red zone for code coverage if the user specified `-mno-red-zone'.

The `-mno-red-zone' flag wasn't being propagated to the functions that code
coverage generates. This allowed some of them to use the red zone when that
wasn't allowed.
<rdar://problem/12843084>

llvm-svn: 169754

11 years ago<rdar://problem/12827031>
Greg Clayton [Mon, 10 Dec 2012 19:43:43 +0000 (19:43 +0000)]
<rdar://problem/12827031>

Fix the OptionValueFileSpec option value to correctly get the file path when trailing spaces are on the path. The "settings set" command uses the OptionValueFileSpec class to set file paths and if extra spaces are at the end it will include those in the paths. Now we chop up the value send to to OptionValueFileSpec::SetValueFromCString(...) function with "lldb_private::Args" and give an appropriate error if more than one path is used. It also allows for quotes to be used when specifying the path.

llvm-svn: 169753

11 years agoAdd support for reverse induction variables. For example:
Nadav Rotem [Mon, 10 Dec 2012 19:25:06 +0000 (19:25 +0000)]
Add support for reverse induction variables. For example:

while (i--)
 sum+=A[i];

llvm-svn: 169752

11 years ago<rdar://problem/12817233>
Enrico Granata [Mon, 10 Dec 2012 19:23:00 +0000 (19:23 +0000)]
<rdar://problem/12817233>

Change the wording of NSNumber summary from absurd value to unexpected value when a tagged pointer shows up that does not match our knowledge of the internals

llvm-svn: 169751

11 years agoMake sure that the lldb globals:
Greg Clayton [Mon, 10 Dec 2012 19:18:23 +0000 (19:18 +0000)]
Make sure that the lldb globals:
    lldb.target
    lldb.process
    lldb.thread
    lldb.frame

are initialized to at least contain empty lldb classes in case some python gets imported that uses them.

llvm-svn: 169750

11 years agoCMake: Don't run 'git svn' if there is no .git/svn directory.
Jim Grosbach [Mon, 10 Dec 2012 19:03:37 +0000 (19:03 +0000)]
CMake: Don't run 'git svn' if there is no .git/svn directory.

If the local checkout does not have 'git svn' references set up, don't try
to use 'git svn' for version information.

llvm-svn: 169749

11 years agoThis patch adds statistics for other non-DWARF fragments emitted by
Eli Bendersky [Mon, 10 Dec 2012 18:59:39 +0000 (18:59 +0000)]
This patch adds statistics for other non-DWARF fragments emitted by
the assembler. This is useful in order to know how the numbers add up,
since in particular the Align fragments account for a non-trivial
portion of the emitted fragments (especially on -O0 which sets
relax-all).

llvm-svn: 169747

11 years agoAddi formatting tests for pointer template parameters.
Daniel Jasper [Mon, 10 Dec 2012 18:59:13 +0000 (18:59 +0000)]
Addi formatting tests for pointer template parameters.

Fix spacing before ",".

llvm-svn: 169746

11 years agoUse GetUnderlyingObjects in misched
Hal Finkel [Mon, 10 Dec 2012 18:49:16 +0000 (18:49 +0000)]
Use GetUnderlyingObjects in misched

misched used GetUnderlyingObject in order to break false load/store
dependencies, and the -enable-aa-sched-mi feature similarly relied on
GetUnderlyingObject in order to ensure it is safe to use the aliasing analysis.
Unfortunately, GetUnderlyingObject does not recurse through phi nodes, and so
(especially due to LSR) all of these mechanisms failed for
induction-variable-dependent loads and stores inside loops.

This change replaces uses of GetUnderlyingObject with GetUnderlyingObjects
(which will recurse through phi and select instructions) in misched.

Andy reviewed, tested and simplified this patch; Thanks!

llvm-svn: 169744

11 years agoRemove unneeded typedef and volatile
Michael Ilseman [Mon, 10 Dec 2012 18:48:08 +0000 (18:48 +0000)]
Remove unneeded typedef and volatile

llvm-svn: 169743

11 years agoFix funky copy-pasted grammatical error.
Sean Silva [Mon, 10 Dec 2012 18:37:26 +0000 (18:37 +0000)]
Fix funky copy-pasted grammatical error.

PR14343

llvm-svn: 169742

11 years agoRevert "Make '-mtune=x86_64' assume fast unaligned memory accesses."
Chandler Carruth [Mon, 10 Dec 2012 18:23:52 +0000 (18:23 +0000)]
Revert "Make '-mtune=x86_64' assume fast unaligned memory accesses."

Accidental commit... git svn betrayed me. Sorry for the noise.

llvm-svn: 169741

11 years agoMake '-mtune=x86_64' assume fast unaligned memory accesses.
Chandler Carruth [Mon, 10 Dec 2012 18:22:42 +0000 (18:22 +0000)]
Make '-mtune=x86_64' assume fast unaligned memory accesses.

Summary:
Not all chips targeted by x86_64 have this feature, but a dramatically
increasing number do. Specifying a chip-specific tuning parameter will
continue to turn the feature on or off as appropriate for that
particular chip, but the generic flag should try to achieve the best
performance on the most widely available hardware. Today, the number of
chips with fast UA access dwarfs those without in the x86-64 space.

Note that this also brings LLVM's code generation for this '-march' flag
more in line with that of modern GCCs.

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D195

llvm-svn: 169740

11 years agoFix a typo in my previous commit -- bloomfield is 0x1A not 0x2A.
Chandler Carruth [Mon, 10 Dec 2012 18:22:40 +0000 (18:22 +0000)]
Fix a typo in my previous commit -- bloomfield is 0x1A not 0x2A.

Thanks to the PaX folks for noticing in review! We need some tests here,
any sugestions welcome...

llvm-svn: 169739

11 years agoClang-format: error recovery for access specifiers
Alexander Kornienko [Mon, 10 Dec 2012 16:34:48 +0000 (16:34 +0000)]
Clang-format: error recovery for access specifiers

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D198

llvm-svn: 169738

11 years agoClarifying comments for the MatchFinder and matchesNames matcher.
Manuel Klimek [Mon, 10 Dec 2012 16:13:06 +0000 (16:13 +0000)]
Clarifying comments for the MatchFinder and matchesNames matcher.

llvm-svn: 169737

11 years ago[ASan] Typo fix in memcpy() and memmove() interceptors: ASAN_WRITE_RANGE and ASAN_REA...
Alexander Potapenko [Mon, 10 Dec 2012 16:02:13 +0000 (16:02 +0000)]
[ASan] Typo fix in memcpy() and memmove() interceptors: ASAN_WRITE_RANGE and ASAN_READ_RANGE were swapped.
This has been spotted by Anna Zaks (ganna@apple.com)

llvm-svn: 169736

11 years ago[asan] move FakeStack into a separate file
Kostya Serebryany [Mon, 10 Dec 2012 14:19:15 +0000 (14:19 +0000)]
[asan] move FakeStack into a separate file

llvm-svn: 169734

11 years ago[asan] introduce asan_allocator2.cc, which will have the replacement for asan allocat...
Kostya Serebryany [Mon, 10 Dec 2012 13:52:55 +0000 (13:52 +0000)]
[asan] introduce asan_allocator2.cc, which will have the replacement for asan allocator (now, just a bit of boilerplate)

llvm-svn: 169733

11 years agoAdd a libsanitizer API __sanitizer_sandbox_on_notify(void* reserved), which should...
Alexander Potapenko [Mon, 10 Dec 2012 13:10:40 +0000 (13:10 +0000)]
Add a libsanitizer API __sanitizer_sandbox_on_notify(void* reserved), which should be used by
the client programs to notify the tools that sandboxing is about to be turned on.

llvm-svn: 169732

11 years agoAddress a FIXME and update the fast unaligned memory feature for newer
Chandler Carruth [Mon, 10 Dec 2012 09:18:44 +0000 (09:18 +0000)]
Address a FIXME and update the fast unaligned memory feature for newer
Intel chips.

The model number rules were determined by inspecting Intel's
documentation for their newer chip model numbers. My understanding is
that all of the newer Intel chips have fast unaligned memory access, but
if anyone is concerned about a particular chip, just shout.

No tests updated; it's not clear we have dedicated tests for the chips'
various features, but if anyone would like tests (or can point me at
some existing ones), I'm happy to oblige.

llvm-svn: 169730

11 years agotsan: exclude flaky test
Dmitry Vyukov [Mon, 10 Dec 2012 09:16:17 +0000 (09:16 +0000)]
tsan: exclude flaky test

llvm-svn: 169729

11 years agoAdd a new visitor for walking the uses of a pointer value.
Chandler Carruth [Mon, 10 Dec 2012 08:28:39 +0000 (08:28 +0000)]
Add a new visitor for walking the uses of a pointer value.

This visitor provides infrastructure for recursively traversing the
use-graph of a pointer-producing instruction like an alloca or a malloc.
It maintains a worklist of uses to visit, so it can handle very deep
recursions. It automatically looks through instructions which simply
translate one pointer to another (bitcasts and GEPs). It tracks the
offset relative to the original pointer as long as that offset remains
constant and exposes it during the visit as an APInt offset. Finally, it
performs conservative escape analysis.

However, currently it has some limitations that should be addressed
going forward:
1) It doesn't handle vectors of pointers.
2) It doesn't provide a cheaper visitor when the constant offset
   tracking isn't needed.
3) It doesn't support non-instruction pointer values.

The current functionality is exactly what is required to implement the
SROA pointer-use visitors in terms of this one, rather than in terms of
their own ad-hoc base visitor, which was always very poorly specified.
SROA has been converted to use this, and the code there deleted which
this utility now provides.

Technically speaking, using this new visitor allows SROA to handle a few
more cases than it previously did. It is now more aggressive in ignoring
chains of instructions which look like they would defeat SROA, but in
fact do not because they never result in a read or write of memory.
While this is "neat", it shouldn't be interesting for real programs as
any such chains should have been removed by others passes long before we
get to SROA. As a consequence, I've not added any tests for these
features -- it shouldn't be part of SROA's contract to perform such
heroics.

The goal is to extend the functionality of this visitor going forward,
and re-use it from passes like ASan that can benefit from doing
a detailed walk of the uses of a pointer.

Thanks to Ben Kramer for the code review rounds and lots of help
reviewing and debugging this patch.

llvm-svn: 169728

11 years agoTeach DAG combine to handle vector add/sub with vectors of all 0s.
Craig Topper [Mon, 10 Dec 2012 08:12:29 +0000 (08:12 +0000)]
Teach DAG combine to handle vector add/sub with vectors of all 0s.

llvm-svn: 169727

11 years ago[CMake] TARGET_TRIPLE may be internal alias of LLVM_DEFAULT_TARGET_TRIPLE.
NAKAMURA Takumi [Mon, 10 Dec 2012 07:14:29 +0000 (07:14 +0000)]
[CMake] TARGET_TRIPLE may be internal alias of LLVM_DEFAULT_TARGET_TRIPLE.

llvm-svn: 169726

11 years agoAdding tests since when I was asked whether this works I wasn't
Manuel Klimek [Mon, 10 Dec 2012 07:08:53 +0000 (07:08 +0000)]
Adding tests since when I was asked whether this works I wasn't
100% sure.

llvm-svn: 169725

11 years ago[CMake] Update dependencies to intrinsics_gen corresponding to r169711.
NAKAMURA Takumi [Mon, 10 Dec 2012 05:27:15 +0000 (05:27 +0000)]
[CMake] Update dependencies to intrinsics_gen corresponding to r169711.

llvm-svn: 169724

11 years ago[Driver] Add test.
Michael J. Spencer [Mon, 10 Dec 2012 02:53:10 +0000 (02:53 +0000)]
[Driver] Add test.

llvm-svn: 169721

11 years agoRevert to old behavior until linker can pass export-dynamic option.
Bill Wendling [Mon, 10 Dec 2012 02:51:16 +0000 (02:51 +0000)]
Revert to old behavior until linker can pass export-dynamic option.

llvm-svn: 169720

11 years agoFix PR14548: SROA was crashing on a mixture of i1 and i8 loads and stores.
Chandler Carruth [Mon, 10 Dec 2012 00:54:45 +0000 (00:54 +0000)]
Fix PR14548: SROA was crashing on a mixture of i1 and i8 loads and stores.

When SROA was evaluating a mixture of i1 and i8 loads and stores, in
just a particular case, it would tickle a latent bug where we compared
bits to bytes rather than bits to bits. As a consequence of the latent
bug, we would allow integers through which were not byte-size multiples,
a situation the later rewriting code was never intended to handle.

In release builds this could trigger all manner of oddities, but the
reported issue in PR14548 was forming invalid bitcast instructions.

The only downside of this fix is that it makes it more clear that SROA
in its current form is not capable of handling mixed i1 and i8 loads and
stores. Sometimes with the previous code this would work by luck, but
usually it would crash, so I'm not terribly worried. I'll watch the LNT
numbers just to be sure.

llvm-svn: 169719

11 years ago[Driver] Properly handle -entry for X86 Linux.
Michael J. Spencer [Sun, 9 Dec 2012 23:56:37 +0000 (23:56 +0000)]
[Driver] Properly handle -entry for X86 Linux.

llvm-svn: 169718