platform/upstream/llvm.git
11 years agoAdd a new hook for providing register allocator hints more flexibly.
Jakob Stoklund Olesen [Mon, 3 Dec 2012 21:17:00 +0000 (21:17 +0000)]
Add a new hook for providing register allocator hints more flexibly.

The TargetRegisterInfo::getRegAllocationHints() function is going to
replace the existing mechanisms for providing target-dependent hints to
the register allocator: ResolveRegAllocHint() and
getRawAllocationOrder().

The new hook is more flexible because it allows the target to provide
multiple preferred candidate registers for each virtual register, and it
is easier to use because targets are not required to return a reference
to a constant array like getRawAllocationOrder().

An optional VirtRegMap argument can be used to provide target-dependent
hints that depend on the provisional assignments of other virtual
registers.

llvm-svn: 169154

11 years agoDefine load instructions with base+immediate offset addressing mode
Jyotsna Verma [Mon, 3 Dec 2012 21:13:13 +0000 (21:13 +0000)]
Define load instructions with base+immediate offset addressing mode
using multiclass.

llvm-svn: 169153

11 years agoAdd initial support for IF-conversion. This patch implements the first 1/3,
Nadav Rotem [Mon, 3 Dec 2012 21:06:35 +0000 (21:06 +0000)]
Add initial support for IF-conversion. This patch implements the first 1/3,
which is the legality of the if-conversion transformation. The next step is to
implement the cost-model for the if-converted code as well as the
vectorization itself.

llvm-svn: 169152

11 years agoFixes a compile warning and crash in the tests.
Manuel Klimek [Mon, 3 Dec 2012 20:55:42 +0000 (20:55 +0000)]
Fixes a compile warning and crash in the tests.

The necessity of this fix points to a problem with the design
of the addToken during the optimiation phase, which we need to address
in a much more principled way.

llvm-svn: 169151

11 years agoUpdate CLooG
Tobias Grosser [Mon, 3 Dec 2012 20:47:57 +0000 (20:47 +0000)]
Update CLooG

This cloog versions passes all tests with isl 0.11.

llvm-svn: 169150

11 years agoDefine unsigned const-ext predicates.
Jyotsna Verma [Mon, 3 Dec 2012 20:39:45 +0000 (20:39 +0000)]
Define unsigned const-ext predicates.

llvm-svn: 169149

11 years agoRemoving unnecessary 'else' statement from the predicates defined in HexagonOperards.td.
Jyotsna Verma [Mon, 3 Dec 2012 20:14:38 +0000 (20:14 +0000)]
Removing unnecessary 'else' statement from the predicates defined in HexagonOperards.td.

llvm-svn: 169148

11 years agoEliminate redundant bitwise operations when using a llvm/ADT/PointerUnion.
Argyrios Kyrtzidis [Mon, 3 Dec 2012 19:59:23 +0000 (19:59 +0000)]
Eliminate redundant bitwise operations when using a llvm/ADT/PointerUnion.

For comparison, with this code sample:

PointerUnion<int *, char *> Data;
PointerUnion<int *, char *> foo1() {
Data = new int;
return new int;
}
PointerUnion<int *, char *> foo2() {
Data = new char;
return new char;
}

Before this patch we would get:

define i64 @_Z4foo1v() uwtable ssp {
  %1 = tail call noalias i8* @_Znwm(i64 4)
  %2 = ptrtoint i8* %1 to i64
  %3 = load i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %4 = and i64 %3, 1
  %.masked.i = and i64 %2, -3
  %5 = or i64 %4, %.masked.i
  store i64 %5, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %6 = tail call noalias i8* @_Znwm(i64 4)
  %7 = ptrtoint i8* %6 to i64
  %8 = and i64 %7, -3
  ret i64 %8
}

define i64 @_Z4foo2v() uwtable ssp {
  %1 = tail call noalias i8* @_Znwm(i64 1)
  %2 = ptrtoint i8* %1 to i64
  %3 = load i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %4 = and i64 %3, 1
  %5 = or i64 %2, %4
  %6 = or i64 %5, 2
  store i64 %6, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %7 = tail call noalias i8* @_Znwm(i64 1)
  %8 = ptrtoint i8* %7 to i64
  %9 = or i64 %8, 2
  ret i64 %9
}

After the patch:

define i64 @_Z4foo1v() uwtable ssp {
  %1 = tail call noalias i8* @_Znwm(i64 4)
  %2 = ptrtoint i8* %1 to i64
  store i64 %2, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %3 = tail call noalias i8* @_Znwm(i64 4)
  %4 = ptrtoint i8* %3 to i64
  ret i64 %4
}

declare noalias i8* @_Znwm(i64)

