platform/upstream/llvm.git
11 years agoAdd some GCOV functions that register all of the __llvm_gcov_flush() functions.
Bill Wendling [Mon, 18 Mar 2013 22:59:47 +0000 (22:59 +0000)]
Add some GCOV functions that register all of the __llvm_gcov_flush() functions.

The __llvm_gcov_flush() functions only work for the local compile unit. However,
when __gcov_flush() is called, the user expects all of the counters to be
flushed, not just the ones in the current compile unit.

This adds some library functions that register the flush functions. It also
defined __gcov_flush() so that loops through that list and calls the functions.

PR15191 & <rdar://problem/13167507>

llvm-svn: 177337

11 years ago[frontend] Initialize the diagnostic client before loading an ast file.
Argyrios Kyrtzidis [Mon, 18 Mar 2013 22:55:24 +0000 (22:55 +0000)]
[frontend] Initialize the diagnostic client before loading an ast file.

Issue reported by Tom Honermann!
http://llvm.org/bugs/show_bug.cgi?id=15377

llvm-svn: 177336

11 years agoAdd missing diagnostic for a nested-name-specifier on a free-standing type definition...
Richard Smith [Mon, 18 Mar 2013 22:52:47 +0000 (22:52 +0000)]
Add missing diagnostic for a nested-name-specifier on a free-standing type definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations.

llvm-svn: 177335

11 years agoARM cost model: Make some vector integer to float casts cheaper
Arnold Schwaighofer [Mon, 18 Mar 2013 22:47:09 +0000 (22:47 +0000)]
ARM cost model: Make some vector integer to float casts cheaper

The default logic marks them as too expensive.

For example, before this patch we estimated:
  cost of 16 for instruction:   %r = uitofp <4 x i16> %v0 to <4 x float>

While this translates to:
  vmovl.u16 q8, d16
  vcvt.f32.u32  q8, q8

All other costs are left to the values assigned by the fallback logic. Theses
costs are mostly reasonable in the sense that they get progressively more
expensive as the instruction sequences emitted get longer.

radar://13445992

llvm-svn: 177334

11 years agoARM cost model: Correct cost for some cheap float to integer conversions
Arnold Schwaighofer [Mon, 18 Mar 2013 22:47:06 +0000 (22:47 +0000)]
ARM cost model: Correct cost for some cheap float to integer conversions

Fix cost of some "cheap" cast instructions. Before this patch we used to
estimate for example:
  cost of 16 for instruction:   %r = fptoui <4 x float> %v0 to <4 x i16>

While we would emit:
  vcvt.s32.f32  q8, q8
  vmovn.i32 d16, q8
  vuzp.8  d16, d17

All other costs are left to the values assigned by the fallback logic. Theses
costs are mostly reasonable in the sense that they get progressively more
expensive as the instruction sequences emitted get longer.

radar://13434072

llvm-svn: 177333

11 years agoCode cleanup:
Greg Clayton [Mon, 18 Mar 2013 22:34:00 +0000 (22:34 +0000)]
Code cleanup:
- don't use preprocessor macros
- use switch statements
- don't put anything in the lldb namespace, use "lldb_perf" namespace.
- Pass the action struct into each TestStep() for each step fill in
- Modify the ActionWanted class to have accessors to make the continue, next, finish, kill instead of using preproc macros

llvm-svn: 177332

11 years agoExtend global merge pass to optionally consider global constant variables.
Quentin Colombet [Mon, 18 Mar 2013 22:30:07 +0000 (22:30 +0000)]
Extend global merge pass to optionally consider global constant variables.
Also add some checks to not merge globals used within landing pad instructions or marked as "used".

llvm-svn: 177331

11 years ago[PCH] Fix assertion hit related to enum decls inside templated funtions.
Argyrios Kyrtzidis [Mon, 18 Mar 2013 22:23:49 +0000 (22:23 +0000)]
[PCH] Fix assertion hit related to enum decls inside templated funtions.

Report and suggested fix by Tom Honermann!
http://llvm.org/bugs/show_bug.cgi?id=13020

llvm-svn: 177330

