platform/upstream/llvm.git
9 years agoPass output stream to AsLexInput instead of the whole tool_output_file.
Craig Topper [Fri, 12 Dec 2014 07:52:19 +0000 (07:52 +0000)]
Pass output stream to AsLexInput instead of the whole tool_output_file.

llvm-svn: 224109

9 years agoUse unique_ptr to remove an explicit delete. Change return type to pass the unique_pt...
Craig Topper [Fri, 12 Dec 2014 07:52:16 +0000 (07:52 +0000)]
Use unique_ptr to remove an explicit delete. Change return type to pass the unique_ptr to caller.

llvm-svn: 224108

9 years agoUse make_unique instead of reset() and 'new'
Craig Topper [Fri, 12 Dec 2014 07:52:14 +0000 (07:52 +0000)]
Use make_unique instead of reset() and 'new'

llvm-svn: 224107

9 years agoUse range-based for loop.
Craig Topper [Fri, 12 Dec 2014 07:52:11 +0000 (07:52 +0000)]
Use range-based for loop.

llvm-svn: 224106

9 years agoRemove unnecessary calls to unique_ptr::get.
Craig Topper [Fri, 12 Dec 2014 07:52:09 +0000 (07:52 +0000)]
Remove unnecessary calls to unique_ptr::get.

llvm-svn: 224105

9 years agoRemove an unnecessary reference variable that pointed to a unique_ptr variable. Just...
Craig Topper [Fri, 12 Dec 2014 07:52:06 +0000 (07:52 +0000)]
Remove an unnecessary reference variable that pointed to a unique_ptr variable. Just use the unique_ptr variable directly.

llvm-svn: 224104

9 years agoUse unique_ptr operator= instead of constructor to make it explicit that there's...
Craig Topper [Fri, 12 Dec 2014 07:52:00 +0000 (07:52 +0000)]
Use unique_ptr operator= instead of constructor to make it explicit that there's no conversion occurring.

llvm-svn: 224103

9 years agoSeparate file parsing from File's constructors.
Rui Ueyama [Fri, 12 Dec 2014 07:31:09 +0000 (07:31 +0000)]
Separate file parsing from File's constructors.

This is a second patch for InputGraph cleanup.

Sorry about the size of the patch, but what I did in this
patch is basically moving code from constructor to a new
method, parse(), so the amount of new code is small.
This has no change in functionality.

We've discussed the issue that we have too many classes
to represent a concept of "file". We have File subclasses
that represent files read from disk. In addition to that,
we have bunch of InputElement subclasses (that are part
of InputGraph) that represent command line arguments for
input file names. InputElement is a wrapper for File.

InputElement has parseFile method. The method instantiates
a File. The File's constructor reads a file from disk and
parses that.

Because parseFile method is called from multiple worker
threads, file parsing is processed in parallel. In other
words, one reason why we needed the wrapper classes is
because a File would start reading a file as soon as it
is instantiated.

So, the reason why we have too many classes here is at
least partly because of the design flaw of File class.
Just like threads in a good threading library, we need
to separate instantiation from "start" method, so that
we can instantiate File objects when we need them (which
should be very fast because it involves only one mmap()
and no real file IO) and use them directly instead of
the wrapper classes. Later, we call parse() on each
file in parallel to let them do actual file IO.

In this design, we can eliminate a reason to have the
wrapper classes.

In order to minimize the size of the patch, I didn't go so
far as to replace the wrapper classes with File classes.
The wrapper classes are still there.

In this patch, we call parse() immediately after
instantiating a File, so this really has no change in
functionality. Eventually the call of parse() should be
moved to Driver::link(). That'll be done in another patch.

llvm-svn: 224102

9 years ago[mips] [test] Enable COMPILER_RT_INCLUDE_TESTS for MIPS
Kumar Sukhani [Fri, 12 Dec 2014 07:08:12 +0000 (07:08 +0000)]
[mips] [test] Enable COMPILER_RT_INCLUDE_TESTS for MIPS

Enabling COMPILER_RT_INCLUDE_TESTS and updating tests/sanitizer_allocator_test.cc to remove Allocator64 related tests for MIPS.

Reviewed By: samsonov

llvm-svn: 224101

9 years agoDo not warn on keyword undef
Serge Pavlov [Fri, 12 Dec 2014 06:37:55 +0000 (06:37 +0000)]
Do not warn on keyword undef

#undef a keyword is generally harmless but used often in configuration scripts.
Also added tests that I forgot to include to commit in r223114.

llvm-svn: 224100

9 years ago[ELF] Remove isThumb().
Shankar Easwaran [Fri, 12 Dec 2014 05:20:28 +0000 (05:20 +0000)]
[ELF] Remove isThumb().

llvm-svn: 224099

9 years agoA fix for PR21176.
Ekaterina Romanova [Fri, 12 Dec 2014 05:11:47 +0000 (05:11 +0000)]
A fix for PR21176.