define i64 @_Z4foo2v() uwtable ssp {
  %1 = tail call noalias i8* @_Znwm(i64 1)
  %2 = ptrtoint i8* %1 to i64
  %3 = or i64 %2, 2
  store i64 %3, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %4 = tail call noalias i8* @_Znwm(i64 1)
  %5 = ptrtoint i8* %4 to i64
  %6 = or i64 %5, 2
  ret i64 %6
}

llvm-svn: 169147

11 years agoSimplify this test a bit because DWARF emission/dumping on some platforms
Eli Bendersky [Mon, 3 Dec 2012 19:58:12 +0000 (19:58 +0000)]
Simplify this test a bit because DWARF emission/dumping on some platforms
is not yet good enough for more sophistication. The important goal of this
test is to make sure llc doesn't crash on this IR like it used to.

llvm-svn: 169146

11 years agoAdd 'getInt64Field()' method to get the signed integer instead of unsigned.
Bill Wendling [Mon, 3 Dec 2012 19:44:25 +0000 (19:44 +0000)]
Add 'getInt64Field()' method to get the signed integer instead of unsigned.

llvm-svn: 169145

11 years agoAdd Clang flags -fsanitize-blacklist and -fno-sanitize-blacklist. Make this flag...
Alexey Samsonov [Mon, 3 Dec 2012 19:12:58 +0000 (19:12 +0000)]
Add Clang flags -fsanitize-blacklist and -fno-sanitize-blacklist. Make this flag usable for ASan. Blacklisting can be used to disable sanitizer checks for particular file/function/object.

llvm-svn: 169144

11 years agoASan: add blacklist file to ASan pass options. Clang patch for this will follow.
Alexey Samsonov [Mon, 3 Dec 2012 19:09:26 +0000 (19:09 +0000)]
ASan: add blacklist file to ASan pass options. Clang patch for this will follow.

llvm-svn: 169143

11 years agoFix PR12942: Allow two CUs to be generated from the same source file.
Eli Bendersky [Mon, 3 Dec 2012 18:45:45 +0000 (18:45 +0000)]
Fix PR12942: Allow two CUs to be generated from the same source file.

Thanks Eric for the review.

llvm-svn: 169142

11 years ago[asan] two more bits for __sparc__
Kostya Serebryany [Mon, 3 Dec 2012 18:39:21 +0000 (18:39 +0000)]
[asan] two more bits for __sparc__

llvm-svn: 169141

11 years agoFix clang build issues.
Greg Clayton [Mon, 3 Dec 2012 18:29:55 +0000 (18:29 +0000)]
Fix clang build issues.

llvm-svn: 169140

11 years agolibclangFormat is not libclangTooling, but it depends on it.
Benjamin Kramer [Mon, 3 Dec 2012 18:28:52 +0000 (18:28 +0000)]
libclangFormat is not libclangTooling, but it depends on it.

llvm-svn: 169139

11 years agoFix PR14474: don't emit debug info for interface types in -gline-tables-only mode.
Alexey Samsonov [Mon, 3 Dec 2012 18:28:12 +0000 (18:28 +0000)]
Fix PR14474: don't emit debug info for interface types in -gline-tables-only mode.

llvm-svn: 169138

11 years agoInitial version of formatting library.
Daniel Jasper [Mon, 3 Dec 2012 18:12:45 +0000 (18:12 +0000)]
Initial version of formatting library.

This formatting library will be used by a stand-alone clang-format tool
and can also be used when writing other refactorings.

Manuel's original design document:
https://docs.google.com/a/google.com/document/d/1gpckL2U_6QuU9YW2L1ABsc4Fcogn5UngKk7fE5dDOoA/edit

The library can already successfully format itself.

Review: http://llvm-reviews.chandlerc.com/D80
llvm-svn: 169137

11 years ago<rdar://problem/12742973>
Greg Clayton [Mon, 3 Dec 2012 17:50:07 +0000 (17:50 +0000)]
<rdar://problem/12742973>

Forwarding a fix for a crasher in the demangler.

llvm-svn: 169136

11 years agoTeach the jump threading optimization to stop scanning the basic block when calculati...
Nadav Rotem [Mon, 3 Dec 2012 17:34:44 +0000 (17:34 +0000)]
Teach the jump threading optimization to stop scanning the basic block when calculating the cost after passing the threshold.

llvm-svn: 169135

11 years agoRevert r169039, "Aggregate pass execution time report by pass ID instead of pass...
Jakob Stoklund Olesen [Mon, 3 Dec 2012 17:31:11 +0000 (17:31 +0000)]
Revert r169039, "Aggregate pass execution time report by pass ID instead of pass instance."

llvm-svn: 169134

