platform/upstream/llvm.git
11 years ago[asan] asan_allocator2: improve FindHeapChunkByAddress to find memory chunks to the...
Kostya Serebryany [Wed, 19 Dec 2012 08:32:50 +0000 (08:32 +0000)]
[asan] asan_allocator2: improve FindHeapChunkByAddress to find memory chunks to the left of a given address. Almost all tests pass with the new allocator now, only 6 are left to fix.

llvm-svn: 170511

11 years agoChange TargetLowering::getTruncStoreAction to take MVTs, instead of EVTs.
Patrik Hagglund [Wed, 19 Dec 2012 08:28:51 +0000 (08:28 +0000)]
Change TargetLowering::getTruncStoreAction to take MVTs, instead of EVTs.

llvm-svn: 170510

11 years agoDOC: add a benchmarks that compares us to gcc and icc.
Nadav Rotem [Wed, 19 Dec 2012 08:28:24 +0000 (08:28 +0000)]
DOC: add a benchmarks that compares us to gcc and icc.

llvm-svn: 170509

11 years ago[Sanitizer] implement internal_isatty on Windows
Alexey Samsonov [Wed, 19 Dec 2012 07:57:42 +0000 (07:57 +0000)]
[Sanitizer] implement internal_isatty on Windows

llvm-svn: 170507

11 years agoOptimized load + SIGN_EXTEND patterns in the X86 backend.
Elena Demikhovsky [Wed, 19 Dec 2012 07:50:20 +0000 (07:50 +0000)]
Optimized load + SIGN_EXTEND patterns in the X86 backend.

llvm-svn: 170506

11 years agoAfter reducing the size of an operation in the DAG we zero-extend the reduced
Nadav Rotem [Wed, 19 Dec 2012 07:39:08 +0000 (07:39 +0000)]
After reducing the size of an operation in the DAG we zero-extend the reduced
bitwidth op back to the original size. If we reduce ANDs then this can cause
an endless loop. This patch changes the ZEXT to ANY_EXTEND if the demanded bits
are equal or smaller than the size of the reduced operation.

llvm-svn: 170505

11 years agodocs: fix typos.
Nadav Rotem [Wed, 19 Dec 2012 07:36:35 +0000 (07:36 +0000)]
docs: fix typos.

llvm-svn: 170504

11 years agoDOC: Add a webpage that describes the loop and bb vectorizers.
Nadav Rotem [Wed, 19 Dec 2012 07:22:24 +0000 (07:22 +0000)]
DOC: Add a webpage that describes the loop and bb vectorizers.

llvm-svn: 170503

11 years agoRename the 'Attributes' class to 'Attribute'. It's going to represent a single attrib...
Bill Wendling [Wed, 19 Dec 2012 07:18:57 +0000 (07:18 +0000)]
Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.

llvm-svn: 170502

11 years agoRename the 'Attributes' class to 'Attribute'. It's going to represent a single attrib...
Bill Wendling [Wed, 19 Dec 2012 07:18:12 +0000 (07:18 +0000)]
Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.

llvm-svn: 170500

11 years agotsan: fix -Wgnu warnings
Dmitry Vyukov [Wed, 19 Dec 2012 06:59:45 +0000 (06:59 +0000)]
tsan: fix -Wgnu warnings

llvm-svn: 170499

11 years ago[sanitizer] one more stability fix in 64-bit allocator
Kostya Serebryany [Wed, 19 Dec 2012 06:51:45 +0000 (06:51 +0000)]
[sanitizer] one more stability fix in 64-bit allocator

llvm-svn: 170498

11 years agoRemove more of 'else's after 'returns'. No functional change.
Craig Topper [Wed, 19 Dec 2012 06:43:58 +0000 (06:43 +0000)]
Remove more  of 'else's after 'returns'. No functional change.

llvm-svn: 170497

11 years agoRemove a bunch of 'else's after 'returns'
Craig Topper [Wed, 19 Dec 2012 06:39:17 +0000 (06:39 +0000)]
Remove a bunch of 'else's after 'returns'

llvm-svn: 170496

11 years agoTeach SimplifySetCC that comparing AssertZext i1 against a constant 1 can be rewritte...
Craig Topper [Wed, 19 Dec 2012 06:12:28 +0000 (06:12 +0000)]
Teach SimplifySetCC that comparing AssertZext i1 against a constant 1 can be rewritten as a compare against a constant 0 with the opposite condition.

llvm-svn: 170495