11 years agoThis code works around what appears to be a bug in another part of clang.
Reed Kotler [Mon, 18 Mar 2013 22:18:00 +0000 (22:18 +0000)]
This code works around what appears to be a bug in another part of clang.
I have filed http://llvm.org/bugs/show_bug.cgi?id=15538 against clang.
This code is safer anyway because "cast" assumes you really know that
it's okay to make the cast. In this case isa should not be false and
dyn_cast should not return null as far as I understand. But everything
else is valid so I did not want to revert my previous patch for attributes
mips16/nomips16 or use an llvm_unreachable here which would make a number
of our tests fail for mips.

llvm-svn: 177329

11 years agoChange test cases to handle unaligned references.
Bill Schmidt [Mon, 18 Mar 2013 22:12:04 +0000 (22:12 +0000)]
Change test cases to handle unaligned references.

Hal Finkel recently added code to allow unaligned memory references
for PowerPC.  Two tests were temporarily modified with
-disable-ppc-unaligned to keep them from failing.  This patch adjusts
the expected code generation for the unaligned references.

llvm-svn: 177328

11 years agoRemove unnecessary leading comment characters in lit-only file
David Blaikie [Mon, 18 Mar 2013 22:08:16 +0000 (22:08 +0000)]
Remove unnecessary leading comment characters in lit-only file

llvm-svn: 177327

11 years agoAdd SchedRW annotations to most of X86InstrSSE.td.
Jakob Stoklund Olesen [Mon, 18 Mar 2013 22:01:35 +0000 (22:01 +0000)]
Add SchedRW annotations to most of X86InstrSSE.td.

We hitch a ride with the existing OpndItins class that was used to add
instruction itinerary classes in the many multiclasses in this file.

Use the link provided by the X86FoldableSchedWrite.Folded to find the
right SchedWrite for folded loads.

llvm-svn: 177326

11 years agoAdd a linebreak. Linebreaks are cool.
Richard Smith [Mon, 18 Mar 2013 21:57:52 +0000 (21:57 +0000)]
Add a linebreak. Linebreaks are cool.

llvm-svn: 177325

11 years agoC++11 status: mark 'extended integral types' as N/A, since we don't support
Richard Smith [Mon, 18 Mar 2013 21:44:56 +0000 (21:44 +0000)]
C++11 status: mark 'extended integral types' as N/A, since we don't support
any, and add a note that we cannot treat __int128 as an extended integral type.

llvm-svn: 177324

11 years agoAnnotate X86 arithmetic instructions with SchedRW lists.
Jakob Stoklund Olesen [Mon, 18 Mar 2013 21:32:39 +0000 (21:32 +0000)]
Annotate X86 arithmetic instructions with SchedRW lists.

This new-style scheduling information is going to replace the
instruction iteneraries.

This also serves as a test case for Andy's fix in r177317.

llvm-svn: 177323

11 years agoCheck whether a pointer is non-null (isKnownNonNull) in isKnownNonZero.
Manman Ren [Mon, 18 Mar 2013 21:23:25 +0000 (21:23 +0000)]
Check whether a pointer is non-null (isKnownNonNull) in isKnownNonZero.

This handles the case where we have an inbounds GEP with alloca as the pointer.
This fixes the regression in PR12750 and rdar://13286434.
Note that we can also fix this by handling some GEP cases in isKnownNonNull.

llvm-svn: 177321

11 years agoBring inheriting constructor implementation up-to-date with current defect
Richard Smith [Mon, 18 Mar 2013 21:12:30 +0000 (21:12 +0000)]
Bring inheriting constructor implementation up-to-date with current defect
reports, and implement implicit definition of inheriting constructors.
Remaining missing features: inheriting constructor templates, implicit
exception specifications for inheriting constructors, inheriting constructors
from dependent bases.

llvm-svn: 177320

11 years agoCentralize the recording of which tools have been constructed.
Rafael Espindola [Mon, 18 Mar 2013 20:48:54 +0000 (20:48 +0000)]
Centralize the recording of which tools have been constructed.

llvm-svn: 177319

11 years ago[analyzer] Warn when a ‘nil’ object is added to NSArray or NSMutableArray.
Anna Zaks [Mon, 18 Mar 2013 20:46:56 +0000 (20:46 +0000)]
[analyzer] Warn when a ‘nil’ object is added to NSArray or NSMutableArray.

llvm-svn: 177318