11 years agoSort the #include lines for the include/... tree with the script.
Chandler Carruth [Mon, 3 Dec 2012 17:02:12 +0000 (17:02 +0000)]
Sort the #include lines for the include/... tree with the script.

AKA: Recompile *ALL* the source code!

This one went much better. No manual edits here. I spot-checked for
silliness and grep-checked for really broken edits and everything seemed
good. It all still compiles. Yell if you see something that looks goofy.

llvm-svn: 169133

11 years agoTeach the include sorter to not choke on include guards. ;]
Chandler Carruth [Mon, 3 Dec 2012 17:01:46 +0000 (17:01 +0000)]
Teach the include sorter to not choke on include guards. ;]

Kind of important when prepping the include/... tree version of the sort
changes.

llvm-svn: 169132

11 years agoUse the new script to sort the includes of every file under lib.
Chandler Carruth [Mon, 3 Dec 2012 16:50:05 +0000 (16:50 +0000)]
Use the new script to sort the includes of every file under lib.

Sooooo many of these had incorrect or strange main module includes.
I have manually inspected all of these, and fixed the main module
include to be the nearest plausible thing I could find. If you own or
care about any of these source files, I encourage you to take some time
and check that these edits were sensible. I can't have broken anything
(I strictly added headers, and reordered them, never removed), but they
may not be the headers you'd really like to identify as containing the
API being implemented.

Many forward declarations and missing includes were added to a header
files to allow them to parse cleanly when included first. The main
module rule does in fact have its merits. =]

llvm-svn: 169131

11 years agoclarify that this isn't lld.
Chris Lattner [Mon, 3 Dec 2012 16:08:32 +0000 (16:08 +0000)]
clarify that this isn't lld.

llvm-svn: 169130

11 years agoMake hasDeclaration work for enums.
Daniel Jasper [Mon, 3 Dec 2012 15:43:25 +0000 (15:43 +0000)]
Make hasDeclaration work for enums.

llvm-svn: 169129

11 years ago[tsan] add CompactSizeClassMap as an alternative (more compact) size class map. Not...
Kostya Serebryany [Mon, 3 Dec 2012 15:00:33 +0000 (15:00 +0000)]
[tsan] add CompactSizeClassMap as an alternative (more compact) size class map. Not used yet.

llvm-svn: 169128

11 years agoUse isl 0.11
Tobias Grosser [Mon, 3 Dec 2012 14:44:14 +0000 (14:44 +0000)]
Use isl 0.11

We now switch to the newly released isl 0.11. This adds a couple of bug fixes
on top of the recent update.

llvm-svn: 169127

11 years agoTest commit: reformat comment.
Edwin Vane [Mon, 3 Dec 2012 14:32:13 +0000 (14:32 +0000)]
Test commit: reformat comment.

llvm-svn: 169126

11 years agoAdd a completely hack-ish tool to sort includes according to the coding
Chandler Carruth [Mon, 3 Dec 2012 14:23:44 +0000 (14:23 +0000)]
Add a completely hack-ish tool to sort includes according to the coding
standards.

I am a terrible Python programmer. Patches more the welcome. Please tell
me how this should look if it should look differently. It's just a tiny
little script so it didn't make sense to go through pre-commit review,
especially as someone who actually knows python may want to just rip it
apart and do it The Right Way.

I will be preparing a commit shortly that uses this script to
canonicalize *all* of the #include lines in LLVM. Really, all of them.

llvm-svn: 169125

11 years agoAdd -fsanitize=memory.
Evgeniy Stepanov [Mon, 3 Dec 2012 13:20:43 +0000 (13:20 +0000)]
Add -fsanitize=memory.

llvm-svn: 169124

11 years ago[tsan] remove unused InternalAllocBlock as part of larger refactoring
Kostya Serebryany [Mon, 3 Dec 2012 11:57:01 +0000 (11:57 +0000)]
[tsan] remove unused InternalAllocBlock as part of larger refactoring

llvm-svn: 169123

11 years agotsan: describe global vars (module+offset for now)
Dmitry Vyukov [Mon, 3 Dec 2012 11:45:34 +0000 (11:45 +0000)]
tsan: describe global vars (module+offset for now)

llvm-svn: 169122

11 years ago[asan] EXPECT_EQ => ASSERT_EQ around pthread_create/pthread_join calls
Kostya Serebryany [Mon, 3 Dec 2012 11:37:03 +0000 (11:37 +0000)]
[asan] EXPECT_EQ => ASSERT_EQ around pthread_create/pthread_join calls

llvm-svn: 169121

11 years agoRemove some buggy and apparantly unnecessary code from SROA.
Chandler Carruth [Mon, 3 Dec 2012 10:59:55 +0000 (10:59 +0000)]
Remove some buggy and apparantly unnecessary code from SROA.