11 years agoAdd some missing Defs and Uses.
Reed Kotler [Wed, 19 Dec 2012 04:06:15 +0000 (04:06 +0000)]
Add some missing Defs and Uses.

llvm-svn: 170493

11 years agoAttempt to clarify a vexing-parse diagnostic.
Richard Smith [Wed, 19 Dec 2012 03:15:32 +0000 (03:15 +0000)]
Attempt to clarify a vexing-parse diagnostic.

llvm-svn: 170492

11 years ago<rdar://problem/11961650>
Jason Molenda [Wed, 19 Dec 2012 02:54:03 +0000 (02:54 +0000)]
<rdar://problem/11961650>

Update the debugserver "qProcessInfo" implementation to return the
cpu type, cpu subtype, OS and vendor information just like qHostInfo
does so lldb can create an ArchSpec based on the returned values.

Add a new GetProcessArchitecture to GDBRemoteCommunicationClient akin
to GetHostArchitecture.  If the qProcessInfo packet is supported,
GetProcessArchitecture will return the cpu type / subtype of the
process -- e.g. a 32-bit user process running on a 64-bit x86_64 Mac
system.

Have ProcessGDBRemote set the Target's architecture based on the
GetProcessArchitecture when we've completed an attach/launch/connect.

llvm-svn: 170491