11 years agoTableGen fix for the new machine model.
Andrew Trick [Mon, 18 Mar 2013 20:42:25 +0000 (20:42 +0000)]
TableGen fix for the new machine model.

Properly handle cases where a group of instructions have different
SchedRW lists with the same itinerary class.
This was supposed to work, but I left in an early break.

llvm-svn: 177317

11 years agoInclude '.test' suffix in target specific lit configs that need it
David Blaikie [Mon, 18 Mar 2013 20:31:44 +0000 (20:31 +0000)]
Include '.test' suffix in target specific lit configs that need it

Apparently my final cleanup to use a relevant suffix for these tests before
committing r176831 caused them to stop running since lit wasn't configured to
run tests with that suffix in those directories (why don't we just have a
global suffix list?). So, add the suffix to the relevant directories & fix the
test that has bitrotted over the last week due to my debug info schema changes.

llvm-svn: 177315

11 years agoMake the fields in the diagram match the descriptive text above them.
Eric Christopher [Mon, 18 Mar 2013 20:21:47 +0000 (20:21 +0000)]
Make the fields in the diagram match the descriptive text above them.

llvm-svn: 177314

11 years agoCorrect function to decide if a SCEV can be ignored
Sebastian Pop [Mon, 18 Mar 2013 20:21:13 +0000 (20:21 +0000)]
Correct function to decide if a SCEV can be ignored

When doing SCEV based code generation, we ignore instructions calculating values
that are fully defined by a SCEV expression. The values that are calculated by
this instructions are recalculated on demand.

This commit improves the check to verify if certain instructions can be ignored
and recalculated on demand.

llvm-svn: 177313

11 years agotsan: smaller memory block headers (32b->16b)
Dmitry Vyukov [Mon, 18 Mar 2013 19:47:36 +0000 (19:47 +0000)]
tsan: smaller memory block headers (32b->16b)

llvm-svn: 177312

11 years agoObjective-C modern translator. Don't put line info
Fariborz Jahanian [Mon, 18 Mar 2013 19:41:18 +0000 (19:41 +0000)]
Objective-C modern translator. Don't put line info
into the pre-preprocessed file to be passed to
modern translator when compiling in no debug mode.
// rdar://13138170

llvm-svn: 177311

11 years agoRemoved raw references to __sun__, __FreeBSD__, __GLIBC__ and __linux__; now just...
Marshall Clow [Mon, 18 Mar 2013 19:34:07 +0000 (19:34 +0000)]
Removed raw references to __sun__, __FreeBSD__, __GLIBC__ and __linux__; now just check to see if they are defined.

llvm-svn: 177310

11 years agoScopHelper: clang-format
Tobias Grosser [Mon, 18 Mar 2013 19:19:57 +0000 (19:19 +0000)]
ScopHelper: clang-format

llvm-svn: 177309

11 years agoScopHelper: Remove some dead code
Tobias Grosser [Mon, 18 Mar 2013 19:17:07 +0000 (19:17 +0000)]
ScopHelper: Remove some dead code

llvm-svn: 177307

11 years agouse the canonical IV only when it exists
Sebastian Pop [Mon, 18 Mar 2013 19:09:49 +0000 (19:09 +0000)]
use the canonical IV only when it exists

llvm-svn: 177306

11 years agoUse early returns when checking if we already constructed a tool and when
Rafael Espindola [Mon, 18 Mar 2013 18:50:01 +0000 (18:50 +0000)]
Use early returns when checking if we already constructed a tool and when
delegating to Generic_GCC::SelectTool (it already updates the tool map).

llvm-svn: 177305

11 years agoRemoved raw references to _MSC_VER; now just check to see if it is defined.
Marshall Clow [Mon, 18 Mar 2013 18:20:48 +0000 (18:20 +0000)]
Removed raw references to _MSC_VER; now just check to see if it is defined.

llvm-svn: 177304

11 years agoRemove unused argument.
Rafael Espindola [Mon, 18 Mar 2013 18:19:46 +0000 (18:19 +0000)]
Remove unused argument.

llvm-svn: 177303

11 years agoPass an ArgList to every toolchain constructor. Remove the useIntegratedAs
Rafael Espindola [Mon, 18 Mar 2013 18:10:27 +0000 (18:10 +0000)]
Pass an ArgList to every toolchain constructor. Remove the useIntegratedAs
argument.