The partitioning logic attempted to handle uses of an alloca with an
offset starting before the alloca so long as the use had some overlap
with the alloca itself. However, there was a bug where we tested
'(uint64_t)Offset >= AllocSize' without first checking whether 'Offset'
was positive. As a consequence, essentially every negative offset (that
is, starting *before* the alloca does) would be thrown out, even if it
was overlapping. The subsequent code to throw out negative offsets which
were actually non-overlapping was essentially dead. The code to *handle*
overlapping negative offsets was actually dead!

I've just removed all of this, and taught SROA to discard any uses which
start prior to the alloca from the beginning. It has the lovely property
of simplifying the code. =] All the tests still pass, and in fact no new
tests are needed as this is already covered by our testsuite. Fixing the
code so that negative offsets work the way the comments indicate they
were supposed to work causes regressions. That's how I found this.

Anyways, this is all progress in the correct direction -- tightening up
SROA to be maximally aggressive. Some day, I really hope to turn
out-of-bounds accesses to an alloca into 'unreachable'.

llvm-svn: 169120

11 years agofix stats for added checks
Nuno Lopes [Mon, 3 Dec 2012 10:15:03 +0000 (10:15 +0000)]
fix stats for added checks

llvm-svn: 169119

11 years ago[asan] in asan tests, check all return values of pthread_create/pthread_join. Also...
Kostya Serebryany [Mon, 3 Dec 2012 09:43:56 +0000 (09:43 +0000)]
[asan] in asan tests, check all return values of pthread_create/pthread_join. Also add the ASAN_AVOID_EXPENSIVE_TESTS macro to guard the test that creates too many threads

llvm-svn: 169118

11 years agoDefine signed const-ext predicates.
Jyotsna Verma [Mon, 3 Dec 2012 06:54:50 +0000 (06:54 +0000)]
Define signed const-ext predicates.

llvm-svn: 169117

11 years agoRemove 'deplibs' keyword, since it's no longer used.
Bill Wendling [Mon, 3 Dec 2012 06:34:06 +0000 (06:34 +0000)]
Remove 'deplibs' keyword, since it's no longer used.

llvm-svn: 169116

11 years agoClean up, bring up-to-date and apply consistent formatting.
Eli Bendersky [Mon, 3 Dec 2012 04:10:58 +0000 (04:10 +0000)]
Clean up, bring up-to-date and apply consistent formatting.

This document is a long-time pet peeve :-) More fixes to come.

llvm-svn: 169115

11 years ago[ubsan] Add flag to enable recovery from checks when possible.
Will Dietz [Sun, 2 Dec 2012 19:50:33 +0000 (19:50 +0000)]
[ubsan] Add flag to enable recovery from checks when possible.

llvm-svn: 169114

11 years ago[ubsan] Refactor handlers to have separate entry points for aborting.
Will Dietz [Sun, 2 Dec 2012 19:47:29 +0000 (19:47 +0000)]
[ubsan] Refactor handlers to have separate entry points for aborting.

If user specifies aborting after a recoverable failed check is
appropriate, frontend should emit call to the _abort variant.

Test this behavior with newly added -fsanitize-recover flag.

llvm-svn: 169113

11 years ago[ubsan] Replace "fatal error" with "runtime error".
Will Dietz [Sun, 2 Dec 2012 18:43:33 +0000 (18:43 +0000)]
[ubsan] Replace "fatal error" with "runtime error".

llvm-svn: 169112

11 years agoAllow merging multiple store sequences on the same chain.
Nadav Rotem [Sun, 2 Dec 2012 17:14:09 +0000 (17:14 +0000)]
Allow merging multiple store sequences on the same chain.

llvm-svn: 169111

11 years agoBring vim keyword lists up to date.
Benjamin Kramer [Sun, 2 Dec 2012 16:40:38 +0000 (16:40 +0000)]
Bring vim keyword lists up to date.

llvm-svn: 169110

11 years agoFix a bug in FileCheck that wouldn't let define variables as follows:
Eli Bendersky [Sun, 2 Dec 2012 16:02:41 +0000 (16:02 +0000)]
Fix a bug in FileCheck that wouldn't let define variables as follows:

; CHECK: [[VAR:[a-z]]]

The problem was that to find the end of the regex var definition, it was
simplistically looking for the next ]] and finding the incorrect one. A
better approach is to count nesting of brackets (taking escaping into
account). This way the brackets that are part of the regex can be discovered
and skipped properly, and the ]] ending is detected in the right place.

llvm-svn: 169109

11 years agoFix an invalid regex in the test
Eli Bendersky [Sun, 2 Dec 2012 15:46:02 +0000 (15:46 +0000)]
Fix an invalid regex in the test