11 years agoFix assertion failure in self-host (and probably bogus template instantiation
Richard Smith [Wed, 19 Dec 2012 02:27:38 +0000 (02:27 +0000)]
Fix assertion failure in self-host (and probably bogus template instantiation
too). When instantiating a direct-initializer, if we find it has zero
arguments, produce an empty ParenListExpr rather than returning a null
expression.

llvm-svn: 170490

11 years agoPR13470: Ensure that copy-list-initialization isntantiates as
Richard Smith [Wed, 19 Dec 2012 01:39:02 +0000 (01:39 +0000)]
PR13470: Ensure that copy-list-initialization isntantiates as
copy-list-initialization (and doesn't add an additional copy step):

Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it
when instantiating initializers in order to correctly handle instantiation of
copy-list-initialization. Teach TreeTransform that function arguments are
initializations, and so need this special treatment too. Finally, remove some
hacks which were working around SubstInitializer's shortcomings.

llvm-svn: 170489

11 years agoPass AnalyzerOptions to PathDiagnosticConsumer to make analyzer options accessible...
Ted Kremenek [Wed, 19 Dec 2012 01:35:35 +0000 (01:35 +0000)]
Pass AnalyzerOptions to PathDiagnosticConsumer to make analyzer options accessible there.

This is plumbing needed for later functionality changes.

llvm-svn: 170488

11 years agoSimplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.
Ted Kremenek [Wed, 19 Dec 2012 01:16:49 +0000 (01:16 +0000)]
Simplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.

llvm-svn: 170487

11 years agoMake sure the buffer, which containas an instance of APFloat, has proper alignment.
Shuxin Yang [Wed, 19 Dec 2012 01:10:17 +0000 (01:10 +0000)]
Make sure the buffer, which containas an instance of APFloat, has proper alignment.

llvm-svn: 170486

11 years agofixes a doxygen comment.
Fariborz Jahanian [Wed, 19 Dec 2012 01:00:36 +0000 (01:00 +0000)]
fixes a doxygen comment.

llvm-svn: 170485

11 years agotest/Index/preamble_macro_template.cpp: Suppress this probably due to Lit/win32 issue...
NAKAMURA Takumi [Wed, 19 Dec 2012 00:57:48 +0000 (00:57 +0000)]
test/Index/preamble_macro_template.cpp: Suppress this probably due to Lit/win32 issue. Investigating.

llvm-svn: 170484

11 years ago[Core][ErrorOr] Add support for user error data.
Michael J. Spencer [Wed, 19 Dec 2012 00:51:07 +0000 (00:51 +0000)]
[Core][ErrorOr] Add support for user error data.

llvm-svn: 170483

11 years agoChange DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as per review...
David Blaikie [Wed, 19 Dec 2012 00:45:41 +0000 (00:45 +0000)]
Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as per review discussion in r170365

This does limit these typedefs to being sequences, but no current usage
requires them to be contiguous (we could expand this to a more general
iterator pair range concept at some point).

Also, it'd be nice if SmallVector were constructible directly from an ArrayRef
but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the
inverse conversion. (& generalizing over all range-like things, while nice,
would require some nontrivial SFINAE I haven't thought about yet)

llvm-svn: 170482

11 years agoIncreas number of iterations before a new libclang format object
Fariborz Jahanian [Wed, 19 Dec 2012 00:35:23 +0000 (00:35 +0000)]
Increas number of iterations before a new libclang format object
is created to 1000.

llvm-svn: 170481

11 years agoMake sure CodeGen uses a value of the correct type as the result of
Eli Friedman [Wed, 19 Dec 2012 00:26:58 +0000 (00:26 +0000)]
Make sure CodeGen uses a value of the correct type as the result of
of assignment to a bool bitfield.  PR14638.

llvm-svn: 170480

11 years agohttp://llvm.org/bugs/show_bug.cgi?id=14629
Greg Clayton [Wed, 19 Dec 2012 00:15:34 +0000 (00:15 +0000)]
http://llvm.org/bugs/show_bug.cgi?id=14629

Fixed incorrect documentation.

llvm-svn: 170479

11 years agoSome code refactoring per Dimitri's comment.
Fariborz Jahanian [Wed, 19 Dec 2012 00:01:48 +0000 (00:01 +0000)]
Some code refactoring per Dimitri's comment.

llvm-svn: 170478

11 years agoAdd to the disassembler C API an option to print the disassembled
Kevin Enderby [Tue, 18 Dec 2012 23:47:28 +0000 (23:47 +0000)]
Add to the disassembler C API an option to print the disassembled
instructions in the assembly code variant if one exists.

The intended use for this is so tools like lldb and darwin's otool(1)
can be switched to print Intel-flavored disassembly.

I discussed extensively this API with Jim Grosbach and we feel
while it may not be fully general, in reality there is only one syntax
for each assembly with the exception of X86 which has exactly
two for historical reasons.

rdar://10989182

llvm-svn: 170477

11 years agoDon't read the SP when getting argument values from registers in case the SP isn...
Greg Clayton [Tue, 18 Dec 2012 23:45:33 +0000 (23:45 +0000)]
Don't read the SP when getting argument values from registers in case the SP isn't available. We don't want the availability of SP to limit when we get get arguments from registers.

llvm-svn: 170476

11 years agoRemove MachineInstr::setIsInsideBundle().
Jakob Stoklund Olesen [Tue, 18 Dec 2012 23:40:14 +0000 (23:40 +0000)]
Remove MachineInstr::setIsInsideBundle().

The bundle flags are now maintained by the slightly higher-level
functions bundleWithPred() / bundleWithSucc() which enforce consistent
bundle flags between neighboring instructions.

See also MIBundleBuilder for an even higher-level approach to building
bundles.

llvm-svn: 170475

11 years agoFix a crash in diagnostic printing when a template class type is diff'ed
Eli Friedman [Tue, 18 Dec 2012 23:32:47 +0000 (23:32 +0000)]
Fix a crash in diagnostic printing when a template class type is diff'ed
against itself. PR14489.

llvm-svn: 170474

11 years agoUse bidirectional bundle flags to simplify important functions.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 23:21:49 +0000 (23:21 +0000)]
Use bidirectional bundle flags to simplify important functions.

The bundle_iterator::operator++ function now doesn't need to dig out the
basic block and check against end(). It can use the isBundledWithSucc()
flag to find the last bundled instruction safely.

Similarly, MachineInstr::isBundled() no longer needs to look at
iterators etc. It only has to look at flags.

llvm-svn: 170473

11 years agoEnable the loop vectorizer in clang via -fvectorize
Nadav Rotem [Tue, 18 Dec 2012 23:10:16 +0000 (23:10 +0000)]
Enable the loop vectorizer in clang via -fvectorize

llvm-svn: 170472

11 years agordar://12801297
Shuxin Yang [Tue, 18 Dec 2012 23:10:12 +0000 (23:10 +0000)]
rdar://12801297

 InstCombine for unsafe floating-point add/sub.

llvm-svn: 170471

11 years agoEnable the loop vectorizer in clang and not in the pass manager, so that we can disab...
Nadav Rotem [Tue, 18 Dec 2012 23:09:44 +0000 (23:09 +0000)]
Enable the loop vectorizer in clang and not in the pass manager, so that we can disable it in clang.

llvm-svn: 170470

11 years agoFix the fvectorize testcase
Nadav Rotem [Tue, 18 Dec 2012 23:08:58 +0000 (23:08 +0000)]
Fix the fvectorize testcase

llvm-svn: 170469

11 years agoHave clang_getSpellingLocation() use the same logic as DiagnosticRenderer for plowing...
Ted Kremenek [Tue, 18 Dec 2012 23:07:30 +0000 (23:07 +0000)]
Have clang_getSpellingLocation() use the same logic as DiagnosticRenderer for plowing through macros.

This fixes a subtle bug reported in <rdar://problem/12584554> where a double-nested
macro could lead to an incorrect fixit location with live issues.

This fix also uncovers a bunch of subtle bugs in our indexer test cases which
are now fixed (mostly around source ranges for attributes).

llvm-svn: 170468

11 years agoThis is the libclang patch providing minimal API to
Fariborz Jahanian [Tue, 18 Dec 2012 23:02:59 +0000 (23:02 +0000)]
This is the libclang patch providing minimal API to
use clang's formatter. Currently, formatter is used
to format declaration tags for xml comments. Since formatter
is in flux and its change will break several of the clang comment
tests, only a single tests is formatted using this facility.
Doug has reviewed and approved it for check-in.

llvm-svn: 170467

11 years agoBe defensive when printing module import locations; the diagnostic printer needs...
Douglas Gregor [Tue, 18 Dec 2012 23:02:07 +0000 (23:02 +0000)]
Be defensive when printing module import locations; the diagnostic printer needs to be robust

llvm-svn: 170466

11 years agoVerify bundle flag consistency when setting them.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 23:00:28 +0000 (23:00 +0000)]
Verify bundle flag consistency when setting them.

Now that the bundle flag aware APIs are all in place, it is possible to
continuously verify the flag consistency.

llvm-svn: 170465

11 years agoReverse order of checking SSE level when calculating compare cost, so we check
Jakub Staszak [Tue, 18 Dec 2012 22:57:56 +0000 (22:57 +0000)]
Reverse order of checking SSE level when calculating compare cost, so we check
AVX2 before AVX.

llvm-svn: 170464

11 years agoVerify bundle flags for consistency in MachineVerifier.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 22:55:07 +0000 (22:55 +0000)]
Verify bundle flags for consistency in MachineVerifier.