llvm-svn: 177301

11 years agoInline ShouldUseIntegratedAssembler and move the documentation to
Rafael Espindola [Mon, 18 Mar 2013 17:58:22 +0000 (17:58 +0000)]
Inline ShouldUseIntegratedAssembler and move the documentation to
useIntegratedAs.

llvm-svn: 177300

11 years agoRefactor a bit of duplicated code to useIntegratedAs.
Rafael Espindola [Mon, 18 Mar 2013 17:52:57 +0000 (17:52 +0000)]
Refactor a bit of duplicated code to useIntegratedAs.

llvm-svn: 177299

11 years agoUpdate
Bill Wendling [Mon, 18 Mar 2013 17:47:33 +0000 (17:47 +0000)]
Update

llvm-svn: 177298

11 years agoRemoved raw references to __APPLE__; now just check to see if it is defined.
Marshall Clow [Mon, 18 Mar 2013 17:45:34 +0000 (17:45 +0000)]
Removed raw references to __APPLE__; now just check to see if it is defined.

llvm-svn: 177297

11 years agoFix 80-col. violations in PPCCTRLoops
Hal Finkel [Mon, 18 Mar 2013 17:40:46 +0000 (17:40 +0000)]
Fix 80-col. violations in PPCCTRLoops

llvm-svn: 177296

11 years agoFix large count and negative constant count handling in PPCCTRLoops
Hal Finkel [Mon, 18 Mar 2013 17:40:44 +0000 (17:40 +0000)]
Fix large count and negative constant count handling in PPCCTRLoops

This commit fixes an assert that would occur on loops with large constant counts
(like looping for ((uint32_t) -1) iterations on PPC64). The existing code did
not handle counts that it computed to be negative (asserting instead), but
these can be created with valid inputs.

This bug was discovered by bugpoint while I was attempting to isolate a
completely different problem.

Also, in writing test cases for the negative-count problem, I discovered that
the ori/lsi handling was broken (there was a typo which caused the logic that
was supposed to detect these pairs and extract the iteration count to always
fail). This has now also been corrected (and is covered by one of the new test
cases).

llvm-svn: 177295

11 years agoCleanup initial-value constants in PPCCTRLoops
Hal Finkel [Mon, 18 Mar 2013 17:40:27 +0000 (17:40 +0000)]
Cleanup initial-value constants in PPCCTRLoops

Because the initial-value constants had not been added to the list
of instructions considered for DCE the resulting code had redundant
constant-materialization instructions.

llvm-svn: 177294

11 years agoRemove unused argument.
Rafael Espindola [Mon, 18 Mar 2013 17:25:58 +0000 (17:25 +0000)]
Remove unused argument.

llvm-svn: 177293

11 years agotsan: add support for idle threads
Dmitry Vyukov [Mon, 18 Mar 2013 17:21:15 +0000 (17:21 +0000)]
tsan: add support for idle threads

llvm-svn: 177292

11 years agoRemoved raw references to _WIN32; now just check to see if it is defined.
Marshall Clow [Mon, 18 Mar 2013 17:04:29 +0000 (17:04 +0000)]
Removed raw references to _WIN32; now just check to see if it is defined.

llvm-svn: 177291

11 years agoFix integer comparison in DIEInteger::BestForm.
Hans Wennborg [Mon, 18 Mar 2013 17:03:05 +0000 (17:03 +0000)]
Fix integer comparison in DIEInteger::BestForm.

The always-true "(int)Int == (signed)Int" comparison was found
while experimenting with a potential new Clang warning.

llvm-svn: 177290

11 years agotsan: touch less shadow memory during operations on big memory ranges
Dmitry Vyukov [Mon, 18 Mar 2013 16:56:48 +0000 (16:56 +0000)]
tsan: touch less shadow memory during operations on big memory ranges
greatly reduces memory consumption

llvm-svn: 177289

11 years agotsan: mark shadow for thread stack as "don't need" when thread exits
Dmitry Vyukov [Mon, 18 Mar 2013 15:49:07 +0000 (15:49 +0000)]
tsan: mark shadow for thread stack as "don't need" when thread exits

llvm-svn: 177288