llvm-svn: 169108

11 years agoSimplify the coding standards for #include ordering. The ordering is now
Chandler Carruth [Sun, 2 Dec 2012 11:53:27 +0000 (11:53 +0000)]
Simplify the coding standards for #include ordering. The ordering is now
trivially achievable with an editor. I'll likely check in a silly python
script to help with this too.

llvm-svn: 169107

11 years agoUnbreak Sphinx build
Justin Holewinski [Sun, 2 Dec 2012 02:47:48 +0000 (02:47 +0000)]
Unbreak Sphinx build

llvm-svn: 169106

11 years agoAnother fix attempt to Makefile.sphinx - copy the PNGs from tutorial/ as well,
Eli Bendersky [Sat, 1 Dec 2012 22:21:04 +0000 (22:21 +0000)]
Another fix attempt to Makefile.sphinx - copy the PNGs from tutorial/ as well,
and recursive copying is not required for the tutorial/ directory.

llvm-svn: 169105

11 years agoAttempt to fix Makefile.sphinx to not generate errors while trying to copy
Eli Bendersky [Sat, 1 Dec 2012 22:11:59 +0000 (22:11 +0000)]
Attempt to fix Makefile.sphinx to not generate errors while trying to copy
files from tutorial/.svn

llvm-svn: 169104

11 years agoUpdate FileCheck's documentation to mention recently added feature of
Eli Bendersky [Sat, 1 Dec 2012 22:03:57 +0000 (22:03 +0000)]
Update FileCheck's documentation to mention recently added feature of
matching a variable defined on the same line.

llvm-svn: 169103

11 years ago[python] Add markup option to disassembler
Gregory Szorc [Sat, 1 Dec 2012 21:57:30 +0000 (21:57 +0000)]
[python] Add markup option to disassembler

Patch contributed by Wladimir J. van der Laan <laanwj@gmail.com>

llvm-svn: 169102

11 years agoSupport referencing variables defined on the same line.
Eli Bendersky [Sat, 1 Dec 2012 21:54:48 +0000 (21:54 +0000)]
Support referencing variables defined on the same line.

See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/157198.html
and related discussions.

llvm-svn: 169101

11 years agoUpdate the recommended isl version
Tobias Grosser [Sat, 1 Dec 2012 21:51:10 +0000 (21:51 +0000)]
Update the recommended isl version

Recent changes in isl:

- Allow analysis of loops during code generation

This simplifies the detection of parallel loops.

- Simplify the way costumized ast printers are defined

This enables us to highlight parallel / vector loops in our debug output.

- Compile time improvements for codegen contexts that include parameters

- Various bug fixes

This update also gets us in sync for the isl 0.11 release.

llvm-svn: 169100

11 years agoMake helper classes anonymous. Make helper functions static instead of private member...
Benjamin Kramer [Sat, 1 Dec 2012 20:58:01 +0000 (20:58 +0000)]
Make helper classes anonymous. Make helper functions static instead of private members so the anonymous class doesn't leak out.

No functionality change.

llvm-svn: 169099

11 years ago[MIPS] Add -mxgot/-mno-xgot command line options
Simon Atanasyan [Sat, 1 Dec 2012 18:27:21 +0000 (18:27 +0000)]
[MIPS] Add -mxgot/-mno-xgot command line options
to enable/disable support of GOT larger than 64k.

llvm-svn: 169098

11 years agoAdd raw_ostream include to pacify MSVC.
Benjamin Kramer [Sat, 1 Dec 2012 17:54:07 +0000 (17:54 +0000)]
Add raw_ostream include to pacify MSVC.

llvm-svn: 169097

11 years agoUpdate unit tests not to rely on transitive includes.
Benjamin Kramer [Sat, 1 Dec 2012 17:22:05 +0000 (17:22 +0000)]
Update unit tests not to rely on transitive includes.

llvm-svn: 169096

11 years agoInclude pruning and general cleanup.
Benjamin Kramer [Sat, 1 Dec 2012 17:12:56 +0000 (17:12 +0000)]
Include pruning and general cleanup.

llvm-svn: 169095

11 years agoDon't include Type.h in DeclarationName.h.
Benjamin Kramer [Sat, 1 Dec 2012 16:35:25 +0000 (16:35 +0000)]
Don't include Type.h in DeclarationName.h.

Recursively prune some includes.

llvm-svn: 169094

11 years agoMake ASTVector.h standalone without including all of ASTContext.
Benjamin Kramer [Sat, 1 Dec 2012 15:18:03 +0000 (15:18 +0000)]
Make ASTVector.h standalone without including all of ASTContext.

llvm-svn: 169093