The new bidirectional bundle flags are redundant, so inadvertent bundle
tearing can be detected in the machine code verifier.

llvm-svn: 170463

11 years agoDisable ARM partial flag dependency optimization at -Oz
Quentin Colombet [Tue, 18 Dec 2012 22:47:16 +0000 (22:47 +0000)]
Disable ARM partial flag dependency optimization at -Oz

To not over constrain the scheduler for ARM in thumb mode, some optimizations  for code size reduction, specific to ARM thumb, are blocked when they add a dependency (like write after read dependency).

Disables this check when code size is the priority, i.e., code is compiled with -Oz.

llvm-svn: 170462

11 years agoSimilar to 170440 - fix build warning with gcc
Eli Bendersky [Tue, 18 Dec 2012 22:22:16 +0000 (22:22 +0000)]
Similar to 170440 - fix build warning with gcc

llvm-svn: 170461

11 years agoDon't allow the automatically updated MI flags to be set directly.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 21:36:05 +0000 (21:36 +0000)]
Don't allow the automatically updated MI flags to be set directly.

The bundle-related MI flags need to be kept in sync with the neighboring
instructions. Don't allow the bulk flag-setting setFlags() function to
change them.

Also don't copy MI flags when cloning an instruction. The clone's bundle
flags will be set when it is explicitly inserted into a bundle.

llvm-svn: 170459

11 years agoAdd tests to check recent changes to some builtins.
Bill Wendling [Tue, 18 Dec 2012 21:09:25 +0000 (21:09 +0000)]
Add tests to check recent changes to some builtins.

llvm-svn: 170458

11 years agoBetter support for constructor initializers.
Daniel Jasper [Tue, 18 Dec 2012 21:05:13 +0000 (21:05 +0000)]
Better support for constructor initializers.