DW_OP_const <const> doesn't describe a constant value, but a value at a constant address.
The proper way to describe a constant value is DW_OP_constu <const>, DW_OP_stack_value.
Added DW_OP_stack_value to the stack.

Marked incorrect-variable-debugloc1.ll to xfail for PowerPC64, while the the failure (PR21881)
is being investigated.

llvm-svn: 224098

9 years agoFix another infinite loop in InstCombine
Steven Wu [Fri, 12 Dec 2014 04:34:07 +0000 (04:34 +0000)]
Fix another infinite loop in InstCombine

Summary:
InstCombine infinite-loops for the testcase added
It is because InstCombine is generating instructions that can be
optimized by itself. Fix by not optimizing frem if the optimized
type is the same as original type.
rdar://problem/19150820

Reviewers: majnemer

Differential Revision: http://reviews.llvm.org/D6634

llvm-svn: 224097

9 years agoAdd support for building libc++ as a 32 bit library
Eric Fiselier [Fri, 12 Dec 2014 03:12:18 +0000 (03:12 +0000)]
Add support for building libc++ as a 32 bit library

llvm-svn: 224096

9 years agoFix building and running tests when LIBCXX_ENABLE_EXCEPTIONS or LIBCXX_ENABLE_RTTI...
Eric Fiselier [Fri, 12 Dec 2014 02:36:23 +0000 (02:36 +0000)]
Fix building and running tests when LIBCXX_ENABLE_EXCEPTIONS or LIBCXX_ENABLE_RTTI are turned off.

llvm-svn: 224095

9 years agoR600: Fix min/max matching problems with unordered compares
Matt Arsenault [Fri, 12 Dec 2014 02:30:37 +0000 (02:30 +0000)]
R600: Fix min/max matching problems with unordered compares

The returned operand needs to be permuted for the unordered
compares. Also fix incorrectly producing fmin_legacy / fmax_legacy
for f64, which don't exist.

llvm-svn: 224094

9 years agoR600/SI: fmin/fmax_legacy are not associative
Matt Arsenault [Fri, 12 Dec 2014 02:30:33 +0000 (02:30 +0000)]
R600/SI: fmin/fmax_legacy are not associative

llvm-svn: 224093

9 years agoR600/SI: Don't promote f32 select to i32
Matt Arsenault [Fri, 12 Dec 2014 02:30:29 +0000 (02:30 +0000)]
R600/SI: Don't promote f32 select to i32

This is nice for the instruction patterns, but it complicates
min / max matching. The select doesn't have the correct type and would
require looking through the bitcasts for the real float operands.

llvm-svn: 224092

9 years agoUpdate the modules build to match r223802.
Richard Smith [Fri, 12 Dec 2014 02:25:18 +0000 (02:25 +0000)]
Update the modules build to match r223802.

llvm-svn: 224091

9 years agoBitcode: Add missing "Remove in 4.0" comments
Duncan P. N. Exon Smith [Fri, 12 Dec 2014 02:11:31 +0000 (02:11 +0000)]
Bitcode: Add missing "Remove in 4.0" comments

llvm-svn: 224090

9 years agoDocument that PassManager::add() may delete the pass right away.
Matthias Braun [Fri, 12 Dec 2014 01:27:01 +0000 (01:27 +0000)]
Document that PassManager::add() may delete the pass right away.

Also remove redundant documentation:
- doxygen will copy documentation to overriden methods.
- Use \copydoc on PIMPL classes instead of replicating the text.

llvm-svn: 224089

9 years agoTom Stellard is now the code owner for libclc.
Peter Collingbourne [Fri, 12 Dec 2014 01:11:48 +0000 (01:11 +0000)]
Tom Stellard is now the code owner for libclc.

llvm-svn: 224088

9 years ago[ASan] Group all flag parsing code together. NFC.
Alexey Samsonov [Fri, 12 Dec 2014 01:08:24 +0000 (01:08 +0000)]
[ASan] Group all flag parsing code together. NFC.

llvm-svn: 224087

9 years agoComment and minor code cleanup for GCStrategy (NFC)
Philip Reames [Fri, 12 Dec 2014 00:49:03 +0000 (00:49 +0000)]
Comment and minor code cleanup for GCStrategy (NFC)

Updating comments to reflect the current state of the world after my recent changes to ownership structure and generally better describe what a GCStrategy is and how it works.

llvm-svn: 224086

9 years agoAdd target hook for whether it is profitable to reduce load widths
Matt Arsenault [Fri, 12 Dec 2014 00:00:24 +0000 (00:00 +0000)]
Add target hook for whether it is profitable to reduce load widths

Add an option to disable optimization to shrink truncated larger type
loads to smaller type loads. On SI this prevents using scalar load
instructions in some cases, since there are no scalar extloads.

llvm-svn: 224084

9 years agoMake sure if a thread specifies a 'register_data_addr' in a python operating system...
Greg Clayton [Thu, 11 Dec 2014 23:53:52 +0000 (23:53 +0000)]
Make sure if a thread specifies a 'register_data_addr' in a python operating system plug-in, that is is used to fetch the register values.