11 years agoPull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't pull...
Benjamin Kramer [Sat, 1 Dec 2012 15:09:41 +0000 (15:09 +0000)]
Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't pull in all the generated Attr code.

Required to pull some functions out of line, but this shouldn't have a perf impact.
No functionality change.

llvm-svn: 169092

11 years agoRemove bugzilla link.
James Molloy [Sat, 1 Dec 2012 14:44:23 +0000 (14:44 +0000)]
Remove bugzilla link.

llvm-svn: 169091

11 years agoFix a test that was redefining FileCheck variables while referencing old ones.
Eli Bendersky [Sat, 1 Dec 2012 13:50:51 +0000 (13:50 +0000)]
Fix a test that was redefining FileCheck variables while referencing old ones.

In preparation for the FileCheck enhancement to support backreferences.

llvm-svn: 169090

11 years agoSwitch to using -### as mentioned by chandlerc.
Joey Gouly [Sat, 1 Dec 2012 13:07:22 +0000 (13:07 +0000)]
Switch to using -### as mentioned by chandlerc.

llvm-svn: 169089

11 years agoAdd -emit-llvm to test/Driver/fsanitize.c to stop this failing on the ARM bot. Approv...
Joey Gouly [Sat, 1 Dec 2012 12:15:28 +0000 (12:15 +0000)]
Add -emit-llvm to test/Driver/fsanitize.c to stop this failing on the ARM bot. Approved by d0k.

llvm-svn: 169088

11 years agoDocumentation: convert WritingAnLLVMBackend.html to reST
Dmitri Gribenko [Sat, 1 Dec 2012 12:13:48 +0000 (12:13 +0000)]
Documentation: convert WritingAnLLVMBackend.html to reST

llvm-svn: 169087

11 years agoAdd .arcconfig to the repository. Useful if someone wants to use phabricator's comman...
Benjamin Kramer [Sat, 1 Dec 2012 12:08:08 +0000 (12:08 +0000)]
Add .arcconfig to the repository. Useful if someone wants to use phabricator's command line tool.

llvm-svn: 169086

11 years agoAdd .arcconfig to the repository. Useful if someone wants to use phabricator's comman...
Benjamin Kramer [Sat, 1 Dec 2012 12:07:58 +0000 (12:07 +0000)]
Add .arcconfig to the repository. Useful if someone wants to use phabricator's command line tool.

llvm-svn: 169085

11 years agoSROA: Avoid struct and array types early to avoid creating an overly large integer...
Benjamin Kramer [Sat, 1 Dec 2012 11:53:32 +0000 (11:53 +0000)]
SROA: Avoid struct and array types early to avoid creating an overly large integer type.

Fixes PR14465.

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

llvm-svn: 169084

11 years agoRevert previous check in r168581, r169079 as they are still in code review status.
Zhou Sheng [Sat, 1 Dec 2012 10:54:28 +0000 (10:54 +0000)]
Revert previous check in r168581, r169079 as they are still in code review status.

llvm-svn: 169083

11 years agoDon't re-add kexts and the kernel each time we get a notification
Jason Molenda [Sat, 1 Dec 2012 06:13:29 +0000 (06:13 +0000)]
Don't re-add kexts and the kernel each time we get a notification
that kexts were newly added.

The Darwin userland dynamic loader provides lldb with a list of
newly-added or newly-removed binaries but in the kernel case we
only know that something has changed.  DynamicLoaderDarwinKernel
really needs to maintain its own persistent list of kexts that
it has been notified about (most importantly, it will not detect
kext unlods) but for now we'll at least avoid re-adding an already
present kext.

<rdar://problem/12658487>, <rdar://problem/12658487>

llvm-svn: 169082

11 years agoBump lldb version num to lldb-178, debugserver version to debugserver-198.
Jason Molenda [Sat, 1 Dec 2012 04:50:09 +0000 (04:50 +0000)]
Bump lldb version num to lldb-178, debugserver version to debugserver-198.

llvm-svn: 169081

11 years agoRead full 64 bits of kernel address when locating a
Jason Molenda [Sat, 1 Dec 2012 04:46:58 +0000 (04:46 +0000)]
Read full 64 bits of kernel address when locating a
64-bit kernel in ProcessGDBRemote.
<rdar://problem/12657369>

llvm-svn: 169080

