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

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

llvm-svn: 169068

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

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

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

llvm-svn: 169067

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

llvm-svn: 169066

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

llvm-svn: 169065

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

llvm-svn: 169064

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

<rdar://problem/12657742>

llvm-svn: 169063

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

llvm-svn: 169062

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

WIP.

llvm-svn: 169061

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

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

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

llvm-svn: 169060

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

llvm-svn: 169059

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

llvm-svn: 169058

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

llvm-svn: 169057

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

llvm-svn: 169056

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

llvm-svn: 169055

11 years agoDon't warn if the input size is less than the register size. Also don't warn if
Bill Wendling [Fri, 30 Nov 2012 23:18:12 +0000 (23:18 +0000)]
Don't warn if the input size is less than the register size. Also don't warn if
the output size is greater than the register size. No truncation occurs with
those. Reword warning to make it clearer what's the problem is.

llvm-svn: 169054

11 years agoRemoved redundancy in wording
Michael Ilseman [Fri, 30 Nov 2012 23:14:52 +0000 (23:14 +0000)]
Removed redundancy in wording

llvm-svn: 169053

11 years agoClean up the documentation to have a common description area for fast-math flags.
Michael Ilseman [Fri, 30 Nov 2012 23:12:42 +0000 (23:12 +0000)]
Clean up the documentation to have a common description area for fast-math flags.

llvm-svn: 169052

11 years agoMake -Wtautological-constant-out-of-range-compare behave sanely for enums with a...
Eli Friedman [Fri, 30 Nov 2012 23:09:29 +0000 (23:09 +0000)]
Make -Wtautological-constant-out-of-range-compare behave sanely for enums with a signed fixed type.
<rdar://problem/12780159>.

llvm-svn: 169051

11 years agoBe more clear on what parts of code I own.
Bill Wendling [Fri, 30 Nov 2012 23:00:25 +0000 (23:00 +0000)]
Be more clear on what parts of code I own.

llvm-svn: 169050

11 years agoreversed the logic of the log2 detection routine to reduce the number of nested ifs
Pedro Artigas [Fri, 30 Nov 2012 22:47:15 +0000 (22:47 +0000)]
reversed the logic of the log2 detection routine to reduce the number of nested ifs

llvm-svn: 169049

11 years agominor cleanups
Nadav Rotem [Fri, 30 Nov 2012 22:37:11 +0000 (22:37 +0000)]
minor cleanups

llvm-svn: 169048

11 years agoFix a bug in APFloat.cpp: declare APFloat after fltSemantics it
Alexey Samsonov [Fri, 30 Nov 2012 22:27:54 +0000 (22:27 +0000)]
Fix a bug in APFloat.cpp: declare APFloat after fltSemantics it
uses. APFloat::convert() takes the pointer to the fltSemantics
variable, which is later accessed it in ~APFloat() desctructor.
That is, semantics must still be alive at the moment we delete
APFloat.

Found by experimental AddressSanitizer use-after-scope checker.

llvm-svn: 169047

11 years agoAdd me as LTO code owner.
Bill Wendling [Fri, 30 Nov 2012 22:15:08 +0000 (22:15 +0000)]
Add me as LTO code owner.

llvm-svn: 169046

11 years agoRename ModuleBuildPath -> ModuleBuildStack. Thanks, Dmitri!
Douglas Gregor [Fri, 30 Nov 2012 22:11:57 +0000 (22:11 +0000)]
Rename ModuleBuildPath -> ModuleBuildStack. Thanks, Dmitri!

llvm-svn: 169045

11 years agoReplace r168930 with a more reasonable patch.
Bill Wendling [Fri, 30 Nov 2012 22:08:55 +0000 (22:08 +0000)]
Replace r168930 with a more reasonable patch.

The original patch removed a bunch of code that the SjLjEHPrepare pass placed
into the entry block if all of the landing pads were removed during the
CodeGenPrepare class. The more natural way of doing things is to run the CGP
*before* we run the SjLjEHPrepare pass.