llvm-svn: 224083

9 years agoMake sure we print errors for python OperatingSystem plug-ins for when things go...
Greg Clayton [Thu, 11 Dec 2014 23:52:05 +0000 (23:52 +0000)]
Make sure we print errors for python OperatingSystem plug-ins for when things go wrong. We also dump the dictionary or collection that had errors so the user can see which info was wrong.

llvm-svn: 224082

9 years agoremove function names from comments; NFC
Sanjay Patel [Thu, 11 Dec 2014 23:38:43 +0000 (23:38 +0000)]
remove function names from comments; NFC

llvm-svn: 224080

9 years agoR600/SI: Handle physical registers in getOpRegClass
Matt Arsenault [Thu, 11 Dec 2014 23:37:34 +0000 (23:37 +0000)]
R600/SI: Handle physical registers in getOpRegClass

llvm-svn: 224079

9 years agoR600/SI: Don't verify constant bus usage of flag ops
Matt Arsenault [Thu, 11 Dec 2014 23:37:32 +0000 (23:37 +0000)]
R600/SI: Don't verify constant bus usage of flag ops

This was checking if pseudo-operands like the source
modifiers were using the constant bus, which happens to work
because the values these all can be happen to be valid inline
immediates.

This fixes a later commit which starts checking the register class
of the operands.

llvm-svn: 224078

9 years agoBitcode: Use unsigned char to record MDStrings
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 23:34:30 +0000 (23:34 +0000)]
Bitcode: Use unsigned char to record MDStrings

`MDString`s can have arbitrary characters in them.  Prevent an assertion
that fired in `BitcodeWriter` because of sign extension by copying the
characters into the record as `unsigned char`s.

Based on a patch by Keno Fischer; fixes PR21882.

llvm-svn: 224077

9 years agoreturn without temporary; NFC
Sanjay Patel [Thu, 11 Dec 2014 23:30:36 +0000 (23:30 +0000)]
return without temporary; NFC

llvm-svn: 224076

9 years agoEnable MachineVerifier in debug mode for X86, ARM, AArch64, Mips.
Matthias Braun [Thu, 11 Dec 2014 23:18:03 +0000 (23:18 +0000)]
Enable MachineVerifier in debug mode for X86, ARM, AArch64, Mips.

llvm-svn: 224075

9 years ago[X86] Add a temporary testcase for PR21876/r223996.
Ahmed Bougacha [Thu, 11 Dec 2014 23:07:52 +0000 (23:07 +0000)]
[X86] Add a temporary testcase for PR21876/r223996.

llvm-svn: 224074

9 years agoBitcode: Add METADATA_NODE and METADATA_VALUE
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 23:02:24 +0000 (23:02 +0000)]
Bitcode: Add METADATA_NODE and METADATA_VALUE

This reflects the typelessness of `Metadata` in the bitcode format,
removing types from all metadata operands.

`METADATA_VALUE` represents a `ValueAsMetadata`, and always has two
fields: the type and the value.

`METADATA_NODE` represents an `MDNode`, and unlike `METADATA_OLD_NODE`,
doesn't store types.  It stores operands at their ID+1 so that `0` can
reference `nullptr` operands.

Part of PR21532.

llvm-svn: 224073

9 years ago[Objective-C]. This patch extends objc_bridge attribute to support objc_bridge(id).
Fariborz Jahanian [Thu, 11 Dec 2014 22:56:26 +0000 (22:56 +0000)]
[Objective-C]. This patch extends  objc_bridge attribute to support objc_bridge(id).
This means that a pointer to the struct type to which the attribute appertains
is a CF type (and therefore an Objective-C object of some type), but not of any
specific class. rdar://19157264

llvm-svn: 224072

9 years ago[PowerPC] Better lowering for add/or of a FrameIndex
Hal Finkel [Thu, 11 Dec 2014 22:51:06 +0000 (22:51 +0000)]
[PowerPC] Better lowering for add/or of a FrameIndex

If we have an add (or an or that is really an add), where one operand is a
FrameIndex and the other operand is a small constant, we can combine the
lowering of the FrameIndex (which is lowered as an add of the FI and a zero
offset) with the constant operand.

Amusingly, this is an old potential improvement entry from
lib/Target/PowerPC/README.txt which had never been resolved. In short, we used
to lower:

        %X = alloca { i32, i32 }
        %Y = getelementptr {i32,i32}* %X, i32 0, i32 1
        ret i32* %Y

as:

        addi 3, 1, -8
        ori 3, 3, 4
        blr

and now we produce:

        addi 3, 1, -4
        blr

which is much more sensible.

llvm-svn: 224071

9 years agoBitcode: Add `OLD_` prefix to metadata node records
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 22:30:48 +0000 (22:30 +0000)]
Bitcode: Add `OLD_` prefix to metadata node records

I'm about to change these, so move the old ones out of the way.

Part of PR21532.

llvm-svn: 224070