11 years agoThe patch is to improve the memory footprint of pass GlobalOpt.
Zhou Sheng [Sat, 1 Dec 2012 04:38:53 +0000 (04:38 +0000)]
The patch is to improve the memory footprint of pass GlobalOpt.
Also check in a case to repeat the issue, on which 'opt -globalopt' consumes 1.6GB memory.
The big memory footprint cause is that current GlobalOpt one by one hoists and stores the leaf element constant into the global array, in each iteration, it recreates the global array initializer constant and leave the old initializer alone. This may result in many obsolete constants left.
For example:  we have global array @rom = global [16 x i32] zeroinitializer
After the first element value is hoisted and installed:   @rom = global [16 x i32] [ 1, 0, 0, ... ]
After the second element value is installed:  @rom = global [16 x 32] [ 1, 2, 0, 0, ... ]        // here the previous initializer is obsolete
...
When the transform is done, we have 15 obsolete initializers left useless.

llvm-svn: 169079

11 years agoFix a typo in comment.
Michael Han [Sat, 1 Dec 2012 04:35:48 +0000 (04:35 +0000)]
Fix a typo in comment.

llvm-svn: 169078

11 years agoMake these functions more clearly express the test they are performing. No functional...
Richard Smith [Sat, 1 Dec 2012 03:15:03 +0000 (03:15 +0000)]
Make these functions more clearly express the test they are performing. No functionality change.

llvm-svn: 169077

11 years agoAdd caching to the MemoryMappingLayout class on Linux. This is necessary for the...
Alexander Potapenko [Sat, 1 Dec 2012 02:39:45 +0000 (02:39 +0000)]
Add caching to the MemoryMappingLayout class on Linux. This is necessary for the cases when a sandbox prevents ASan from reading the mappings
from /proc/self/maps.
The mappings are currently being cached on each access to /proc/self/maps. In the future we'll need to add an API that allows the client to notify ASan about the sandbox.

llvm-svn: 169076

11 years agoConsistently use 'needsImplicit<special member>' to determine whether we need
Richard Smith [Sat, 1 Dec 2012 02:35:44 +0000 (02:35 +0000)]
Consistently use 'needsImplicit<special member>' to determine whether we need
an implicit special member, rather than sometimes using '!hasDeclared<special
member>'. No functionality change.

llvm-svn: 169075

11 years agoVMCore/DebugInfo.cpp: DICompileUnit::getSubprograms(): Check numOperands().
NAKAMURA Takumi [Sat, 1 Dec 2012 02:23:45 +0000 (02:23 +0000)]
VMCore/DebugInfo.cpp: DICompileUnit::getSubprograms(): Check numOperands().

2012-11-30-misched-dbg.ll had crashed. Then (MDNode)N was "!{}".
I am not sure it would be ill-formed or not.

llvm-svn: 169074

11 years agoMC/AsmParser: Avoid unnecessary use of SourceMgr::FindBufferForLoc()
Daniel Dunbar [Sat, 1 Dec 2012 01:38:48 +0000 (01:38 +0000)]
MC/AsmParser: Avoid unnecessary use of SourceMgr::FindBufferForLoc()

 - Each macro instantiation introduces a new buffer, and FindBufferForLoc() is
   linear, so previously macro instantiation could be N^2 for some pathological
   inputs.

llvm-svn: 169073

11 years agomisched: Fix RegisterPressureTracker handling of DebugVals.
Andrew Trick [Sat, 1 Dec 2012 01:22:49 +0000 (01:22 +0000)]
misched: Fix RegisterPressureTracker handling of DebugVals.

Assertion failed: (TopRPTracker.getPos() == RegionBegin && "bad initial Top tracker").
rdar://12790302.

llvm-svn: 169072

11 years agomisched: Fix the DAG builder to handle an undef operand at ExitSU.
Andrew Trick [Sat, 1 Dec 2012 01:22:44 +0000 (01:22 +0000)]
misched: Fix the DAG builder to handle an undef operand at ExitSU.

Assertion failed: (VNI && "No value to read by operand")
rdar://12790267.

llvm-svn: 169071

11 years agomisched: Fix LiveInterval update to better handle DebugVal.
Andrew Trick [Sat, 1 Dec 2012 01:22:41 +0000 (01:22 +0000)]
misched: Fix LiveInterval update to better handle DebugVal.

Assertion failed: (itr != mi2iMap.end() && "Instruction not found in maps.")
rdar://12777252.

llvm-svn: 169070

11 years agomisched: fix RegionBegin when DebugValues get shuffled to the top.
Andrew Trick [Sat, 1 Dec 2012 01:22:38 +0000 (01:22 +0000)]
misched: fix RegionBegin when DebugValues get shuffled to the top.

assert (RemainingInstrs == 0 && "Instruction count mismatch!")

rdar://12776937.

llvm-svn: 169069

11 years agoTry to make the source location information for token pastes a bit more consistent.
Eli Friedman [Sat, 1 Dec 2012 01:15:54 +0000 (01:15 +0000)]
Try to make the source location information for token pastes a bit more consistent.