11 years agoRemove unused argument.
Rafael Espindola [Mon, 18 Mar 2013 15:33:26 +0000 (15:33 +0000)]
Remove unused argument.

llvm-svn: 177287

11 years agotsan: better memory profiler
Dmitry Vyukov [Mon, 18 Mar 2013 13:55:33 +0000 (13:55 +0000)]
tsan: better memory profiler

llvm-svn: 177286

11 years agoReleaseNotes: Tweak hexagonv2/hexagonv3 removal note.
Matthew Curtis [Mon, 18 Mar 2013 13:08:24 +0000 (13:08 +0000)]
ReleaseNotes: Tweak hexagonv2/hexagonv3 removal note.

llvm-svn: 177284

11 years agoFix clang-format segfault.
Daniel Jasper [Mon, 18 Mar 2013 12:50:26 +0000 (12:50 +0000)]
Fix clang-format segfault.

When annotating "lines" starting with ":", clang-format would segfault.
This could actually happen in valid code, e.g.
  #define A :

llvm-svn: 177283

11 years agoObjCDictionaryElements are pod-like.
Benjamin Kramer [Mon, 18 Mar 2013 12:41:25 +0000 (12:41 +0000)]
ObjCDictionaryElements are pod-like.

llvm-svn: 177282

11 years agoRemove default copy ctor/assignment, makes AttributeSet trivially copyable.
Benjamin Kramer [Mon, 18 Mar 2013 12:14:30 +0000 (12:14 +0000)]
Remove default copy ctor/assignment, makes AttributeSet trivially copyable.

And enables SmallVector's pod optimizations.

llvm-svn: 177281

11 years agoInitially forgotten-to-svn-add test case for r177279.
David Tweed [Mon, 18 Mar 2013 12:07:24 +0000 (12:07 +0000)]
Initially forgotten-to-svn-add test case for r177279.

llvm-svn: 177280