Make it so!

llvm-svn: 169044

11 years agoAddresses many style issues with prior checkin (r169025)
Pedro Artigas [Fri, 30 Nov 2012 22:07:05 +0000 (22:07 +0000)]
Addresses many style issues with prior checkin (r169025)

llvm-svn: 169043

11 years agoWhen we're emitting a diagnostic with a source location in an imported
Douglas Gregor [Fri, 30 Nov 2012 21:58:49 +0000 (21:58 +0000)]
When we're emitting a diagnostic with a source location in an imported
module, provide a module import stack similar to what we would get for
an include stack, e.g.,

In module 'DependsOnModule' imported from build-fail-notes.m:4:
In module 'Module' imported from DependsOnModule.framework/Headers/DependsOnModule.h:1:
Inputs/Module.framework/Headers/Module.h:15:12: note: previous definition is here
@interface Module

<rdar://problem/12696425>

llvm-svn: 169042

11 years agoFixing a precedence issue with my previous commit.
Aaron Ballman [Fri, 30 Nov 2012 21:44:01 +0000 (21:44 +0000)]
Fixing a precedence issue with my previous commit.

llvm-svn: 169041

11 years agoAdd a -time-compilations=<N> option to llc.
Jakob Stoklund Olesen [Fri, 30 Nov 2012 21:42:47 +0000 (21:42 +0000)]
Add a -time-compilations=<N> option to llc.

This causes llc to repeat the module compilation N times, making it
possible to get more accurate information from -time-passes when
compiling small modules.

llvm-svn: 169040

11 years agoAggregate pass execution time report by pass ID instead of pass instance.
Jakob Stoklund Olesen [Fri, 30 Nov 2012 21:42:45 +0000 (21:42 +0000)]
Aggregate pass execution time report by pass ID instead of pass instance.

This avoids unidentified duplicates in the pass execution time report
when a pass runs more than once in the pass manager pipeline.

llvm-svn: 169039

11 years agolit: Add a simple test suite for checking test runner parallelism.
Daniel Dunbar [Fri, 30 Nov 2012 21:34:04 +0000 (21:34 +0000)]
lit: Add a simple test suite for checking test runner parallelism.

llvm-svn: 169038

11 years agoFixing an MSVC warning about an unsafe mixture of Boolean and unsigned types in a...
Aaron Ballman [Fri, 30 Nov 2012 21:15:20 +0000 (21:15 +0000)]
Fixing an MSVC warning about an unsafe mixture of Boolean and unsigned types in a logical operator.

llvm-svn: 169037

11 years ago[CMake] Add support for selecting which c++ abi library to use.
Michael J. Spencer [Fri, 30 Nov 2012 21:02:29 +0000 (21:02 +0000)]
[CMake] Add support for selecting which c++ abi library to use.

llvm-svn: 169036

11 years agoSave and restore terminal state when lldb is suspended with SIGTSTP and resumed with...
Jim Ingham [Fri, 30 Nov 2012 20:23:19 +0000 (20:23 +0000)]
Save and restore terminal state when lldb is suspended with SIGTSTP and resumed with SIGCONT.
Readline & gdb have a bunch of code to handle older UNIX'es with other job control mechanisms.
I didn't try to replicate that.

llvm-svn: 169032

11 years ago<rdar://problem/12676084> Dump the traceback when a Python error occurs in "command...
Enrico Granata [Fri, 30 Nov 2012 20:15:16 +0000 (20:15 +0000)]
<rdar://problem/12676084> Dump the traceback when a Python error occurs in "command script import" and the exception is not an ImportError

llvm-svn: 169031

11 years agoComments: no need to escape any characters in \code ... \endcode.
Dmitri Gribenko [Fri, 30 Nov 2012 20:04:39 +0000 (20:04 +0000)]
Comments: no need to escape any characters in \code ... \endcode.

llvm-svn: 169030