9 years agoAdd 'REQUIRES: long_tests' to one more long test
Jonathan Roelofs [Thu, 11 Dec 2014 22:27:49 +0000 (22:27 +0000)]
Add 'REQUIRES: long_tests' to one more long test

llvm-svn: 224069

9 years agoTry to include operand counts for mismatches in tablegen.
Matt Arsenault [Thu, 11 Dec 2014 22:27:14 +0000 (22:27 +0000)]
Try to include operand counts for mismatches in tablegen.

llvm-svn: 224068

9 years agoR600/SI: Use unordered equal instructions
Matt Arsenault [Thu, 11 Dec 2014 22:15:43 +0000 (22:15 +0000)]
R600/SI: Use unordered equal instructions

llvm-svn: 224067

9 years agoR600/SI: Make more unordered comparisons legal
Matt Arsenault [Thu, 11 Dec 2014 22:15:39 +0000 (22:15 +0000)]
R600/SI: Make more unordered comparisons legal

This saves a second compare and an and / or by using
the unordered comparison instructions.

llvm-svn: 224066

9 years agoR600/SI: Use unordered not equal instructions
Matt Arsenault [Thu, 11 Dec 2014 22:15:35 +0000 (22:15 +0000)]
R600/SI: Use unordered not equal instructions

llvm-svn: 224065

9 years agoAdd 'REQUIERS: long_tests' to a few more long tests
Jonathan Roelofs [Thu, 11 Dec 2014 22:05:18 +0000 (22:05 +0000)]
Add 'REQUIERS: long_tests' to a few more long tests

llvm-svn: 224064

9 years ago[ASan] Change fake stack and local variables handling.
Alexey Samsonov [Thu, 11 Dec 2014 21:53:19 +0000 (21:53 +0000)]
[ASan] Change fake stack and local variables handling.

This commit changes the way we get fake stack from ASan runtime
(to find use-after-return errors) and the way we represent local
variables:
  - __asan_stack_malloc function now returns pointer to newly allocated
    fake stack frame, or NULL if frame cannot be allocated. It doesn't
    take pointer to real stack as an input argument, it is calculated
    inside the runtime.
  - __asan_stack_free function doesn't take pointer to real stack as
    an input argument. Now this function is never called if fake stack
    frame wasn't allocated.
  - __asan_init version is bumped to reflect changes in the ABI.
  - new flag "-asan-stack-dynamic-alloca" allows to store all the
    function local variables in a dynamic alloca, instead of the static
    one. It reduces the stack space usage in use-after-return mode
    (dynamic alloca will not be called if the local variables are stored
    in a fake stack), and improves the debug info quality for local
    variables (they will not be described relatively to %rbp/%rsp, which
    are assumed to be clobbered by function calls). This flag is turned
    off by default for now, but I plan to turn it on after more
    testing.

llvm-svn: 224063

9 years ago[ASan] Change fake stack and local variables handling.
Alexey Samsonov [Thu, 11 Dec 2014 21:53:03 +0000 (21:53 +0000)]
[ASan] Change fake stack and local variables handling.

This commit changes the way we get fake stack from ASan runtime
(to find use-after-return errors) and the way we represent local
variables:
  - __asan_stack_malloc function now returns pointer to newly allocated
    fake stack frame, or NULL if frame cannot be allocated. It doesn't
    take pointer to real stack as an input argument, it is calculated
    inside the runtime.
  - __asan_stack_free function doesn't take pointer to real stack as
    an input argument. Now this function is never called if fake stack
    frame wasn't allocated.
  - __asan_init version is bumped to reflect changes in the ABI.
  - new flag "-asan-stack-dynamic-alloca" allows to store all the
    function local variables in a dynamic alloca, instead of the static
    one. It reduces the stack space usage in use-after-return mode
    (dynamic alloca will not be called if the local variables are stored
    in a fake stack), and improves the debug info quality for local
    variables (they will not be described relatively to %rbp/%rsp, which
    are assumed to be clobbered by function calls). This flag is turned
    off by default for now, but I plan to turn it on after more
    testing.

llvm-svn: 224062

9 years agoCodeGen: Stop using LeakDetector for MachineInstr
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 21:51:37 +0000 (21:51 +0000)]
CodeGen: Stop using LeakDetector for MachineInstr

Since `MachineInstr` is required to have a trivial destructor, it cannot
remove itself from `LeakDetection`.  Remove the calls.

As it happens, this requirement is because `MachineFunction` allocates
all `MachineInstr`s in a custom allocator; when the `MachineFunction` is
destroyed they're dropped of the edge.  There's no benefit to detecting
leaks.

llvm-svn: 224061

9 years agoIR: Store MDNodes in a separate LeakDetector container
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 21:39:39 +0000 (21:39 +0000)]
IR: Store MDNodes in a separate LeakDetector container

This gives us better leak detection messages, like `Value` has.

This also has the side effect of papering over a problem where
`MachineInstr`s are added as garbage to the leak detector and then
deleted without being removed.  If `MDNode::getTemporary()` allocates an
`MDNodeFwdDecl` in the same spot, the leak detector asserts.  By
separating `MDNode`s into their own container we lose that assertion.

