platform/upstream/llvm.git
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

11 years agoInitialize NoRedZone and remove unused default values.
Rafael Espindola [Tue, 18 Dec 2012 03:35:05 +0000 (03:35 +0000)]
Initialize NoRedZone and remove unused default values.

llvm-svn: 170404

11 years agoFix typo (thanks to Jordan for spotting it!).
Richard Smith [Tue, 18 Dec 2012 03:04:38 +0000 (03:04 +0000)]
Fix typo (thanks to Jordan for spotting it!).

llvm-svn: 170403

11 years agoThe underlying type for an enum should be an integer type, not another enum.
Eli Friedman [Tue, 18 Dec 2012 02:37:32 +0000 (02:37 +0000)]
The underlying type for an enum should be an integer type, not another enum.
(This change only affects ObjC.)

<rdar://problem/12857117>.

llvm-svn: 170402

11 years agodocs: Nuke AnalyzerRegions.rst.
Sean Silva [Tue, 18 Dec 2012 02:15:05 +0000 (02:15 +0000)]
docs: Nuke AnalyzerRegions.rst.

As per Ted's advice. It can be brought back from version control if
needed.

This also fixes a Sphinx warning.

llvm-svn: 170401

11 years agoAdding events when watchpoints are set or changed.
Jim Ingham [Tue, 18 Dec 2012 02:03:49 +0000 (02:03 +0000)]
Adding events when watchpoints are set or changed.

<rdar://problem/11597849>

llvm-svn: 170400

11 years agoWhen warning about a missing prototype because a function declaration is missing...
Anders Carlsson [Tue, 18 Dec 2012 01:29:20 +0000 (01:29 +0000)]
When warning about a missing prototype because a function declaration is missing 'void', insert a fixit to add the void.

llvm-svn: 170399

11 years agoCleanup comment and formatting
Eli Bendersky [Tue, 18 Dec 2012 00:53:36 +0000 (00:53 +0000)]
Cleanup comment and formatting

llvm-svn: 170398

11 years agoMore conservative fix for <rdar://problem/12847524> (a crash printing diagnostic...
Eli Friedman [Tue, 18 Dec 2012 00:52:36 +0000 (00:52 +0000)]
More conservative fix for <rdar://problem/12847524> (a crash printing diagnostic ranges).
I'm not really happy with this fix, but I'm confident it's correct.

llvm-svn: 170397

11 years agoRemoved a possible use of unchecked NULL from
Sean Callanan [Tue, 18 Dec 2012 00:50:17 +0000 (00:50 +0000)]
Removed a possible use of unchecked NULL from
the AST result synthesizer's logging.

<rdar://problem/12889053>

llvm-svn: 170396

11 years agoRepair bundles that were broken by removing and reinserting the first
Jakob Stoklund Olesen [Tue, 18 Dec 2012 00:46:39 +0000 (00:46 +0000)]
Repair bundles that were broken by removing and reinserting the first
instruction.

This isn't strictly necessary at the moment because Thumb2SizeReduction
also copies all MI flags from the old instruction to the new. However, a
future patch will make that kind of direct flag tampering illegal.

llvm-svn: 170395

11 years agoFormatting.
Eric Christopher [Tue, 18 Dec 2012 00:42:26 +0000 (00:42 +0000)]
Formatting.

llvm-svn: 170394

11 years agoUse the correct return type (size_t) for these builtins.
Bill Wendling [Tue, 18 Dec 2012 00:37:10 +0000 (00:37 +0000)]
Use the correct return type (size_t) for these builtins.
<rdar://problem/12646344>

llvm-svn: 170393

11 years agoAdd an expected parameter for the size of the destination.
Bill Wendling [Tue, 18 Dec 2012 00:34:49 +0000 (00:34 +0000)]
Add an expected parameter for the size of the destination.
<rdar://problem/12622659>

llvm-svn: 170392

11 years agoAdd support for passing the main file name down to the assembler
Eric Christopher [Tue, 18 Dec 2012 00:31:10 +0000 (00:31 +0000)]
Add support for passing the main file name down to the assembler
for location information.