11 years agotsan: fix int overflow and several instances where tid is used with ignore
Dmitry Vyukov [Fri, 30 Nov 2012 20:02:11 +0000 (20:02 +0000)]
tsan: fix int overflow and several instances where tid is used with ignore

llvm-svn: 169029

11 years agoSupport for #pragma region/endregion for MSVC compatibility. Patch thanks to pravic!
Aaron Ballman [Fri, 30 Nov 2012 19:52:30 +0000 (19:52 +0000)]
Support for #pragma region/endregion for MSVC compatibility.  Patch thanks to pravic!

llvm-svn: 169028

11 years agoActually keep track of the source locations at which particular module
Douglas Gregor [Fri, 30 Nov 2012 19:28:05 +0000 (19:28 +0000)]
Actually keep track of the source locations at which particular module
files are loaded.

llvm-svn: 169027

11 years agotest/CodeGen/PowerPC/vec_mul.ll: Add a triple. Thanks, Hal.
Chad Rosier [Fri, 30 Nov 2012 19:15:10 +0000 (19:15 +0000)]
test/CodeGen/PowerPC/vec_mul.ll: Add a triple. Thanks, Hal.

llvm-svn: 169026

11 years agoAdd fast math inst combine X*log2(Y*0.5)-->X*log2(Y)-X
Pedro Artigas [Fri, 30 Nov 2012 19:09:41 +0000 (19:09 +0000)]
Add fast math inst combine X*log2(Y*0.5)-->X*log2(Y)-X

reviewed by Michael Ilseman <milseman@apple.com>

llvm-svn: 169025

11 years agoCodegen failure for vmull with small vectors
Sebastian Pop [Fri, 30 Nov 2012 19:08:04 +0000 (19:08 +0000)]
Codegen failure for vmull with small vectors

Codegen was failing with an assertion because of unexpected vector
operands when legalizing the selection DAG for a MUL instruction.

The asserting code was legalizing multiplies for vectors of size 128
bits. It uses a custom lowering to try and detect cases where it can
use a VMULL instruction instead of a VMOVL + VMUL.  The code was
looking for input operands to the MUL that had been sign or zero
extended. If it found the extended operands it would drop the
sign/zero extension and use the original vector size as input to a
VMULL instruction.

The code assumed that the original input vector was 64 bits so that
after dropping the extension it would fit directly into a D register
and could be used as an operand of a VMULL instruction. The input
code that trigger the failure used a vector of <4 x i8> that was
sign extended to <4 x i32>. It was not safe to drop the sign
extension in this case because the original vector is only 32 bits
wide. The fix is to insert a sign extension for the vector to reach
the required 64 bit size. In this particular example, the vector would
need to be sign extented to a <4 x i16>.

llvm-svn: 169024

11 years agoAdded new options to "target create" and "target modules add".
Greg Clayton [Fri, 30 Nov 2012 19:05:35 +0000 (19:05 +0000)]
Added new options to "target create" and "target modules add".

For "target create" you can now specify "--no-dependents" to not track down and add all dependent shared libraries. This can be handy when doing manual symbolication. Also added the "--symfile" or "-s" for short so you can specify a module and a stand alone debug info file:

(lldb) target create --symfile /tmp/a.dSYM /usr/bin/a

Added the "--symfile" option to the "target modules add" for the same reason. These all help with manualy symbolication and expose functionality that was previously only available through the public API layer.

llvm-svn: 169023

11 years ago__list::ends_with_template was giving the wrong answer for empty lists. And __parse_...
Howard Hinnant [Fri, 30 Nov 2012 18:43:50 +0000 (18:43 +0000)]
__list::ends_with_template was giving the wrong answer for empty lists.  And __parse_unnamed_type_name wasn't properly handling the list of paramters and was not safe against incorrectly mangled lambdas (running past last).

llvm-svn: 169022

11 years agoWhen an error occurs while building a module on demand, provide "While
Douglas Gregor [Fri, 30 Nov 2012 18:38:50 +0000 (18:38 +0000)]
When an error occurs while building a module on demand, provide "While
building module 'Foo' imported from..." notes (the same we we provide
"In file included from..." notes) in the diagnostic, so that we know
how this module got included in the first place. This is part of
<rdar://problem/12696425>.