Since `MachineInstr` is required to have a trivial destructor, its usage
of `LeakDetector` at all is pretty suspect.  I'll be sending a patch
soon to strip that out.

llvm-svn: 224060

9 years ago[CodeGen] Add print and verify pass after each MachineFunctionPass by default
Matthias Braun [Thu, 11 Dec 2014 21:26:47 +0000 (21:26 +0000)]
[CodeGen] Add print and verify pass after each MachineFunctionPass by default

Previously print+verify passes were added in a very unsystematic way, which is
annoying when debugging as you miss intermediate steps and allows bugs to stay
unnotice when no verification is performed.

To make this change practical I added the possibility to explicitely disable
verification. I used this option on all places where no verification was
performed previously (because alot of places actually don't pass the
MachineVerifier).
In the long term these problems should be fixed properly and verification
enabled after each pass. I'll enable some more verification in subsequent
commits.

This is the 2nd attempt at this after realizing that PassManager::add() may
actually delete the pass.

llvm-svn: 224059

9 years agoLeakDetector: Simplify code and fix comments, NFC
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 21:23:43 +0000 (21:23 +0000)]
LeakDetector: Simplify code and fix comments, NFC

Rather than requiring overloads in the wrapper and the impl, just
overload the impl and use templates in the wrapper.  This makes it less
error prone to add more overloads (`void *` defeats any chance the
compiler has at noticing bugs, so the easier the better).

At the same time, correct the comment that was lying about not changing
functionality for `Value`.

llvm-svn: 224058

9 years agoFix platform_support.h's get_temp_file_name() on Newlib under __STRICT_ANSI__
Jonathan Roelofs [Thu, 11 Dec 2014 20:56:40 +0000 (20:56 +0000)]
Fix platform_support.h's get_temp_file_name() on Newlib under __STRICT_ANSI__

llvm-svn: 224057

9 years agoAsmParser: Don't crash on an ill-formed MDNodeVector
David Majnemer [Thu, 11 Dec 2014 20:51:54 +0000 (20:51 +0000)]
AsmParser: Don't crash on an ill-formed MDNodeVector

llvm-svn: 224056

9 years ago[modules] When constructing paths relative to a module, strip out /./ directory
Richard Smith [Thu, 11 Dec 2014 20:50:24 +0000 (20:50 +0000)]
[modules] When constructing paths relative to a module, strip out /./ directory
components. These sometimes get synthetically added, and we don't want -Ifoo
and -I./foo to be treated fundamentally differently here.

llvm-svn: 224055

9 years ago[InstCombine][X86] Improved folding of calls to Intrinsic::x86_sse4a_insertqi.
Andrea Di Biagio [Thu, 11 Dec 2014 20:44:59 +0000 (20:44 +0000)]
[InstCombine][X86] Improved folding of calls to Intrinsic::x86_sse4a_insertqi.

This patch teaches the instruction combiner how to fold a call to 'insertqi' if
the 'length field' (3rd operand) is set to zero, and if the sum between
field 'length' and 'bit index' (4th operand) is bigger than 64.

From the AMD64 Architecture Programmer's Manual:
1. If the sum of the bit index + length field is greater than 64, then the
   results are undefined;
2. A value of zero in the field length is defined as a length of 64.

This patch improves the existing combining logic for intrinsic 'insertqi'
adding extra checks to address both point 1. and point 2.

Differential Revision: http://reviews.llvm.org/D6583

llvm-svn: 224054

9 years agoAsmParser: Don't crash on an ill-formed MDNodeVector
David Majnemer [Thu, 11 Dec 2014 20:44:09 +0000 (20:44 +0000)]
AsmParser: Don't crash on an ill-formed MDNodeVector

llvm-svn: 224053

9 years agoInstead of having -Os/-Oz add OptimizeForSize/MinSize first, and later
Paul Robinson [Thu, 11 Dec 2014 20:14:04 +0000 (20:14 +0000)]
Instead of having -Os/-Oz add OptimizeForSize/MinSize first, and later
having OptimizeNone remove them again, just don't add them in the
first place if the function already has OptimizeNone.

Note that MinSize can still appear due to attributes on different
declarations; a future patch will address that.

llvm-svn: 224047

9 years agoRemove a convoluted way of calling close by moving the call to the only caller.
Rafael Espindola [Thu, 11 Dec 2014 20:12:55 +0000 (20:12 +0000)]
Remove a convoluted way of calling close by moving the call to the only caller.

As a bonus we can actually check the return value.

llvm-svn: 224046

9 years agoThis reverts commit r224043 and r224042.
Rafael Espindola [Thu, 11 Dec 2014 20:03:57 +0000 (20:03 +0000)]
This reverts commit r224043 and r224042.

check-llvm was failing.

llvm-svn: 224045