We used to format initializers like this (with a sort of hacky implementation):
Constructor()
    : Val1(A),
      Val2(B) {

and now format like this (with a somewhat better solution):
Constructor()
    : Val1(A), Val2(B) {

assuming this would not fit on a single line. Also added tests.

As a side effect we now first analyze whether an UnwrappedLine needs to be
split at all. If not, not splitting it is the best solution by definition. As
this should be a very common case in normal code, not exploring the entire
solution space can provide significant speedup.

llvm-svn: 170457

11 years agoTighten up the splice() API for bundled instructions.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 20:59:41 +0000 (20:59 +0000)]
Tighten up the splice() API for bundled instructions.

Remove the instr_iterator versions of the splice() functions. It doesn't
seem useful to be able to splice sequences of instructions that don't
consist of full bundles.

The normal splice functions that take MBB::iterator arguments are not
changed, and they can move whole bundles around without any problems.

llvm-svn: 170456

11 years agoCodeGen: Expand creal and cimag into complex field loads
Meador Inge [Tue, 18 Dec 2012 20:58:04 +0000 (20:58 +0000)]
CodeGen: Expand creal and cimag into complex field loads

PR 14529 was opened because neither Clang or LLVM was expanding
calls to creal* or cimag* into instructions that just load the
respective complex field.  After some discussion, it was not
considered realistic to do this in LLVM because of the platform
specific way complex types are expanded.  Thus a way to solve
this in Clang was pursued.  GCC does a similar expansion.

This patch adds the feature to Clang by making the creal* and
cimag* functions library builtins and modifying the builtin code
generator to look for the new builtin types.

llvm-svn: 170455

11 years agoMISched: add dependence to ExitSU to model live-out latency.
Andrew Trick [Tue, 18 Dec 2012 20:53:01 +0000 (20:53 +0000)]
MISched: add dependence to ExitSU to model live-out latency.

llvm-svn: 170454

11 years agoMISched: Cleanup, redundant statement.
Andrew Trick [Tue, 18 Dec 2012 20:52:58 +0000 (20:52 +0000)]
MISched: Cleanup, redundant statement.

llvm-svn: 170453

11 years agoMISched: Heuristics, compare latency more precisely. It matters more for some targets.
Andrew Trick [Tue, 18 Dec 2012 20:52:56 +0000 (20:52 +0000)]
MISched: Heuristics, compare latency more precisely. It matters more for some targets.

llvm-svn: 170452

11 years agoMISched: Remove SchedRemainder::IsResourceLimited. I don't know how to compute it.
Andrew Trick [Tue, 18 Dec 2012 20:52:54 +0000 (20:52 +0000)]
MISched: Remove SchedRemainder::IsResourceLimited. I don't know how to compute it.

llvm-svn: 170451

11 years agoMISched: cleanup, use the proper iterator type.
Andrew Trick [Tue, 18 Dec 2012 20:52:52 +0000 (20:52 +0000)]
MISched: cleanup, use the proper iterator type.

llvm-svn: 170450

11 years agoMISched: minor improvement, initialize remaining resources before the first schedulin...
Andrew Trick [Tue, 18 Dec 2012 20:52:49 +0000 (20:52 +0000)]
MISched: minor improvement, initialize remaining resources before the first scheduling decision.

llvm-svn: 170449

11 years agoFix typo in error message (print requested URL instead of command name when plugin...
Daniel Malea [Tue, 18 Dec 2012 20:00:40 +0000 (20:00 +0000)]
Fix typo in error message (print requested URL instead of command name when plugin missing)

llvm-svn: 170447

11 years agoMake the format scrambler understand line comments.
Daniel Jasper [Tue, 18 Dec 2012 19:56:56 +0000 (19:56 +0000)]
Make the format scrambler understand line comments.

This allows for writing tests including line comments easier and more readable.
We will need more of those tests in the future and also line comments are
useful to force line breaks in tests.

llvm-svn: 170446

11 years agoAllow reading registers by thread ID in ProcessMonitor (Linux implementation)
Daniel Malea [Tue, 18 Dec 2012 19:50:15 +0000 (19:50 +0000)]
Allow reading registers by thread ID in ProcessMonitor (Linux implementation)
- make FreeBSD ProcessMonitor API thread-ready

Patch by Matt Kopec!

llvm-svn: 170445

11 years agoCMake: Make sure to detect LibXml2 when Clang is built standalone
Douglas Gregor [Tue, 18 Dec 2012 19:39:40 +0000 (19:39 +0000)]
CMake: Make sure to detect LibXml2 when Clang is built standalone

llvm-svn: 170444

11 years agoAdd an assertion for a likely ilist::splice() contract violation.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 19:28:37 +0000 (19:28 +0000)]
Add an assertion for a likely ilist::splice() contract violation.

The single-element ilist::splice() function supports a noop move:

  List.splice(I, List, I);

The corresponding std::list function doesn't allow that, so add a unit
test to document that behavior.

This also means that

  List.splice(I, List, F);

is somewhat surprisingly not equivalent to

  List.splice(I, List, F, next(F));

This patch adds an assertion to catch the illegal case I == F above.
Alternatively, we could make I == F a legal noop, but that would make
ilist differ even more from std::list.

llvm-svn: 170443

11 years agoTweaking a comment in the NSURL formatter for correctness - the code was doing the...
Enrico Granata [Tue, 18 Dec 2012 19:22:05 +0000 (19:22 +0000)]
Tweaking a comment in the NSURL formatter for correctness - the code was doing the right thing, but the comment was highly misleading

llvm-svn: 170441

11 years agoFix a compilation warning with gcc 4.6
Eli Bendersky [Tue, 18 Dec 2012 18:53:14 +0000 (18:53 +0000)]
Fix a compilation warning with gcc 4.6

llvm-svn: 170440

11 years agoLoopVectorize: Emit reductions as log2(vectorsize) shuffles + vector ops instead...
Benjamin Kramer [Tue, 18 Dec 2012 18:40:20 +0000 (18:40 +0000)]
LoopVectorize: Emit reductions as log2(vectorsize) shuffles + vector ops instead of scalar operations.

For example on x86 with SSE4.2 a <8 x i8> add reduction becomes
movdqa %xmm0, %xmm1
movhlps %xmm1, %xmm1            ## xmm1 = xmm1[1,1]
paddw %xmm0, %xmm1
pshufd $1, %xmm1, %xmm0        ## xmm0 = xmm1[1,0,0,0]
paddw %xmm1, %xmm0
phaddw %xmm0, %xmm0
pextrb $0, %xmm0, %edx

instead of
pextrb $2, %xmm0, %esi
pextrb $0, %xmm0, %edx
addb %sil, %dl
pextrb $4, %xmm0, %esi
addb %dl, %sil
pextrb $6, %xmm0, %edx
addb %sil, %dl
pextrb $8, %xmm0, %esi
addb %dl, %sil
pextrb $10, %xmm0, %edi
pextrb $14, %xmm0, %edx
addb %sil, %dil
pextrb $12, %xmm0, %esi
addb %dil, %sil
addb %sil, %dl

llvm-svn: 170439

11 years agoGet rid of the pesky -Woverloaded-virtual warning. No change in functionality.
Eli Bendersky [Tue, 18 Dec 2012 18:21:29 +0000 (18:21 +0000)]
Get rid of the pesky -Woverloaded-virtual warning. No change in functionality.

llvm-svn: 170438

11 years agoTighten the insert() API for bundled instructions.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 17:54:53 +0000 (17:54 +0000)]
Tighten the insert() API for bundled instructions.