Part of PR14624

llvm-svn: 170391

11 years agoAdd support for passing -main-file-name all the way through to
Eric Christopher [Tue, 18 Dec 2012 00:31:01 +0000 (00:31 +0000)]
Add support for passing -main-file-name all the way through to
the assembler.

Part of PR14624

llvm-svn: 170390

11 years agoCleanup formatting and whitespace.
Eric Christopher [Tue, 18 Dec 2012 00:30:54 +0000 (00:30 +0000)]
Cleanup formatting and whitespace.

llvm-svn: 170389

11 years agoRein ubsan's vptr sanitizer back a bit. Per core issue 453, binding a reference
Richard Smith [Tue, 18 Dec 2012 00:23:12 +0000 (00:23 +0000)]
Rein ubsan's vptr sanitizer back a bit. Per core issue 453, binding a reference
to an object outside its lifetime does not have undefined behavior.

llvm-svn: 170388

11 years agoRein ubsan's vptr sanitizer back a bit. Per core issue 453, binding a reference
Richard Smith [Tue, 18 Dec 2012 00:22:45 +0000 (00:22 +0000)]
Rein ubsan's vptr sanitizer back a bit. Per core issue 453, binding a reference
to an object outside its lifetime does not have undefined behavior.

llvm-svn: 170387

11 years agoExtract a method, no functional change intended.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 00:13:11 +0000 (00:13 +0000)]
Extract a method, no functional change intended.

Sadly, this costs us a perfectly good opportunity to use 'goto'.

llvm-svn: 170385

11 years agoTighten up the erase/remove API for bundled instructions.
Jakob Stoklund Olesen [Mon, 17 Dec 2012 23:55:38 +0000 (23:55 +0000)]
Tighten up the erase/remove API for bundled instructions.

Most code is oblivious to bundles and uses the MBB::iterator which only
visits whole bundles. MBB::erase() operates on whole bundles at a time
as before.

MBB::remove() now refuses to remove bundled instructions. It is not safe
to remove all instructions in a bundle without deleting them since there
is no way of returning pointers to all the removed instructions.

MBB::remove_instr() and MBB::erase_instr() will now update bundle flags
correctly, lifting individual instructions out of bundles while leaving
the remaining bundle intact.

The MachineInstr convenience functions are updated so

  eraseFromParent() erases a whole bundle as before
  eraseFromBundle() erases a single instruction, leaving the rest of its bundle.
  removeFromParent() refuses to operate on bundled instructions, and
  removeFromBundle() lifts a single instruction out of its bundle.

These functions will no longer accidentally split or coalesce bundles -
bundle flags are updated to preserve the existing bundling, and explicit
bundleWith* / unbundleFrom* functions should be used to change the
instruction bundling.

This API update is still a work in progress. I am going to update APIs
first so they maintain bundle flags automatically when possible. Then
I'll add stricter verification of the bundle flags.

llvm-svn: 170384

11 years agoEmitDebugLabel should by default be the same as EmitLabel everywhere.
Reed Kotler [Mon, 17 Dec 2012 23:41:45 +0000 (23:41 +0000)]
EmitDebugLabel should by default be the same as EmitLabel everywhere.
It must be explicity set in MCPureStreamer because otherwise it will
inherit incorrectly from the parent.

llvm-svn: 170383

11 years agofix indentation
Eli Bendersky [Mon, 17 Dec 2012 22:50:56 +0000 (22:50 +0000)]
fix indentation

llvm-svn: 170381

11 years ago[arm fast-isel] Minor cleanup. No functional change intended.
Chad Rosier [Mon, 17 Dec 2012 22:35:29 +0000 (22:35 +0000)]
[arm fast-isel] Minor cleanup. No functional change intended.

llvm-svn: 170379

11 years agoFix isThisDeclarationADefinition for extern following tentative.
Rafael Espindola [Mon, 17 Dec 2012 22:23:47 +0000 (22:23 +0000)]
Fix isThisDeclarationADefinition for extern following tentative.