9 years agoSilence static analyzer warnings in LLVMSupport.
Michael Ilseman [Thu, 11 Dec 2014 19:46:38 +0000 (19:46 +0000)]
Silence static analyzer warnings in LLVMSupport.

The static analyzer catches a few potential bugs in LLVMSupport. Add
in asserts to silence the warnings.

llvm-svn: 224044

9 years agoEnable machineverifier in debug mode for X86, ARM, AArch64, Mips
Matthias Braun [Thu, 11 Dec 2014 19:42:09 +0000 (19:42 +0000)]
Enable machineverifier in debug mode for X86, ARM, AArch64, Mips

llvm-svn: 224043

9 years ago[CodeGen] Add print and verify pass after each MachineFunctionPass by default
Matthias Braun [Thu, 11 Dec 2014 19:42:05 +0000 (19:42 +0000)]
[CodeGen] Add print and verify pass after each MachineFunctionPass by default

Previously print+verify passes were added in a very unsystematic way, which is
annoying when debugging as you miss intermediate steps and allows bugs to stay
unnotice when no verification is performed.

To make this change practical I added the possibility to explicitely disable
verification. I used this option on all places where no verification was
performed previously (because alot of places actually don't pass the
MachineVerifier).
In the long term these problems should be fixed properly and verification
enabled after each pass. I'll enable some more verification in subsequent
commits.

llvm-svn: 224042

9 years ago[CodeGen] Let MachineVerifierPass own its banner string
Matthias Braun [Thu, 11 Dec 2014 19:41:51 +0000 (19:41 +0000)]
[CodeGen] Let MachineVerifierPass own its banner string

llvm-svn: 224041

9 years agoAST: Incomplete types might be zero sized
David Majnemer [Thu, 11 Dec 2014 19:36:24 +0000 (19:36 +0000)]
AST: Incomplete types might be zero sized

Comparing the address of an object with an incomplete type might return
true with a 'distinct' object if the former has a size of zero.
However, such an object should compare unequal with null.

llvm-svn: 224040

9 years agoWhen checking for nonnull parameter attributes, also check the ParmVarDecl since...
Aaron Ballman [Thu, 11 Dec 2014 19:35:42 +0000 (19:35 +0000)]
When checking for nonnull parameter attributes, also check the ParmVarDecl since the attribute may reside there, instead of just on the FunctionDecl. Fixes PR21668.

llvm-svn: 224039

9 years agoRemoved the assertion that we can find any named
Sean Callanan [Thu, 11 Dec 2014 19:33:57 +0000 (19:33 +0000)]
Removed the assertion that we can find any named
Objective-C type in the runtime.  This is not actually
true, it's entirely possible to say

@class DoesntExist;

@interface DoesExist {
  DoesntExist *whyyyyy;
}
@end

and this code will not only compile but also run.  So
this assertion will fire in situations users might
encounter.

I left the assertion enabled in debug mode, because we
could still catch a case we're not aware of (i.e., a
class that we *ought* to have found but where somehow
we mis-parsed the name).

<rdar://problem/19151914>

llvm-svn: 224038

9 years agoAdd an XFAIL for Newlib's missing uchar.h
Jonathan Roelofs [Thu, 11 Dec 2014 19:11:39 +0000 (19:11 +0000)]
Add an XFAIL for Newlib's missing uchar.h

llvm-svn: 224037

9 years ago[Hexagon] Renaming classes in preparation for replacement.
Colin LeMahieu [Thu, 11 Dec 2014 19:01:28 +0000 (19:01 +0000)]
[Hexagon] Renaming classes in preparation for replacement.

llvm-svn: 224036

9 years agoARM: convert isTargetIOS checks to isTargetDarwin.
Tim Northover [Thu, 11 Dec 2014 18:49:37 +0000 (18:49 +0000)]
ARM: convert isTargetIOS checks to isTargetDarwin.

The distinction is mostly useful in the front-end. By the time we get here,
there are very few situations where we actually want different behaviour for
Darwin and IOS (in fact Darwin mostly just exists in a few tests). So this
should reduce any surprising weirdness for anyone using it.

No functional change on anything anyone actually cares about.

llvm-svn: 224035

9 years ago[Sanitizer] Don't modify mmap_limit_mb flag in runtime.
Alexey Samsonov [Thu, 11 Dec 2014 18:45:24 +0000 (18:45 +0000)]
[Sanitizer] Don't modify mmap_limit_mb flag in runtime.

Instead, rely on the fact that RAW_CHECK doesn't call mmap(),
and we'll be able to print an error message and kill a program.

llvm-svn: 224034

9 years ago[PowerPC] Implement BuildSDIVPow2, lower i64 pow2 sdiv using sradi
Hal Finkel [Thu, 11 Dec 2014 18:37:52 +0000 (18:37 +0000)]
[PowerPC] Implement BuildSDIVPow2, lower i64 pow2 sdiv using sradi