llvm-svn: 169021

11 years agotest/CodeGen/PowerPC/vec_mul.ll: Fix register operands.
Chad Rosier [Fri, 30 Nov 2012 18:29:01 +0000 (18:29 +0000)]
test/CodeGen/PowerPC/vec_mul.ll: Fix register operands.

llvm-svn: 169020

11 years agotsan: suppress weird race reports when JVM is embed into the process
Dmitry Vyukov [Fri, 30 Nov 2012 17:45:53 +0000 (17:45 +0000)]
tsan: suppress weird race reports when JVM is embed into the process

llvm-svn: 169019

11 years agoUse multiclass for the load instructions with MEMri operand.
Jyotsna Verma [Fri, 30 Nov 2012 17:31:52 +0000 (17:31 +0000)]
Use multiclass for the load instructions with MEMri operand.

llvm-svn: 169018

11 years agotsan: add __libc_memalign interceptor (used by dynamic loader to allocate tls for...
Dmitry Vyukov [Fri, 30 Nov 2012 17:27:58 +0000 (17:27 +0000)]
tsan: add __libc_memalign interceptor (used by dynamic loader to allocate tls for dlopen'ed modules)

llvm-svn: 169017

11 years agoRemove the use of LPPassManager. We can remove LPM because we dont need to run any...
Nadav Rotem [Fri, 30 Nov 2012 17:27:53 +0000 (17:27 +0000)]
Remove the use of LPPassManager. We can remove LPM because we dont need to run any additional loop passes on the new vector loop.

llvm-svn: 169016

11 years agotsan: add sanity checks into memory allocator
Dmitry Vyukov [Fri, 30 Nov 2012 17:26:50 +0000 (17:26 +0000)]
tsan: add sanity checks into memory allocator

llvm-svn: 169015

11 years agoClean up whitespace and add comments
Eli Bendersky [Fri, 30 Nov 2012 14:22:14 +0000 (14:22 +0000)]
Clean up whitespace and add comments

llvm-svn: 169002

11 years agoMake FileCheck return 2 in case of an error as documented,
Eli Bendersky [Fri, 30 Nov 2012 13:51:33 +0000 (13:51 +0000)]
Make FileCheck return 2 in case of an error as documented,
instead of 1 or true (?!)

llvm-svn: 169001

11 years agoAllow matchers to access the ASTContext.
Manuel Klimek [Fri, 30 Nov 2012 13:45:19 +0000 (13:45 +0000)]
Allow matchers to access the ASTContext.

Patch by Edwin Vane.

llvm-svn: 169000

11 years agotest/CodeGen/PowerPC: Add explicit -march=ppc32.
NAKAMURA Takumi [Fri, 30 Nov 2012 13:28:31 +0000 (13:28 +0000)]
test/CodeGen/PowerPC: Add explicit -march=ppc32.

FIXME: Please add another RUN line if you would like to check also on ppc64.
llvm-svn: 168999

11 years agoThis patch fixes the Altivec addend construction for the fused multiply-add
Adhemerval Zanella [Fri, 30 Nov 2012 13:05:44 +0000 (13:05 +0000)]
This patch fixes the Altivec addend construction for the fused multiply-add
instruction (vmaddfp) to conform with IEEE to ensure the sign of a zero
result when resulting product is -0.0.

The -0.0 vector addend to vmaddfp is generated by a creating a vector
with full bits sets and then shifting each elements by 31-bits to the
left, resulting in a vector of 0x80000000 (or -0.0 as float).

The 'buildvec_canonicalize.ll' was adjusted to reflect this change and
the 'vec_mul.ll' was complemented with the float vector multiplication
test.

llvm-svn: 168998

11 years ago[msan] Tests for vector manipulation instructions.
Evgeniy Stepanov [Fri, 30 Nov 2012 12:12:20 +0000 (12:12 +0000)]
[msan] Tests for vector manipulation instructions.

llvm-svn: 168997

11 years agoSwitch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES.
Chandler Carruth [Fri, 30 Nov 2012 11:45:22 +0000 (11:45 +0000)]
Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES.

Rationale:
1) This was the name in the comment block. ;]
2) It matches Clang's __has_feature naming convention.
3) It matches other compiler-feature-test conventions.