The normal insert() function takes an MBB::iterator position, and
inserts a stand-alone MachineInstr as before.

The insert() function that takes an MBB::instr_iterator position can
insert instructions inside a bundle, and will now update the bundle
flags correctly when that happens.

When the insert position is between two bundles, it is unclear whether
the instruction should be appended to the previous bundle, prepended to
the next bundle, or stand on its own. The MBB::insert() function doesn't
bundle the instruction in that case, use the MIBundleBuilder class for
that.

llvm-svn: 170437

11 years agoCheck multiple register classes for inline asm tied registers
Hal Finkel [Tue, 18 Dec 2012 17:50:58 +0000 (17:50 +0000)]
Check multiple register classes for inline asm tied registers

A register can be associated with several distinct register classes.
For example, on PPC, the floating point registers are each associated with
both F4RC (which holds f32) and F8RC (which holds f64). As a result, this code
would fail when provided with a floating point register and an f64 operand
because it would happen to find the register in the F4RC class first and
return that. From the F4RC class, SDAG would extract f32 as the register
type and then assert because of the invalid implied conversion between
the f64 value and the f32 register.

Instead, search all register classes. If a register class containing the
the requested register has the requested type, then return that register
class. Otherwise, as before, return the first register class found that
contains the requested register.

llvm-svn: 170436

11 years agoAdded static_assert to std::get<N>(std::array) calls to catch "out of bounds" calls
Marshall Clow [Tue, 18 Dec 2012 16:46:30 +0000 (16:46 +0000)]
Added static_assert to std::get<N>(std::array) calls to catch "out of bounds" calls

llvm-svn: 170435