An extern declaration following a tentative definition should not itself be
considered a tentative definition.
Fixes pr14614.

llvm-svn: 170377

11 years agoFix some integer constant warnings by using a suffix
Nick Kledzik [Mon, 17 Dec 2012 22:11:17 +0000 (22:11 +0000)]
Fix some integer constant warnings by using a suffix

llvm-svn: 170376

11 years agoAdd a triple to this test -- it has to be an ELF platform...
Chandler Carruth [Mon, 17 Dec 2012 21:44:50 +0000 (21:44 +0000)]
Add a triple to this test -- it has to be an ELF platform...

llvm-svn: 170374

11 years agoFix PR14625 by teaching the driver to detect PWD for assembly files.
Chandler Carruth [Mon, 17 Dec 2012 21:40:04 +0000 (21:40 +0000)]
Fix PR14625 by teaching the driver to detect PWD for assembly files.

This also requires adding support to -cc1as for passing the detecting
PWD down through LLVM's debug info (which in turn required the LLVM
change in r170371).

The test case is weak (we only test the driver behavior) because there
is currently to infrastructure for running cc1as in the test suite. So
those four lines are untested (much like all other lines in that file),
but we have a test for the same pattern using llvm-mc in the LLVM
repository.

llvm-svn: 170373

11 years agoMention how to do a (Linux) release build on the build instructions page.
Daniel Malea [Mon, 17 Dec 2012 21:32:49 +0000 (21:32 +0000)]
Mention how to do a (Linux) release build on the build instructions page.

Also, a few minor fixes:
- paragraph formatting
- capitalize "Python" where appropriate

llvm-svn: 170372

11 years agoPrepare LLVM to fix PR14625, exposing a hook in MCContext to manage the
Chandler Carruth [Mon, 17 Dec 2012 21:32:42 +0000 (21:32 +0000)]
Prepare LLVM to fix PR14625, exposing a hook in MCContext to manage the
compilation directory.

This defaults to the current working directory, just as it always has,
but now an assembler can choose to override it with a custom directory.
I've taught llvm-mc about this option and added a test case.

llvm-svn: 170371

11 years ago<rdar://problem/12890948>
Han Ming Ong [Mon, 17 Dec 2012 20:53:19 +0000 (20:53 +0000)]
<rdar://problem/12890948>

Send thread name using hex encoding.

llvm-svn: 170370

11 years agore-enable test cases now that traits work with g++. Fix some g++ warnings
Nick Kledzik [Mon, 17 Dec 2012 20:43:53 +0000 (20:43 +0000)]
re-enable test cases now that traits work with g++.  Fix some g++ warnings

llvm-svn: 170369

11 years agoRemove trailing whitespace
Michael Ilseman [Mon, 17 Dec 2012 20:40:14 +0000 (20:40 +0000)]
Remove trailing whitespace

llvm-svn: 170368

11 years agoRemoved trailing whitespace
Michael Ilseman [Mon, 17 Dec 2012 20:37:55 +0000 (20:37 +0000)]
Removed trailing whitespace

llvm-svn: 170367

11 years ago[c-index-test] Fix warnings about unused results from chdir().
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:19:56 +0000 (20:19 +0000)]
[c-index-test] Fix warnings about unused results from chdir().
Patch from Edwin Vane!

llvm-svn: 170366

11 years agoJust use begin()/end() instead of "&Vector[0], &Vector[0]+Vector.size()".
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:10:50 +0000 (20:10 +0000)]
Just use begin()/end() instead of "&Vector[0], &Vector[0]+Vector.size()".

No functionality change.

llvm-svn: 170365

11 years agoDon't include the header outside the include guards, it defeats the purpose of the...
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:10:49 +0000 (20:10 +0000)]
Don't include the header outside the include guards, it defeats the purpose of the include guards.

llvm-svn: 170364

11 years ago[parser] Push a semi token for recovery only when it is actually missing.
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:10:43 +0000 (20:10 +0000)]
[parser] Push a semi token for recovery only when it is actually missing.