Fixes a crash printing diagnostics on the gcc testsuite, and also makes
diagnostic range printing print nicer results for token pastes.

llvm-svn: 169068

11 years agoSimplify REG_SEQUENCE lowering.
Jakob Stoklund Olesen [Sat, 1 Dec 2012 01:06:44 +0000 (01:06 +0000)]
Simplify REG_SEQUENCE lowering.

The TwoAddressInstructionPass takes the machine code out of SSA form by
expanding REG_SEQUENCE instructions into copies. It is no longer
necessary to rewrite the registers used by a REG_SEQUENCE instruction
because the new coalescer algorithm can do it now.

REG_SEQUENCE is just converted to a sequence of sub-register copies now.

llvm-svn: 169067

11 years agoRemove restriction on combining ubsan with asan or tsan. This has worked for a while.
Richard Smith [Sat, 1 Dec 2012 01:02:45 +0000 (01:02 +0000)]
Remove restriction on combining ubsan with asan or tsan. This has worked for a while.

llvm-svn: 169066

11 years agoFix the determination of whether a capture refers to an enclosing
Douglas Gregor [Sat, 1 Dec 2012 01:01:09 +0000 (01:01 +0000)]
Fix the determination of whether a capture refers to an enclosing
scope when dealing with nested blocks. Fixes <rdar://problem/12778708>.

llvm-svn: 169065

11 years agoUpdate the emacs mode to recognize fadd, fsum, fmul, fdiv, frem, fcmp, icmp
Michael Ilseman [Sat, 1 Dec 2012 00:42:27 +0000 (00:42 +0000)]
Update the emacs mode to recognize fadd, fsum, fmul, fdiv, frem, fcmp, icmp

llvm-svn: 169064

11 years agoAdded support for PtrToInt to the IR
Sean Callanan [Sat, 1 Dec 2012 00:09:34 +0000 (00:09 +0000)]
Added support for PtrToInt to the IR
interpreter.

<rdar://problem/12657742>

llvm-svn: 169063

11 years agoAdded logging to the code that determines
Sean Callanan [Sat, 1 Dec 2012 00:08:33 +0000 (00:08 +0000)]
Added logging to the code that determines
whether the current frame is in a C++/Objective-C
class or instance method.

llvm-svn: 169062

11 years agoAdd some first skeleton work for the DWARF5 Fission proposal. Emit
Eric Christopher [Fri, 30 Nov 2012 23:59:06 +0000 (23:59 +0000)]
Add some first skeleton work for the DWARF5 Fission proposal. Emit
part of the compile unit CU and start separating out information into
the various sections that will be pulled out later.

WIP.

llvm-svn: 169061

11 years agoConvert COPY instructions into KILLs if they have implicit defs.
Jakob Stoklund Olesen [Fri, 30 Nov 2012 23:53:00 +0000 (23:53 +0000)]
Convert COPY instructions into KILLs if they have implicit defs.

MachineCopyPropagation doesn't understand super-register liveness well
enough to be able to remove implicit defs of super-registers.

This fixes a problem in ARM/2012-01-26-CopyPropKills.ll that is exposed
by an future TwoAddressInstructionPass change. The KILL instructions are
removed before the machine code is emitted.

llvm-svn: 169060

11 years agoDon't emit a warning with an input/output parameter. We assume the user knows what...
Bill Wendling [Fri, 30 Nov 2012 23:46:56 +0000 (23:46 +0000)]
Don't emit a warning with an input/output parameter. We assume the user knows what they're doing here.

llvm-svn: 169059

11 years agoFix test for Windows path separators
Douglas Gregor [Fri, 30 Nov 2012 23:40:49 +0000 (23:40 +0000)]
Fix test for Windows path separators

llvm-svn: 169058

11 years agoTeach the serialized diagnostic writer to clone() itself, sharing
Douglas Gregor [Fri, 30 Nov 2012 23:32:31 +0000 (23:32 +0000)]
Teach the serialized diagnostic writer to clone() itself, sharing
state so that all of the various clones end up rendering their
diagnostics into the same serialized-diagnostics file. This is
important when we actually want failures during module build to be
reported back to the translation unit that tried to import the
not-yet-built or out-of-date module. <rdar://problem/12565727>

llvm-svn: 169057

11 years agoAdd support for fission attributes/forms/operations -> string.
Eric Christopher [Fri, 30 Nov 2012 23:20:43 +0000 (23:20 +0000)]
Add support for fission attributes/forms/operations -> string.

llvm-svn: 169056

11 years agoVim mode updated to recognize fast-math flags
Michael Ilseman [Fri, 30 Nov 2012 23:18:21 +0000 (23:18 +0000)]
Vim mode updated to recognize fast-math flags

llvm-svn: 169055