Sorry for the noise. =]

I've also switch the comment block to use a \brief tag and not duplicate
the name.

llvm-svn: 168996

11 years ago[asan] simplify the code around doesNotReturn call. It now magically works.
Kostya Serebryany [Fri, 30 Nov 2012 11:08:59 +0000 (11:08 +0000)]
[asan] simplify the code around doesNotReturn call. It now magically works.

llvm-svn: 168995

11 years agoUpdate to reflect the change of macro name in r168993.
Chandler Carruth [Fri, 30 Nov 2012 11:04:44 +0000 (11:04 +0000)]
Update to reflect the change of macro name in r168993.

llvm-svn: 168994

11 years agoSeparate out the tests for whether the compiler suports R-value
Chandler Carruth [Fri, 30 Nov 2012 11:04:18 +0000 (11:04 +0000)]
Separate out the tests for whether the compiler suports R-value
references from whether it supports an R-value reference *this. No
version of GCC today supports the latter, which breaks GCC C++11
compiles of LLVM and Clang now.

Also add doxygen comments clarifying what's going on here, and update
the usage in Optional. I'll update the usages in Clang next.

llvm-svn: 168993

11 years ago[asan] make asan_test.cc more gcc-friendly
Kostya Serebryany [Fri, 30 Nov 2012 10:41:42 +0000 (10:41 +0000)]
[asan] make asan_test.cc more gcc-friendly

llvm-svn: 168992

11 years agoMore strict error checking in parseSpecifier + simplified code.
Patrik Hagglund [Fri, 30 Nov 2012 10:06:59 +0000 (10:06 +0000)]
More strict error checking in parseSpecifier + simplified code.

For example, don't allow empty strings to be passed to getInt.

Move asserts inside parseSpecifier. (One day we may want to pass parse
error messages to the user - from LLParser - instead of using asserts,
but keep the code simple until then. There have been an attempt to do
this. See r142288, which got reverted, and r142605.)

llvm-svn: 168991

11 years ago[asan] simplify break_optimization in tests (Jakub Jelinek)
Kostya Serebryany [Fri, 30 Nov 2012 09:52:44 +0000 (09:52 +0000)]
[asan] simplify break_optimization in tests (Jakub Jelinek)

llvm-svn: 168990

11 years agoFix non-determinism introduced in r168970 and pointed out by Duncan.
Chandler Carruth [Fri, 30 Nov 2012 09:34:29 +0000 (09:34 +0000)]
Fix non-determinism introduced in r168970 and pointed out by Duncan.

We're iterating over a non-deterministically ordered container looking
for two saturating flags. To do this correctly, we have to saturate
both, and only stop looping if both saturate to their final value.
Otherwise, which flag we see first changes the result.

This is also a micro-optimization of the previous version as now we
don't go into the (possibly expensive) test logic once the first
violation of either constraint is detected.

llvm-svn: 168989

11 years agoRearrange the comments, control flow, and variable names; no
Chandler Carruth [Fri, 30 Nov 2012 09:26:25 +0000 (09:26 +0000)]
Rearrange the comments, control flow, and variable names; no
functionality changed.

Evan's commit r168970 moved the code that the primary comment in this
function referred to to the other end of the function without moving the
comment, and there has been a steady creep of "boolean" logic in it that
is simpler if handled via early exit. That way each special case can
have its own comments. I've also made the variable name a bit more
explanatory than "AllFit". This is in preparation to fix the
non-deterministic output of this function.

llvm-svn: 168988