PPCISelDAGToDAG contained existing code to lower i32 sdiv by a power-of-2 using
srawi/addze, but did not implement the i64 case. DAGCombine now contains a
callback specifically designed for this purpose (BuildSDIVPow2), and part of
the logic has been moved to an implementation of that callback. Doing this
lowering using BuildSDIVPow2 likely does not matter, compared to handling
everything in PPCISelDAGToDAG, for the positive divisor case, but the negative
divisor case, which generates an additional negation, can potentially benefit
from additional folding from DAGCombine. Now, both the i32 and the i64 cases
have been implemented.

Fixes PR20732.

llvm-svn: 224033

9 years agoMark a bunch of long running tests as 'REQUIRES: long_tests'
Jonathan Roelofs [Thu, 11 Dec 2014 18:35:36 +0000 (18:35 +0000)]
Mark a bunch of long running tests as 'REQUIRES: long_tests'

This lets us skip them as UNSUPPORTED on slow systems like QEMU

llvm-svn: 224032

9 years ago[Sanitizer] Fix report_path functionality:
Alexey Samsonov [Thu, 11 Dec 2014 18:30:25 +0000 (18:30 +0000)]
[Sanitizer] Fix report_path functionality:

Summary:
  - Make sure mmap() is never called inside RawWrite function.
  - Wrap a bunch of standalone globals in a ReportFile object.
  - Make sure accesses to these globals are thread-safe.
  - Fix report_path functionality on Windows, where
    __sanitizer_set_report_path() would break program.

I've started this yak shaving in order to make
"CommonFlags::mmap_limit_mb" immutable. Currently we drop this flag
to zero before printing an error message.

Test Plan: regression test suite

Reviewers: kcc, glider

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6595

llvm-svn: 224031

9 years ago[Tsan] Fix the signal_recursive.cc test to pass on systems with high loads
Viktor Kutuzov [Thu, 11 Dec 2014 17:42:29 +0000 (17:42 +0000)]
[Tsan] Fix the signal_recursive.cc test to pass on systems with high loads
Differential Revision: http://reviews.llvm.org/D6504

llvm-svn: 224030

9 years agoRemove dead code. NFC.
Rafael Espindola [Thu, 11 Dec 2014 17:17:26 +0000 (17:17 +0000)]
Remove dead code. NFC.

llvm-svn: 224029

9 years ago[AVX512] Add support for 512b variable bit shift intrinsics.
Cameron McInally [Thu, 11 Dec 2014 17:13:05 +0000 (17:13 +0000)]
[AVX512] Add support for 512b variable bit shift intrinsics.

llvm-svn: 224028

9 years ago[Hexagon] Ading i64 <- i32, i32 sextw pattern.
Colin LeMahieu [Thu, 11 Dec 2014 17:08:21 +0000 (17:08 +0000)]
[Hexagon] Ading i64 <- i32, i32 sextw pattern.

llvm-svn: 224027

9 years ago[Hexagon] Adding encoding information for sign extend word instruction.
Colin LeMahieu [Thu, 11 Dec 2014 16:43:06 +0000 (16:43 +0000)]
[Hexagon] Adding encoding information for sign extend word instruction.

llvm-svn: 224026

9 years agoOnly seek once before writing the member offsets.
Rafael Espindola [Thu, 11 Dec 2014 16:34:00 +0000 (16:34 +0000)]
Only seek once before writing the member offsets.

This cuts down the number on system calls done by a static llvm-ar producing
lib/libclangSema.a from 9164 to 442.

llvm-svn: 224025

9 years agoMark some more fenv tests as UNSUPPORTED by newlib
Jonathan Roelofs [Thu, 11 Dec 2014 16:17:26 +0000 (16:17 +0000)]
Mark some more fenv tests as UNSUPPORTED by newlib

llvm-svn: 224024

9 years agotsan: fix Go build
Dmitry Vyukov [Thu, 11 Dec 2014 16:12:45 +0000 (16:12 +0000)]
tsan: fix Go build

GetRSS is used in Go build.

llvm-svn: 224023

9 years agotsan: don't subtract one from fake PCs
Dmitry Vyukov [Thu, 11 Dec 2014 16:12:16 +0000 (16:12 +0000)]
tsan: don't subtract one from fake PCs

These are fake and not actual PCs, more like function IDs.
Pass them to external symbolizer untouched.

llvm-svn: 224022

9 years agoAdd an XFAIL for Newlib's missing fenv.h
Jonathan Roelofs [Thu, 11 Dec 2014 15:37:22 +0000 (15:37 +0000)]
Add an XFAIL for Newlib's missing fenv.h

llvm-svn: 224021

9 years agollvm-ar: close input files early.
Rafael Espindola [Thu, 11 Dec 2014 15:16:14 +0000 (15:16 +0000)]
llvm-ar: close input files early.

We already have them mapped into memory, so we can just close the file.

llvm-svn: 224020

9 years agoAVX-512: Added all forms of COMPRESS instruction
Elena Demikhovsky [Thu, 11 Dec 2014 15:02:24 +0000 (15:02 +0000)]
AVX-512: Added all forms of COMPRESS instruction
+ intrinsics + tests