llvm-svn: 170363

11 years ago[analyzer] Tweak the NumFunctionsAnalyzed stat so that it's more useful.
Anna Zaks [Mon, 17 Dec 2012 20:08:54 +0000 (20:08 +0000)]
[analyzer] Tweak the NumFunctionsAnalyzed stat so that it's more useful.

llvm-svn: 170362

11 years ago[analyzer] Implement "do not inline large functions many times"
Anna Zaks [Mon, 17 Dec 2012 20:08:51 +0000 (20:08 +0000)]
[analyzer] Implement "do not inline large functions many times"
performance heuristic

After inlining a function with more than 13 basic blocks 32 times, we
are not going to inline it anymore. The idea is that inlining large
functions leads to drastic performance implications. Since the function
has already been inlined, we know that we've analyzed it in many
contexts.

The following metrics are used:
 - Large function is a function with more than 13 basic blocks (we
should switch to another metric, like cyclomatic complexity)
 - We consider that we've inlined a function many times if it's been
inlined 32 times. This number is configurable with -analyzer-config
max-times-inline-large=xx

This heuristic addresses a performance regression introduced with
inlining on one benchmark. The analyzer on this benchmark became 60
times slower with inlining turned on. The heuristic allows us to analyze
it in 24% of the time. The performance improvements on the other
benchmarks I've tested with are much lower - under 10%, which is
expected.

llvm-svn: 170361

11 years ago[arm fast-isel] Fast-isel only handles simple VTs, so make sure the necessary
Chad Rosier [Mon, 17 Dec 2012 19:59:43 +0000 (19:59 +0000)]
[arm fast-isel] Fast-isel only handles simple VTs, so make sure the necessary
checks are in place.  Some minor cleanup as well.

llvm-svn: 170360

11 years agoUse different trait techniques to be compatible with g++
Nick Kledzik [Mon, 17 Dec 2012 19:02:05 +0000 (19:02 +0000)]
Use different trait techniques to be compatible with g++

llvm-svn: 170355

11 years agoReapply r170344, this time without forgetting to commit the header changes.
David Chisnall [Mon, 17 Dec 2012 18:54:24 +0000 (18:54 +0000)]
Reapply r170344, this time without forgetting to commit the header changes.

llvm-svn: 170354

11 years agoFix another SROA crasher, PR14601.
Chandler Carruth [Mon, 17 Dec 2012 18:48:07 +0000 (18:48 +0000)]
Fix another SROA crasher, PR14601.

This was a silly oversight, we weren't pruning allocas which were used
by variable-length memory intrinsics from the set that could be widened
and promoted as integers. Fix that.

llvm-svn: 170353

11 years agoRevert "Added support for new property helpers (GNUstep runtime)."
Benjamin Kramer [Mon, 17 Dec 2012 18:02:43 +0000 (18:02 +0000)]
Revert "Added support for new property helpers (GNUstep runtime)."

This reverts commit r170344. Doesn't even compile.

llvm-svn: 170351

11 years agoQuery section for whether it should be executable.
Tim Northover [Mon, 17 Dec 2012 17:59:35 +0000 (17:59 +0000)]
Query section for whether it should be executable.

llvm-svn: 170350

11 years agoTeach MachO which sections contain code
Tim Northover [Mon, 17 Dec 2012 17:59:32 +0000 (17:59 +0000)]
Teach MachO which sections contain code

llvm-svn: 170349

11 years agoInitialize m_done to false in Driver constructor to avoid premature exit bug (spotted...
Daniel Malea [Mon, 17 Dec 2012 17:40:07 +0000 (17:40 +0000)]
Initialize m_done to false in Driver constructor to avoid premature exit bug (spotted on Linux)

Patch by Chia-Hung Duan!

llvm-svn: 170348

11 years ago[msan] Fix lint warning.
Evgeniy Stepanov [Mon, 17 Dec 2012 16:30:05 +0000 (16:30 +0000)]
[msan] Fix lint warning.

llvm-svn: 170347