11 years agotsan: intercept mlock() because of the kernel bug
Dmitry Vyukov [Fri, 30 Nov 2012 06:50:15 +0000 (06:50 +0000)]
tsan: intercept mlock() because of the kernel bug

llvm-svn: 168987

11 years agoAdd the rest of the experimental fission sections to MC.
Eric Christopher [Fri, 30 Nov 2012 06:47:06 +0000 (06:47 +0000)]
Add the rest of the experimental fission sections to MC.

llvm-svn: 168986

11 years agotsan: fix bug that leads to spurious use-after-free reports
Dmitry Vyukov [Fri, 30 Nov 2012 06:39:01 +0000 (06:39 +0000)]
tsan: fix bug that leads to spurious use-after-free reports

llvm-svn: 168985

11 years agoFix the computation of highlight ranges so we produce something sane when
Eli Friedman [Fri, 30 Nov 2012 06:19:40 +0000 (06:19 +0000)]
Fix the computation of highlight ranges so we produce something sane when
the beginning and end of the range are in different macro arguments.
PR14399.

llvm-svn: 168984

11 years agoUse multiclass for the store instructions with MEMri operand.
Jyotsna Verma [Fri, 30 Nov 2012 06:10:22 +0000 (06:10 +0000)]
Use multiclass for the store instructions with MEMri operand.

llvm-svn: 168983

11 years agoRefactor to reduce duplication in handling of special member functions. No functional...
Richard Smith [Fri, 30 Nov 2012 05:11:39 +0000 (05:11 +0000)]
Refactor to reduce duplication in handling of special member functions. No functionality change.

llvm-svn: 168977

11 years agoUse multiclass for the load instructions with 'base + register offset'
Jyotsna Verma [Fri, 30 Nov 2012 04:19:09 +0000 (04:19 +0000)]
Use multiclass for the load instructions with 'base + register offset'
addressing mode.

llvm-svn: 168976

11 years agoMove library call simplification statistic to instcombine
Meador Inge [Fri, 30 Nov 2012 04:05:06 +0000 (04:05 +0000)]
Move library call simplification statistic to instcombine

The simplify-libcalls pass maintained a statistic to count the number
of library calls that have been simplified.  Now that library call
simplification is being carried out in instcombine the statistic should
be moved to there.

llvm-svn: 168975

11 years agoMove the InstVisitor utility into VMCore where it belongs. It heavily
Chandler Carruth [Fri, 30 Nov 2012 03:08:41 +0000 (03:08 +0000)]
Move the InstVisitor utility into VMCore where it belongs. It heavily
depends on the IR infrastructure, there is no sense in it being off in
Support land.

This is in preparation to start working to expand InstVisitor into more
special-purpose visitors that are still generic and can be re-used
across different passes. The expansion will go into the Analylis tree
though as nothing in VMCore needs it.

llvm-svn: 168972

11 years agoFix logic to determine whether to turn a switch into a lookup table. When
Evan Cheng [Fri, 30 Nov 2012 02:02:42 +0000 (02:02 +0000)]
Fix logic to determine whether to turn a switch into a lookup table. When
the tables cannot fit in registers (i.e. bitmap), do not emit the table
if it's using an illegal type.

rdar://12779436

llvm-svn: 168970

11 years agoAdd a test case for the new cortex-a5 switch
Quentin Colombet [Fri, 30 Nov 2012 01:34:36 +0000 (01:34 +0000)]
Add a test case for the new cortex-a5 switch

llvm-svn: 168968

11 years agoUse the new LLVM_LVALUE_FUNCTION to ban two getAs() calls on rvalues.
Jordan Rose [Fri, 30 Nov 2012 01:15:32 +0000 (01:15 +0000)]
Use the new LLVM_LVALUE_FUNCTION to ban two getAs() calls on rvalues.

If 'x' is a temporary, x.getAs<Foo>() may not be safe if the result is
supposed to persist (if its address is stored somewhere). Since getAs()
can return a null value, the result is almost always stored into a
variable, which of course is not safe when the original value dies.