11 years ago The optimization a + (-0.0f) -> a was being misapplied to a + (+0.0f) in the vector...
David Tweed [Mon, 18 Mar 2013 11:54:44 +0000 (11:54 +0000)]
 The optimization a + (-0.0f) -> a was being misapplied to a + (+0.0f) in the vector case (because
we weren't differntiating floating-point zeroinitializers from other zero-initializers)
which was causing problems for code relying upon a + (+0.0f) to, eg, flush denormals to
0. Make the scalar and vector cases have the same behaviour.

llvm-svn: 177279

11 years agotsan: madvise(DONTNEED) shadow memory on munmap()
Dmitry Vyukov [Mon, 18 Mar 2013 11:51:51 +0000 (11:51 +0000)]
tsan: madvise(DONTNEED) shadow memory on munmap()

llvm-svn: 177278

11 years agoR600/SI: implement indirect adressing for SI
Christian Konig [Mon, 18 Mar 2013 11:34:16 +0000 (11:34 +0000)]
R600/SI: implement indirect adressing for SI

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 177277

11 years agoR600/SI: add float vector types
Christian Konig [Mon, 18 Mar 2013 11:34:10 +0000 (11:34 +0000)]
R600/SI: add float vector types

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 177276

11 years agoR600/SI: add shl pattern
Christian Konig [Mon, 18 Mar 2013 11:34:05 +0000 (11:34 +0000)]
R600/SI: add shl pattern

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 177275

11 years agoR600/SI: add BUFFER_LOAD_DWORD pattern
Christian Konig [Mon, 18 Mar 2013 11:34:00 +0000 (11:34 +0000)]
R600/SI: add BUFFER_LOAD_DWORD pattern

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 177274

11 years agoR600/SI: implement SI.load.const intrinsic
Christian Konig [Mon, 18 Mar 2013 11:33:55 +0000 (11:33 +0000)]
R600/SI: implement SI.load.const intrinsic

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 177273

11 years agoR600/SI: enable all S_LOAD and S_BUFFER_LOAD opcodes
Christian Konig [Mon, 18 Mar 2013 11:33:50 +0000 (11:33 +0000)]
R600/SI: enable all S_LOAD and S_BUFFER_LOAD opcodes

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 177272

11 years agoR600/SI: fix inserting waits for all defines
Christian Konig [Mon, 18 Mar 2013 11:33:45 +0000 (11:33 +0000)]
R600/SI: fix inserting waits for all defines

Unfortunately the previous fix for inserting waits for unordered
defines wasn't sufficient, cause it's possible that even ordered
defines are only partially used (or not used at all).

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 177271

11 years ago[asan] make the __asan_get_heap_size more robust
Kostya Serebryany [Mon, 18 Mar 2013 10:52:25 +0000 (10:52 +0000)]
[asan] make the __asan_get_heap_size more robust

llvm-svn: 177270

11 years agotsan: move implementation out of h file
Dmitry Vyukov [Mon, 18 Mar 2013 10:32:21 +0000 (10:32 +0000)]
tsan: move implementation out of h file

llvm-svn: 177269

11 years agotsan: fix clang -Wall build
Dmitry Vyukov [Mon, 18 Mar 2013 10:10:15 +0000 (10:10 +0000)]
tsan: fix clang -Wall build
Clang does not like classes with virtual functions but w/o virtual dtor.
Go does not like libstdc++ (operator delete).

llvm-svn: 177267

11 years ago[TSan] re-apply r177249 lost in edits
Alexey Samsonov [Mon, 18 Mar 2013 09:45:22 +0000 (09:45 +0000)]
[TSan] re-apply r177249 lost in edits

llvm-svn: 177265

11 years ago[asan] when creating string constants, set unnamed_attr and align 1 so that equal...
Kostya Serebryany [Mon, 18 Mar 2013 09:38:39 +0000 (09:38 +0000)]
[asan] when creating string constants, set unnamed_attr and align 1 so that equal strings are merged by the linker. Observed up to 1% binary size reduction. Thanks to Anton Korobeynikov for the suggestion

llvm-svn: 177264

11 years ago[asan] Switch to allocator2 on Android.
Evgeniy Stepanov [Mon, 18 Mar 2013 09:22:58 +0000 (09:22 +0000)]
[asan] Switch to allocator2 on Android.

llvm-svn: 177263

11 years agotsan: fix memory leak
Dmitry Vyukov [Mon, 18 Mar 2013 09:09:41 +0000 (09:09 +0000)]
tsan: fix memory leak

llvm-svn: 177262

11 years agotsan: use StackDepot for thread creation stacks
Dmitry Vyukov [Mon, 18 Mar 2013 09:02:27 +0000 (09:02 +0000)]
tsan: use StackDepot for thread creation stacks

llvm-svn: 177261

11 years agotsan: fix Go build
Dmitry Vyukov [Mon, 18 Mar 2013 08:52:46 +0000 (08:52 +0000)]
tsan: fix Go build

llvm-svn: 177260

11 years agoMark internal classes as POD-like to get better behavior out of
Chandler Carruth [Mon, 18 Mar 2013 08:36:46 +0000 (08:36 +0000)]
Mark internal classes as POD-like to get better behavior out of
SmallVector and DenseMap.

This speeds up SROA by 25% on PR15412.

llvm-svn: 177259

11 years agotsan: use StackDepot in sync object to store creation stacks
Dmitry Vyukov [Mon, 18 Mar 2013 08:27:47 +0000 (08:27 +0000)]
tsan: use StackDepot in sync object to store creation stacks

llvm-svn: 177258

11 years agoTLS support for MinGW targets.
Anton Korobeynikov [Mon, 18 Mar 2013 08:12:28 +0000 (08:12 +0000)]
TLS support for MinGW targets.
MinGW is almost completely compatible to MSVC, with the exception of the _tls_array global not being available.

Patch by David Nadlinger!

llvm-svn: 177257

11 years agoWindows TLS: Section name prefix to ensure correct order
Anton Korobeynikov [Mon, 18 Mar 2013 08:10:10 +0000 (08:10 +0000)]
Windows TLS: Section name prefix to ensure correct order
The linker sorts the .tls$<xyz> sections by name, and we need
to make sure any extra sections we produce (e.g. for weak globals)
always end up between .tls$AAA and .tls$ZZZ, even if the name
starts with e.g. an underscore.

Patch by David Nadlinger!

llvm-svn: 177256

11 years agotsan: fix huge stack frames
Dmitry Vyukov [Mon, 18 Mar 2013 08:09:42 +0000 (08:09 +0000)]
tsan: fix huge stack frames

llvm-svn: 177255

11 years ago[asan] while generating the description of a global variable, emit the module name...
Kostya Serebryany [Mon, 18 Mar 2013 08:05:29 +0000 (08:05 +0000)]
[asan] while generating the description of a global variable, emit the module name in a separate field, thus not duplicating this information if every description. This decreases the binary size (observed up to 3%). https://code.google.com/p/address-sanitizer/issues/detail?id=168 . This changes the asan API version. llvm-part

llvm-svn: 177254

11 years ago[asan] while generating the description of a global variable, emit the module name...
Kostya Serebryany [Mon, 18 Mar 2013 08:04:55 +0000 (08:04 +0000)]
[asan] while generating the description of a global variable, emit the module name in a separate field, thus not duplicating this information if every description. This decreases the binary size (observed up to 3%). https://code.google.com/p/address-sanitizer/issues/detail?id=168 . This changes the asan API version. compiler-rt part, llvm-part will follow

llvm-svn: 177253

11 years agoMake sure to use same EABI version for external assembler as for integrated as.
Anton Korobeynikov [Mon, 18 Mar 2013 07:59:20 +0000 (07:59 +0000)]
Make sure to use same EABI version for external assembler as for integrated as.
Patch by Andrew Turner!

llvm-svn: 177252

11 years agotsan: fix lint warnings
Dmitry Vyukov [Mon, 18 Mar 2013 07:58:20 +0000 (07:58 +0000)]
tsan: fix lint warnings

llvm-svn: 177251

11 years ago[asan] don't instrument functions with available_externally linkage. This saves a...
Kostya Serebryany [Mon, 18 Mar 2013 07:33:49 +0000 (07:33 +0000)]
[asan] don't instrument functions with available_externally linkage. This saves a bit of compile time and reduces the number of redundant global strings generated by asan (https://code.google.com/p/address-sanitizer/issues/detail?id=167)

llvm-svn: 177250

11 years ago[TSan] fix undefined variable in debug TSan build
Alexey Samsonov [Mon, 18 Mar 2013 07:33:00 +0000 (07:33 +0000)]
[TSan] fix undefined variable in debug TSan build

llvm-svn: 177249

11 years ago[TSan] Use ThreadRegistry::FindThreadContextLocked() to find thread by its stack...
Alexey Samsonov [Mon, 18 Mar 2013 07:02:08 +0000 (07:02 +0000)]
[TSan] Use ThreadRegistry::FindThreadContextLocked() to find thread by its stack/tls address.

llvm-svn: 177248

11 years ago[TSan] Makefiles: allow configurable paths to clang and FileCheck. Add -fno-rtti...
Alexey Samsonov [Mon, 18 Mar 2013 07:00:36 +0000 (07:00 +0000)]
[TSan] Makefiles: allow configurable paths to clang and FileCheck. Add -fno-rtti flag.

llvm-svn: 177247

11 years ago[Sanitizer] Get rid of global mutexes in StopTheWorld implementation
Alexey Samsonov [Mon, 18 Mar 2013 06:27:13 +0000 (06:27 +0000)]
[Sanitizer] Get rid of global mutexes in StopTheWorld implementation

llvm-svn: 177246

11 years ago[Sanitizer] Rely on template argument deduction in sanitizer_allocator_test
Alexey Samsonov [Mon, 18 Mar 2013 06:07:44 +0000 (06:07 +0000)]
[Sanitizer] Rely on template argument deduction in sanitizer_allocator_test

llvm-svn: 177245

11 years agoExtract a method.
Jakob Stoklund Olesen [Mon, 18 Mar 2013 04:08:07 +0000 (04:08 +0000)]
Extract a method.

This computes the type of an instruction operand or result based on the
records in the instruction's ins and outs lists.

llvm-svn: 177244

11 years agoPost process ADC/SBB and use a shorter encoding if they use a sign extended immediate.
Craig Topper [Mon, 18 Mar 2013 03:34:55 +0000 (03:34 +0000)]
Post process ADC/SBB and use a shorter encoding if they use a sign extended immediate.

llvm-svn: 177243

11 years agoRefactor some duplicated code into helper functions.
Craig Topper [Mon, 18 Mar 2013 02:53:34 +0000 (02:53 +0000)]
Refactor some duplicated code into helper functions.

llvm-svn: 177242

11 years agoFix the build broken in r177239
David Blaikie [Sun, 17 Mar 2013 21:32:54 +0000 (21:32 +0000)]
Fix the build broken in r177239

Seems some accidental C++11 crept in there. Reported by the C++98 buildbots.

llvm-svn: 177241

11 years agoReduced dont-infinite-loop-during-block-escape-analysis.ll with bugpoint and moved...
Michael Gottesman [Sun, 17 Mar 2013 21:31:12 +0000 (21:31 +0000)]
Reduced dont-infinite-loop-during-block-escape-analysis.ll with bugpoint and moved it to retain-block-escape-analysis.ll.

*NOTE* I verified that the original bug behind
dont-infinite-loop-during-block-escape-analysis.ll occurs when using opt on
retain-block-escape-analysis.ll.

llvm-svn: 177240

11 years agoSplit out filename & directory from DIFile to start generalizing over DIScopes
David Blaikie [Sun, 17 Mar 2013 21:13:55 +0000 (21:13 +0000)]
Split out filename & directory from DIFile to start generalizing over DIScopes

This is the first step to making all DIScopes have a common metadata prefix (so
that things (using directives, for example) that can appear in any scope can be
added to that common prefix). DIFile is itself a DIScope so the common prefix
of all DIScopes cannot be a DIFile - instead it's the raw filename/directory
name pair.

llvm-svn: 177239

11 years agoGeneralize debug info test to be resilient to changes in metadata node numbering
David Blaikie [Sun, 17 Mar 2013 21:08:22 +0000 (21:08 +0000)]
Generalize debug info test to be resilient to changes in metadata node numbering

llvm-svn: 177238

11 years agoGeneralize a few debug info test cases
David Blaikie [Sun, 17 Mar 2013 20:29:22 +0000 (20:29 +0000)]
Generalize a few debug info test cases

Checking for the annotation comment rather than the metadata values makes these
tests resilient to a coming refactor that will pull these fields out into a
separate metadata node.

llvm-svn: 177237

11 years agoImprove DIFile debug info annotation by letting it fallback to DIScope
David Blaikie [Sun, 17 Mar 2013 20:28:12 +0000 (20:28 +0000)]
Improve DIFile debug info annotation by letting it fallback to DIScope

llvm-svn: 177236

11 years agoUse ArrayRef<MVT::SimpleValueType> when possible.
Jakob Stoklund Olesen [Sun, 17 Mar 2013 17:26:09 +0000 (17:26 +0000)]
Use ArrayRef<MVT::SimpleValueType> when possible.

Not passing vector references around makes it possible to use
SmallVector in most places.

llvm-svn: 177235

11 years agoTo avoid symbol clash, undefine PPC here. PPC may be predefined on some hosts.
Sylvestre Ledru [Sun, 17 Mar 2013 12:40:42 +0000 (12:40 +0000)]
To avoid symbol clash, undefine PPC here. PPC may be predefined on some hosts.

llvm-svn: 177234

11 years agoBuild LLVMgold.so on FreeBSD using cmake.
Rafael Espindola [Sun, 17 Mar 2013 12:01:05 +0000 (12:01 +0000)]
Build LLVMgold.so on FreeBSD using cmake.
Patch by Stephen Checkoway.

llvm-svn: 177233

11 years agoThe promised test case for r175939.
Michael Gottesman [Sun, 17 Mar 2013 08:42:58 +0000 (08:42 +0000)]
The promised test case for r175939.

This test makes sure that the ObjCARC escape analysis looks at the uses of
instructions which copy the block pointer value by checking all four cases where
that can occur.

llvm-svn: 177232

11 years agoImprove PPC VR (Altivec) register spilling
Hal Finkel [Sun, 17 Mar 2013 04:43:44 +0000 (04:43 +0000)]
Improve PPC VR (Altivec) register spilling

This change cleans up two issues with Altivec register spilling:

  1. The spilling code was inefficient (using two instructions, and add and a
     load, when just one would do)

  2. The code assumed that r0 would always be available (true for now, but this
     will change)

The new code handles VR spilling just like GPR spills but forced into r+r mode.
As a result, when any VR spills are present, we must now always allocate the
register-scavenger spill slot.

llvm-svn: 177231