11 years ago[sanitizer] fix LargeMmapAllocator::GetBlockBegin
Kostya Serebryany [Tue, 18 Dec 2012 14:56:38 +0000 (14:56 +0000)]
[sanitizer] fix LargeMmapAllocator::GetBlockBegin

llvm-svn: 170434

11 years agotsan: intercept fork() to prevent false race reports on fd's
Dmitry Vyukov [Tue, 18 Dec 2012 14:44:44 +0000 (14:44 +0000)]
tsan: intercept fork() to prevent false race reports on fd's

llvm-svn: 170433

11 years agoRe-commit r170428 changes with Linux style file endings.
Guy Benyei [Tue, 18 Dec 2012 14:38:23 +0000 (14:38 +0000)]
Re-commit r170428 changes with Linux style file endings.

Add OpenCL images as clang builtin types.

llvm-svn: 170432

11 years agoRevert changes from r170428, as I accidentally changed the line endings of these...
Guy Benyei [Tue, 18 Dec 2012 14:30:41 +0000 (14:30 +0000)]
Revert changes from r170428, as I accidentally changed the line endings of these files to Windows style.

llvm-svn: 170431

11 years agotsan: warn about reports from signal handlers
Dmitry Vyukov [Tue, 18 Dec 2012 14:19:24 +0000 (14:19 +0000)]
tsan: warn about reports from signal handlers

llvm-svn: 170430

11 years agotsan: add signalfd() and inotify_init() interceptors
Dmitry Vyukov [Tue, 18 Dec 2012 12:35:31 +0000 (12:35 +0000)]
tsan: add signalfd() and inotify_init() interceptors

llvm-svn: 170429

11 years agoAdd OpenCL images as clang builtin types.
Guy Benyei [Tue, 18 Dec 2012 12:30:03 +0000 (12:30 +0000)]
Add OpenCL images as clang builtin types.

llvm-svn: 170428

11 years agotsan: add io_sync flag that controls amount of IO synchronization
Dmitry Vyukov [Tue, 18 Dec 2012 12:20:55 +0000 (12:20 +0000)]
tsan: add io_sync flag that controls amount of IO synchronization

llvm-svn: 170427

11 years agotsan: remove TSAN_OPTIONS from the script
Dmitry Vyukov [Tue, 18 Dec 2012 12:19:50 +0000 (12:19 +0000)]
tsan: remove TSAN_OPTIONS from the script
The runtime skips atexit sleep if there are no threads now,
so it must be fast w/o it.
Allows to specify own TSAN_OPTIONS for the tests.

llvm-svn: 170426

11 years agoRemove obsolete FIXMEs.
David Chisnall [Tue, 18 Dec 2012 10:24:07 +0000 (10:24 +0000)]
Remove obsolete FIXMEs.

llvm-svn: 170425

11 years ago[Sanitizer] Expose StackTrace::GetPreviousInstructionPc() to get PC of call instructi...
Alexey Samsonov [Tue, 18 Dec 2012 09:57:34 +0000 (09:57 +0000)]
[Sanitizer] Expose StackTrace::GetPreviousInstructionPc() to get PC of call instruction from return address

llvm-svn: 170424

11 years agoubsan: Demangle class names, and be more informative when a reinterpret_cast
Richard Smith [Tue, 18 Dec 2012 09:30:21 +0000 (09:30 +0000)]
ubsan: Demangle class names, and be more informative when a reinterpret_cast
has got us to the wrong offset within an object.

llvm-svn: 170423

11 years agoreturn -1 when polly::getNumberOfIterations returns -1
Sebastian Pop [Tue, 18 Dec 2012 08:56:51 +0000 (08:56 +0000)]
return -1 when polly::getNumberOfIterations returns -1

llvm-svn: 170422

11 years agoisl: vector code generation based on ISL ast
Sebastian Pop [Tue, 18 Dec 2012 07:46:13 +0000 (07:46 +0000)]
isl: vector code generation based on ISL ast

Original patch by Tobias Grosser, slightly modified by Sebastian Pop.

llvm-svn: 170420

11 years agochange interface for isStride
Sebastian Pop [Tue, 18 Dec 2012 07:46:06 +0000 (07:46 +0000)]
change interface for isStride

isStride now takes a partial schedule as input.

Patch from Tobias Grosser <tobias@grosser.es>.

llvm-svn: 170419

11 years ago[asan] add some colors to asan output if printing to tty (following ubsan)
Kostya Serebryany [Tue, 18 Dec 2012 07:32:16 +0000 (07:32 +0000)]
[asan] add some colors to asan output if printing to tty (following ubsan)