This has caused several bugs with GCC's "Temporaries May Vanish Sooner Than
You Expect" optimization; in C++11 builds, at least, we'll be able to catch
these problems now.

I would suggest applying these to other getAs() and get*As() methods
(castAs is "better" because sometimes the result is used directly, which
means the temporary will still be live), but these two have both caused
trouble in the analyzer in the past.

llvm-svn: 168967

11 years agoRemove unneeded preservation and restore of ValueMap and ClastVars in GPGPU code
Tobias Grosser [Fri, 30 Nov 2012 01:05:05 +0000 (01:05 +0000)]
Remove unneeded preservation and restore of ValueMap and ClastVars in GPGPU code
generation.

We don't use the exact same way to build loop body for GPGPU codegen as openmp
codegen and other transformations do currently, in which cases 'createLoop'
function is called recursively. GPGPU codegen may fail due to improper restore
of ValueMap and ClastVars .

Contributed by:  Yabin Hu <yabin.hwu@gmail.com>

llvm-svn: 168966

11 years agoModified dump() to provide a little
Preston Briggs [Fri, 30 Nov 2012 00:44:47 +0000 (00:44 +0000)]
Modified dump() to provide a little
more information for dependences between
instructions that don't share a common loop.

Updated the test results appropriately.

llvm-svn: 168965

11 years agoAdd an additional input argument according to chanages of function polly::createLoop.
Tobias Grosser [Fri, 30 Nov 2012 00:39:49 +0000 (00:39 +0000)]
Add an additional input argument according to chanages of function polly::createLoop.

Contributed-by: Yabin Hu <yabin.hwu@gmail.com>
llvm-svn: 168964

11 years agoAdd a new C++11 compatibility macro, LLVM_LVALUE_FUNCTION.
Jordan Rose [Fri, 30 Nov 2012 00:38:53 +0000 (00:38 +0000)]
Add a new C++11 compatibility macro, LLVM_LVALUE_FUNCTION.

This expands to '&', and is intended to be used when an /optional/ rvalue
override is available.

Before:
  void foo() const { ... }

After:
  void foo() const LLVM_LVALUE_FUNCTION { ... }
  void foo() && { ... }

This is used to allow moving the contents of an Optional.

llvm-svn: 168963

11 years agoFix unit tests for ModuleLoader change in r168961.
Douglas Gregor [Fri, 30 Nov 2012 00:01:57 +0000 (00:01 +0000)]
Fix unit tests for ModuleLoader change in r168961.

llvm-svn: 168962

11 years agoKeep track of modules that have failed to build. If we encounter an
Douglas Gregor [Thu, 29 Nov 2012 23:55:25 +0000 (23:55 +0000)]
Keep track of modules that have failed to build. If we encounter an
import of that module elsewhere, don't try to build the module again:
it won't work, and the experience is quite dreadful. We track this
information somewhat globally, shared among all of the related
CompilerInvocations used to build modules on-the-fly, so that a
particular Clang instance will only try to build a given module once.

Fixes <rdar://problem/12552849>.

llvm-svn: 168961

11 years agoFixed the arm disassembly of invalid BFI instructions to not build a bad MCInst
Kevin Enderby [Thu, 29 Nov 2012 23:47:11 +0000 (23:47 +0000)]
Fixed the arm disassembly of invalid BFI instructions to not build a bad MCInst
which would then cause an assert when printed.  rdar://11437956

llvm-svn: 168960

11 years agoFix a small calling-convention bug for x86-32. PR14453.
Eli Friedman [Thu, 29 Nov 2012 23:21:04 +0000 (23:21 +0000)]
Fix a small calling-convention bug for x86-32.  PR14453.

llvm-svn: 168959

11 years agoAdd ARM cortex-a5 subtarget
Quentin Colombet [Thu, 29 Nov 2012 23:15:27 +0000 (23:15 +0000)]
Add ARM cortex-a5 subtarget

llvm-svn: 168958