llvm-svn: 224019

9 years agoFix check-asan on Windows by putting lib/clang/... onto PATH (PR21880)
Timur Iskhodzhanov [Thu, 11 Dec 2014 14:04:57 +0000 (14:04 +0000)]
Fix check-asan on Windows by putting lib/clang/... onto PATH (PR21880)

llvm-svn: 224018

9 years ago[mips][microMIPS] Implement CodeGen support for LI16 instruction.
Jozef Kolek [Thu, 11 Dec 2014 13:56:23 +0000 (13:56 +0000)]
[mips][microMIPS] Implement CodeGen support for LI16 instruction.

Differential Revision: http://reviews.llvm.org/D5840

llvm-svn: 224017

9 years agoInstSimplify: Remove usesless %a parameter from tests
David Majnemer [Thu, 11 Dec 2014 12:56:17 +0000 (12:56 +0000)]
InstSimplify: Remove usesless %a parameter from tests

No functional change intended.

llvm-svn: 224016

9 years agoThe inliner needs to fix up debug information for llvm.dbg.declare, not only for...
Michael Kuperstein [Thu, 11 Dec 2014 12:41:10 +0000 (12:41 +0000)]
The inliner needs to fix up debug information for llvm.dbg.declare, not only for llvm.dbg.value.

Patch by Amjad Aboud

Differential Revision: http://reviews.llvm.org/D6525

llvm-svn: 224015

9 years agoELF/AArch64: Add a test for R_AARCH64_ABS32
Will Newton [Thu, 11 Dec 2014 12:37:35 +0000 (12:37 +0000)]
ELF/AArch64: Add a test for R_AARCH64_ABS32

llvm-svn: 224014

9 years agoELF/AArch64: Add a test for R_AARCH64_ABS64
Will Newton [Thu, 11 Dec 2014 12:36:58 +0000 (12:36 +0000)]
ELF/AArch64: Add a test for R_AARCH64_ABS64

llvm-svn: 224013

9 years agoEmit warning if define or undef reserved identifier or keyword.
Serge Pavlov [Thu, 11 Dec 2014 12:18:08 +0000 (12:18 +0000)]
Emit warning if define or undef reserved identifier or keyword.

Recommit of r223114, reverted in r223120.

llvm-svn: 224012

9 years agoAdd newline missing in r224010.
Michael Kuperstein [Thu, 11 Dec 2014 11:30:20 +0000 (11:30 +0000)]
Add newline missing in r224010.

llvm-svn: 224011

9 years ago[X86] When converting movs to pushes, don't assume MOVmi operand is an actual immediate
Michael Kuperstein [Thu, 11 Dec 2014 11:26:16 +0000 (11:26 +0000)]
[X86] When converting movs to pushes, don't assume MOVmi operand is an actual immediate

This should fix PR21878.

llvm-svn: 224010

9 years agoBugfix in InlineSpiller::traceSiblingValue().
Patrik Hagglund [Thu, 11 Dec 2014 10:40:17 +0000 (10:40 +0000)]
Bugfix in InlineSpiller::traceSiblingValue().

Properly determine whether or not a phi was added by splitting.
Check against the current VNInfo of OrigLI instead of against the
OrigVNI argument.

Patch provided by Jonas Paulsson. Reviewed by Quentin Colombet.

llvm-svn: 224009

9 years agoAVX-512: Fixed a bug in lowering setcc for MVT::i1 type
Elena Demikhovsky [Thu, 11 Dec 2014 10:21:12 +0000 (10:21 +0000)]
AVX-512: Fixed a bug in lowering setcc for MVT::i1 type

llvm-svn: 224008

9 years agotest commit (spelling correction)
Kumar Sukhani [Thu, 11 Dec 2014 08:33:36 +0000 (08:33 +0000)]
test commit (spelling correction)

llvm-svn: 224007

9 years agoRefactor creation of overflow result tuples in InstCombineCalls.
Erik Eckstein [Thu, 11 Dec 2014 08:02:30 +0000 (08:02 +0000)]
Refactor creation of overflow result tuples in InstCombineCalls.

Extract the creation of overflow result tuples in a separate function. NFC.

llvm-svn: 224006

9 years agoUse range-based for loops. NFC
Craig Topper [Thu, 11 Dec 2014 07:04:54 +0000 (07:04 +0000)]
Use range-based for loops. NFC

llvm-svn: 224005

9 years agoJust use the Module unique_ptr object directly in many places instead of separate...
Craig Topper [Thu, 11 Dec 2014 07:04:52 +0000 (07:04 +0000)]
Just use the Module unique_ptr object directly in many places instead of separate pointer that's kept in sync with it.

llvm-svn: 224004

9 years agoUse unique_ptr to remove an explicit delete. Change return type to pass the unique_pt...
Craig Topper [Thu, 11 Dec 2014 07:04:46 +0000 (07:04 +0000)]
Use unique_ptr to remove an explicit delete. Change return type to pass the unique_ptr to caller.

llvm-svn: 224003