llvm-svn: 170418

11 years agotsan: describe "file descriptor" location
Dmitry Vyukov [Tue, 18 Dec 2012 06:57:34 +0000 (06:57 +0000)]
tsan: describe "file descriptor" location

llvm-svn: 170417

11 years agoEnable the loop vectorizer.
Nadav Rotem [Tue, 18 Dec 2012 06:37:12 +0000 (06:37 +0000)]
Enable the loop vectorizer.

llvm-svn: 170416

11 years agoubsan: When diagnosing something wrong somewhere in memory, emit a note
Richard Smith [Tue, 18 Dec 2012 06:30:32 +0000 (06:30 +0000)]
ubsan: When diagnosing something wrong somewhere in memory, emit a note
pointing at the bad location and a snippet of nearby memory values. This is
strictly best-effort; reading these bytes to display the note could lead to a
seg fault, and that's explicitly OK.

llvm-svn: 170415

11 years agoRename the test so that we can add additional vectors-of-pointers tests
Nadav Rotem [Tue, 18 Dec 2012 05:50:54 +0000 (05:50 +0000)]
Rename the test so that we can add additional vectors-of-pointers tests
into the same file in the future.

llvm-svn: 170414

11 years agoDon't escape %s in printf usage message; it's not written by printf.
Richard Smith [Tue, 18 Dec 2012 05:49:49 +0000 (05:49 +0000)]
Don't escape %s in printf usage message; it's not written by printf.

llvm-svn: 170413

11 years agoSROA: Replace calls to getScalarSizeInBits to DataLayout's API because
Nadav Rotem [Tue, 18 Dec 2012 05:23:31 +0000 (05:23 +0000)]
SROA: Replace calls to getScalarSizeInBits to DataLayout's API because
getScalarSizeInBits could not handle vectors of pointers.

llvm-svn: 170412

11 years agotest/Misc/dev-fd-fs.c: Mark this as XFAIL:freebsd (since r169831).
NAKAMURA Takumi [Tue, 18 Dec 2012 05:14:30 +0000 (05:14 +0000)]
test/Misc/dev-fd-fs.c: Mark this as XFAIL:freebsd (since r169831).

I don't want to suppress this to be excluded with the feature "dev-fd-fs". This should work also on freebsd.

llvm-svn: 170411

11 years agollvm/test/MC/ELF/comp-dir.s: Appease MSYS Bash.
NAKAMURA Takumi [Tue, 18 Dec 2012 05:08:12 +0000 (05:08 +0000)]
llvm/test/MC/ELF/comp-dir.s: Appease MSYS Bash.

llvm-svn: 170410

11 years agoAdd a new qProcessInfo packet to debugserver.
Jason Molenda [Tue, 18 Dec 2012 04:39:43 +0000 (04:39 +0000)]
Add a new qProcessInfo packet to debugserver.
This can be used by lldb to ask for information
about the process debugserver is attached to/launched.
Particularly useful on a 64-bit x86 Mac system which
can run  32-bit or 64-bit user-land processes.

llvm-svn: 170409

11 years agoInline hasAtomicCopyHelperAPI.
Rafael Espindola [Tue, 18 Dec 2012 04:29:34 +0000 (04:29 +0000)]
Inline hasAtomicCopyHelperAPI.

llvm-svn: 170408

11 years agoubsan: if the frontend didn't provide us with a source location, try to work
Richard Smith [Tue, 18 Dec 2012 04:23:18 +0000 (04:23 +0000)]
ubsan: if the frontend didn't provide us with a source location, try to work
one out from the return address. Currently, we can only resolve this address to
a file and line number if we have an external symbolizer.

llvm-svn: 170407

11 years agoMerge storage classes even when contexts don't match.
Rafael Espindola [Tue, 18 Dec 2012 04:18:55 +0000 (04:18 +0000)]
Merge storage classes even when contexts don't match.

This fixes the storage class of extern decls that are merged with file level
statics. The patch also fixes the linkage computation so that they are
considered internal.

llvm-svn: 170406

11 years agoNow that the uninitialized variable has been fixed in llvm, add this test back,
Rafael Espindola [Tue, 18 Dec 2012 03:54:29 +0000 (03:54 +0000)]
Now that the uninitialized variable has been fixed in llvm, add this test back,
but remove unneeded options and fix the comment.

llvm-svn: 170405