11 years agoRemove out-of-date comment.
Richard Smith [Thu, 29 Nov 2012 23:09:57 +0000 (23:09 +0000)]
Remove out-of-date comment.

llvm-svn: 168957

11 years agoRevert commit revision r168953, to change the commit message, which was empty
Quentin Colombet [Thu, 29 Nov 2012 23:07:08 +0000 (23:07 +0000)]
Revert commit revision r168953, to change the commit message, which was empty

llvm-svn: 168956

11 years agoubsan: Disable __int128 tests if the host Clang does not support it. These
Richard Smith [Thu, 29 Nov 2012 23:03:58 +0000 (23:03 +0000)]
ubsan: Disable __int128 tests if the host Clang does not support it. These
tests will still fail if compiler-rt was built with a compiler without __int128
support, but the host compiler has __int128 support.

llvm-svn: 168955

11 years ago(no commit message)
Quentin Colombet [Thu, 29 Nov 2012 22:58:40 +0000 (22:58 +0000)]
(no commit message)

llvm-svn: 168953

11 years agoMore comment.
Eric Christopher [Thu, 29 Nov 2012 22:56:13 +0000 (22:56 +0000)]
More comment.

llvm-svn: 168952

11 years ago[ASan] use brand new -fsanitize= values for init-order/use-after-return ASan output...
Alexey Samsonov [Thu, 29 Nov 2012 22:56:01 +0000 (22:56 +0000)]
[ASan] use brand new -fsanitize= values for init-order/use-after-return ASan output tests

llvm-svn: 168951

11 years agoThis patch exposes to Clang users three more sanitizers are experimental features...
Alexey Samsonov [Thu, 29 Nov 2012 22:36:21 +0000 (22:36 +0000)]
This patch exposes to Clang users three more sanitizers are experimental features of ASan:
1) init-order sanitizer: initialization-order checker.
Status: usable, but may produce false positives w/o proper blacklisting.
2) use-after-return sanitizer
Status: implemented, but heavily understed.
Should be optional, as it significanlty slows program down.
3) use-after-scope sanitizer
Status: in progress.

llvm-svn: 168950

11 years ago<rdar://problem/12687087>
Greg Clayton [Thu, 29 Nov 2012 22:16:27 +0000 (22:16 +0000)]
<rdar://problem/12687087>

Emit an error when using "target modules add PATH" where PATH points to a debug info only (dSYM) file.

Also added a "--uuid" option for "target modules add --uuid UUID" to locate and load a module by UUID if the host supports it.

llvm-svn: 168949

11 years ago<rdar://problem/12780259>
Han Ming Ong [Thu, 29 Nov 2012 22:14:45 +0000 (22:14 +0000)]
<rdar://problem/12780259>

Prevent async and sync calls to get profile data from stomping on each other.
At the same time, don't use '$' as end delimiter per chunk of profile data.

llvm-svn: 168948

11 years agoUpdate comment for malloc being a library call now, rather than an instruction.
Dan Gohman [Thu, 29 Nov 2012 21:58:47 +0000 (21:58 +0000)]
Update comment for malloc being a library call now, rather than an instruction.

llvm-svn: 168946

11 years agoResolve printf formatting warnings on Linux:
Daniel Malea [Thu, 29 Nov 2012 21:49:15 +0000 (21:49 +0000)]
Resolve printf formatting warnings on Linux:
- use macros from inttypes.h for format strings instead of OS-specific types

Patch from Matt Kopec!

llvm-svn: 168945

11 years agocopyFastMathFlags utility and test case
Michael Ilseman [Thu, 29 Nov 2012 21:25:12 +0000 (21:25 +0000)]
copyFastMathFlags utility and test case

llvm-svn: 168943

11 years agoAdd a FileCheck test that makes sure two different CHECKs won't match the
Eli Bendersky [Thu, 29 Nov 2012 21:24:44 +0000 (21:24 +0000)]
Add a FileCheck test that makes sure two different CHECKs won't match the
same string

llvm-svn: 168942