platform/upstream/llvm.git
8 years ago[MIPS] Use arch values for lock-free atomic operations
Petar Jovanovic [Tue, 11 Aug 2015 21:27:39 +0000 (21:27 +0000)]
[MIPS] Use arch values for lock-free atomic operations

Let NaClMips32ELTargetInfo inherit arch values for maximum width lock-free
atomic operations.

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

llvm-svn: 244675

8 years ago[lit] Don't disable the lit progress bar by default with MSVC
Reid Kleckner [Tue, 11 Aug 2015 21:24:59 +0000 (21:24 +0000)]
[lit] Don't disable the lit progress bar by default with MSVC

Only disable the progress bar when we're generating VS project files,
like we do for XCode. This makes lit use the simple, non-curses progress
bar that looks like this with:

Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 5.87s

llvm-svn: 244674

8 years ago[analyzer] Incorrect env variable replaced.
Anton Yartsev [Tue, 11 Aug 2015 21:24:19 +0000 (21:24 +0000)]
[analyzer] Incorrect env variable replaced.

llvm-svn: 244673

8 years agodon't repeat function names in comments; NFC
Sanjay Patel [Tue, 11 Aug 2015 21:24:04 +0000 (21:24 +0000)]
don't repeat function names in comments; NFC

llvm-svn: 244672

8 years agoAdd an assert to catch lexical decl deserialization bugs.
Richard Smith [Tue, 11 Aug 2015 21:21:20 +0000 (21:21 +0000)]
Add an assert to catch lexical decl deserialization bugs.

llvm-svn: 244671

8 years agoFixing a few C++0x comments to be C++11; NFC.
Aaron Ballman [Tue, 11 Aug 2015 21:17:53 +0000 (21:17 +0000)]
Fixing a few C++0x comments to be C++11; NFC.

llvm-svn: 244670

8 years agoAdd missing documentation for conversionDecl; NFC.
Aaron Ballman [Tue, 11 Aug 2015 21:12:46 +0000 (21:12 +0000)]
Add missing documentation for conversionDecl; NFC.

llvm-svn: 244669

8 years agofix 80-cols; NFC
Sanjay Patel [Tue, 11 Aug 2015 21:11:56 +0000 (21:11 +0000)]
fix 80-cols; NFC

llvm-svn: 244668

8 years agoNFC SelectionDAGDumper: fix typo
JF Bastien [Tue, 11 Aug 2015 21:10:07 +0000 (21:10 +0000)]
NFC SelectionDAGDumper: fix typo

Subscribers: llvm-commits

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

llvm-svn: 244667

8 years agoAdd a polymorphic AST matcher for testing whether a constructor or a conversion decla...
Aaron Ballman [Tue, 11 Aug 2015 21:09:52 +0000 (21:09 +0000)]
Add a polymorphic AST matcher for testing whether a constructor or a conversion declaration is marked as explicit or not.

llvm-svn: 244666

8 years agoWebAssembly: implement comparison.
JF Bastien [Tue, 11 Aug 2015 21:02:46 +0000 (21:02 +0000)]
WebAssembly: implement comparison.

Some of the FP comparisons (ueq, one, ult, ule, ugt, uge) are currently broken, I'll fix them in a follow-up.

Reviewers: sunfish

Subscribers: llvm-commits, jfb

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

llvm-svn: 244665

8 years agoDon't crash if the file we want to touch doesn't exist.
Greg Clayton [Tue, 11 Aug 2015 21:01:32 +0000 (21:01 +0000)]
Don't crash if the file we want to touch doesn't exist.

llvm-svn: 244663

8 years agoAdd an AST matcher to match member intializers of a CXXCtorInitializer.
Aaron Ballman [Tue, 11 Aug 2015 20:42:00 +0000 (20:42 +0000)]
Add an AST matcher to match member intializers of a CXXCtorInitializer.

llvm-svn: 244662

8 years ago[libFuzzer] more trophies
Kostya Serebryany [Tue, 11 Aug 2015 20:34:48 +0000 (20:34 +0000)]
[libFuzzer] more trophies

llvm-svn: 244661

8 years agoclang-format: Make SpaceBeforeParens work with overloaded operators.
Daniel Jasper [Tue, 11 Aug 2015 20:32:24 +0000 (20:32 +0000)]
clang-format: Make SpaceBeforeParens work with overloaded operators.

Patch by Jon Chesterfield, thank you!

llvm-svn: 244660

8 years ago[cmake] Shorten FreeBSD and DragonFly checks as suggested post-commit
Reid Kleckner [Tue, 11 Aug 2015 20:28:28 +0000 (20:28 +0000)]
[cmake] Shorten FreeBSD and DragonFly checks as suggested post-commit

NFC

llvm-svn: 244659

8 years agoRevert the diagnostic improvements in r244602 as they introduced a problematic dependency
David Blaikie [Tue, 11 Aug 2015 20:21:45 +0000 (20:21 +0000)]
Revert the diagnostic improvements in r244602 as they introduced a problematic dependency

Seems we had some internal uses that include ClangTidyTest.h and weren't
ready for a gtest dependency. Reverting to give Manuel some time to look
into it.

llvm-svn: 244658

8 years ago[x86] enable machine combiner reassociations for 128-bit vector single/double multiplies
Sanjay Patel [Tue, 11 Aug 2015 20:19:23 +0000 (20:19 +0000)]
[x86] enable machine combiner reassociations for 128-bit vector single/double multiplies

llvm-svn: 244657

8 years ago[LowerSwitch] Skip dead blocks for processSwitchInst()
Chen Li [Tue, 11 Aug 2015 20:16:17 +0000 (20:16 +0000)]
[LowerSwitch] Skip dead blocks for processSwitchInst()

Summary: This patch adds check for dead blocks and skip them for processSwitchInst(). This will help reduce compilation time.

Reviewers: reames, hans

Subscribers: llvm-commits

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

llvm-svn: 244656

8 years agoWebAssembly: implement WebAssemblyTargetLowering::getTargetNodeName
JF Bastien [Tue, 11 Aug 2015 20:13:18 +0000 (20:13 +0000)]
WebAssembly: implement WebAssemblyTargetLowering::getTargetNodeName

Summary: Implementation is the same as in AArch64.

Subscribers: aemerson, jfb, llvm-commits, sunfish

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

llvm-svn: 244655

8 years agoFix mismatched sign comparison
Reid Kleckner [Tue, 11 Aug 2015 20:06:51 +0000 (20:06 +0000)]
Fix mismatched sign comparison

llvm-svn: 244653

8 years agofix minsize detection: minsize attribute implies optimizing for size
Sanjay Patel [Tue, 11 Aug 2015 19:39:36 +0000 (19:39 +0000)]
fix minsize detection: minsize attribute implies optimizing for size

Also, add a test for optsize because this was not part of any existing regression test.

llvm-svn: 244651

8 years ago[MSVC Compatibility] Classify ext_ms_cast_fn_obj as DefaultError
David Majnemer [Tue, 11 Aug 2015 19:25:13 +0000 (19:25 +0000)]
[MSVC Compatibility] Classify ext_ms_cast_fn_obj as DefaultError

This non-conforming extension was introduced to make it possible for us
to correctly compile <atomic> in VS 2013 and 2015.  Let's limit its
impact to system headers to encourage portable code.

llvm-svn: 244650

8 years agoSelectionDAG: Prefer to combine multiplication with less uses for fma
Jingyue Wu [Tue, 11 Aug 2015 19:21:46 +0000 (19:21 +0000)]
SelectionDAG: Prefer to combine multiplication with less uses for fma

Summary:
For example:

  s6 = s0*s5;
  s2 = s6*s6 + s6;
  ...
  s4 = s6*s3;

We notice that it is possible for s2 is folded to fma (s0, s5, fmul (s6 s6)).
This only happens when Aggressive is true, otherwise hasOneUse() check
already prevents from folding the multiplication with more uses.

Test Plan: test/CodeGen/NVPTX/fma-assoc.ll

Patch by Xuetian Weng

Reviewers: hfinkel, apazos, jingyue, ohsallen, arsenm

Subscribers: arsenm, jholewinski, llvm-commits

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

llvm-svn: 244649

8 years agoRevert "[cmake] Add helper for finding potentially external projects"
Reid Kleckner [Tue, 11 Aug 2015 19:02:57 +0000 (19:02 +0000)]
Revert "[cmake] Add helper for finding potentially external projects"

This reverts commit r244633.

We aren't going to be able to use it because the compiler-rt build can
be built standalone without an LLVM source dir *or* an installed copy of
LLVM.

llvm-svn: 244648

8 years agoRevert the rest of r244634, since it breaks the standalone build
Reid Kleckner [Tue, 11 Aug 2015 18:43:13 +0000 (18:43 +0000)]
Revert the rest of r244634, since it breaks the standalone build

compiler-rt can apparently be built without an installed copy of LLVM,
so we can't call its cmake code.

llvm-svn: 244647

8 years ago[ubsan][mips] Revise r243384 to avoid special casing big-endian mips.
Daniel Sanders [Tue, 11 Aug 2015 18:40:02 +0000 (18:40 +0000)]
[ubsan][mips] Revise r243384 to avoid special casing big-endian mips.

Account for the case when uptr is 32-bit instead of trying to fix this case
using the little endian path.

llvm-svn: 244646

8 years agoInclude sanitizer_posix.h to try to fix the mac build
Reid Kleckner [Tue, 11 Aug 2015 18:29:32 +0000 (18:29 +0000)]
Include sanitizer_posix.h to try to fix the mac build

Linux must pick it up transitively.

llvm-svn: 244645

8 years agoFix UB in MCJIT test cases that relied on union type punning
David Blaikie [Tue, 11 Aug 2015 18:17:45 +0000 (18:17 +0000)]
Fix UB in MCJIT test cases that relied on union type punning

Reviewers: lhames, aaron.ballman

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

llvm-svn: 244644

8 years agoRe-apply "cmake: Make CMAKE_BUILD_TYPE check case-insensitive"
Justin Bogner [Tue, 11 Aug 2015 18:17:41 +0000 (18:17 +0000)]
Re-apply "cmake: Make CMAKE_BUILD_TYPE check case-insensitive"

This re-applies r244516 (effectively reverting r244516) without losing
the check that caused failures for VS.

llvm-svn: 244643

8 years ago[LowerSwitch] Fix a bug when LowerSwitch deletes the default block
Chen Li [Tue, 11 Aug 2015 18:12:26 +0000 (18:12 +0000)]
[LowerSwitch] Fix a bug when LowerSwitch deletes the default block

Summary: LowerSwitch crashed with the attached test case after deleting the default block. This happened because the current implementation of deleting dead blocks is wrong. After the default block being deleted, it contains no instruction or terminator, and it should no be traversed anymore. However, since the iterator is advanced before processSwitchInst() function is executed, the block advanced to could be deleted inside processSwitchInst(). The deleted block would then be visited next and crash dyn_cast<SwitchInst>(Cur->getTerminator()) because Cur->getTerminator() returns a nullptr. This patch fixes this problem by recording dead default blocks into a list, and delete them after all processSwitchInst() has been done. It still possible to visit dead default blocks and waste time process them. But it is a compile time issue, and I plan to have another patch to add support to skip dead blocks.

Reviewers: kariddi, resistor, hans, reames

Subscribers: llvm-commits

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

llvm-svn: 244642

8 years agoUse llvm::make_unique to fix the MSVC build.
Rafael Espindola [Tue, 11 Aug 2015 18:11:17 +0000 (18:11 +0000)]
Use llvm::make_unique to fix the MSVC build.

llvm-svn: 244641

8 years agoAdd support for weak undefined symbols.
Rafael Espindola [Tue, 11 Aug 2015 17:57:05 +0000 (17:57 +0000)]
Add support for weak undefined symbols.

llvm-svn: 244640

8 years agoRemove unused templating.
Rafael Espindola [Tue, 11 Aug 2015 17:51:57 +0000 (17:51 +0000)]
Remove unused templating.

llvm-svn: 244639

8 years ago[windows] Use lld-link instead of lld-link2, the latter no longer exists
Reid Kleckner [Tue, 11 Aug 2015 17:36:09 +0000 (17:36 +0000)]
[windows] Use lld-link instead of lld-link2, the latter no longer exists

The test passed for me locally because I had a stale copy of
lld-link2.exe.

llvm-svn: 244638

8 years agoAdd SmallString test trying to exercise the realloc() code path
Yaron Keren [Tue, 11 Aug 2015 17:35:49 +0000 (17:35 +0000)]
Add SmallString test trying to exercise the realloc() code path
by allocating a small size (will go through malloc) and then large size.

llvm-svn: 244637

8 years agoAdd support for weak symbols.
Rafael Espindola [Tue, 11 Aug 2015 17:33:02 +0000 (17:33 +0000)]
Add support for weak symbols.

llvm-svn: 244636

8 years agoRevert part of the last cmake change, it broke configuring with libcxx on Linux for me
Reid Kleckner [Tue, 11 Aug 2015 17:22:06 +0000 (17:22 +0000)]
Revert part of the last cmake change, it broke configuring with libcxx on Linux for me

llvm-svn: 244635

8 years ago[cmake] Handle external source for lld and libcxx
Reid Kleckner [Tue, 11 Aug 2015 17:18:23 +0000 (17:18 +0000)]
[cmake] Handle external source for lld and libcxx

As requested in post-commit review of r244549.

llvm-svn: 244634

8 years ago[cmake] Add helper for finding potentially external projects
Reid Kleckner [Tue, 11 Aug 2015 17:16:35 +0000 (17:16 +0000)]
[cmake] Add helper for finding potentially external projects

I plan to use this from compiler-rt, but it's useful for any LLVM
project that depends on more than just LLVM.

llvm-svn: 244633

8 years agoUse real values for DefindeFirst and DefinedLast.
Rafael Espindola [Tue, 11 Aug 2015 17:10:02 +0000 (17:10 +0000)]
Use real values for DefindeFirst and DefinedLast.

With this clang notices that switches are fully covered.

llvm-svn: 244632

8 years agofix minsize detection: minsize attribute implies optimizing for size
Sanjay Patel [Tue, 11 Aug 2015 17:04:31 +0000 (17:04 +0000)]
fix minsize detection: minsize attribute implies optimizing for size

llvm-svn: 244631

8 years agoadd missing tests for powi expansion with size optimizations
Sanjay Patel [Tue, 11 Aug 2015 16:58:49 +0000 (16:58 +0000)]
add missing tests for powi expansion with size optimizations

The minsize test will be fixed in the next commit.

llvm-svn: 244630

8 years ago[windows] Remove CHECK for strdup symbol that comes from the CRT
Reid Kleckner [Tue, 11 Aug 2015 16:56:26 +0000 (16:56 +0000)]
[windows] Remove CHECK for strdup symbol that comes from the CRT

llvm-symbolizer isn't symbolizing it for some reason. I'll investigate.

llvm-svn: 244629

8 years agoDelete unused typedef.
Rafael Espindola [Tue, 11 Aug 2015 16:55:28 +0000 (16:55 +0000)]
Delete unused typedef.

llvm-svn: 244628

8 years agofixed to use FileCheck
Sanjay Patel [Tue, 11 Aug 2015 16:51:31 +0000 (16:51 +0000)]
fixed to use FileCheck

llvm-svn: 244627

8 years agoCOFF: Ignore /editandcontinue option.
Rui Ueyama [Tue, 11 Aug 2015 16:46:08 +0000 (16:46 +0000)]
COFF: Ignore /editandcontinue option.

llvm-svn: 244626

8 years agofixed to test attribute, rather than CPU
Sanjay Patel [Tue, 11 Aug 2015 16:43:18 +0000 (16:43 +0000)]
fixed to test attribute, rather than CPU

llvm-svn: 244625

8 years agoDon't report a conflict between two local symbols.
Rafael Espindola [Tue, 11 Aug 2015 16:30:34 +0000 (16:30 +0000)]
Don't report a conflict between two local symbols.

llvm-svn: 244624

8 years agoSpeculative fix for Mac build
Reid Kleckner [Tue, 11 Aug 2015 16:30:27 +0000 (16:30 +0000)]
Speculative fix for Mac build

llvm-svn: 244623

8 years agoEnable EliminateAvailableExternally pass in the LTO pipeline.
Teresa Johnson [Tue, 11 Aug 2015 16:26:41 +0000 (16:26 +0000)]
Enable EliminateAvailableExternally pass in the LTO pipeline.

Summary:
For LTO we need to enable this pass in the LTO pipeline,
as it is skipped during the "-flto -c" compile step (when PrepareForLTO is
set).

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 244622

8 years agoRevert "Add non-member begin and end so that drop_begin works on iterator_range."
Rafael Espindola [Tue, 11 Aug 2015 16:26:06 +0000 (16:26 +0000)]
Revert "Add non-member begin and end so that drop_begin works on iterator_range."

This reverts commit r244620.

MSVC doesn't like it :-(

llvm-svn: 244621

8 years agoAdd non-member begin and end so that drop_begin works on iterator_range.
Rafael Espindola [Tue, 11 Aug 2015 16:12:56 +0000 (16:12 +0000)]
Add non-member begin and end so that drop_begin works on iterator_range.

llvm-svn: 244620

8 years agofix typos; NFC
Sanjay Patel [Tue, 11 Aug 2015 16:10:41 +0000 (16:10 +0000)]
fix typos; NFC

llvm-svn: 244619

8 years agoVariable names should start with an upper case letter; NFC
Sanjay Patel [Tue, 11 Aug 2015 16:05:43 +0000 (16:05 +0000)]
Variable names should start with an upper case letter; NFC

llvm-svn: 244618

8 years agofix minsize detection: minsize attribute implies optimizing for size
Sanjay Patel [Tue, 11 Aug 2015 15:56:31 +0000 (15:56 +0000)]
fix minsize detection: minsize attribute implies optimizing for size

llvm-svn: 244617

8 years ago[Windows] Use llvm-symbolizer before using dbghelp
Reid Kleckner [Tue, 11 Aug 2015 15:51:40 +0000 (15:51 +0000)]
[Windows] Use llvm-symbolizer before using dbghelp

Summary:
llvm-symbolizer understands both PDBs and DWARF, so it's a better bet if
it's available. It prints out the function parameter types and column
numbers, so I needed to churn the expected test output a bit.

This makes most of the llvm-symbolizer subprocessing code
target-independent. Pipes on all platforms use fd_t, and we can use the
portable ReadFromFile / WriteToFile wrappers in symbolizer_sanitizer.cc.
Only the pipe creation and process spawning is Windows-specific.

Please check that the libcdep layering is still correct. I don't know
how to reproduce the build configuration that relies on that.

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 244616

8 years ago[GlobalMerge] Use private linkage for MergedGlobals variables
John Brawn [Tue, 11 Aug 2015 15:48:04 +0000 (15:48 +0000)]
[GlobalMerge] Use private linkage for MergedGlobals variables

Other objects can never reference the MergedGlobals symbol so external linkage
is never needed. Using private instead of internal linkage means the object is
more similar to what it looks like when global merging is not enabled, with
the only difference being that the merged variables are addressed indirectly
relative to the start of the section they are in.

Also add aliases for merged variables with internal linkage, as this also makes
the object be more like what it is when they are not merged.

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

llvm-svn: 244615

8 years agoFix InstCombine test: invalid CHECK line slipped in r231270
Mehdi Amini [Tue, 11 Aug 2015 15:31:17 +0000 (15:31 +0000)]
Fix InstCombine test: invalid CHECK line slipped in r231270

I incorrectly wrote CHECK-NEXT with followin with ':', the check was
ignored by FileCheck.
The non-inbound GEP is folded here because the DataLayout is no longer
optional, the fold was originally guarded with a comment that said:
    We need TD information to know the pointer size unless this is inbounds.
Now we always have "TD information" and perform the fold.

Thanks Jonathan Roelofs for noticing.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 244613

8 years agoremove unnecessary settings/attributes from test case
Sanjay Patel [Tue, 11 Aug 2015 15:30:53 +0000 (15:30 +0000)]
remove unnecessary settings/attributes from test case

llvm-svn: 244612

8 years ago[RegionInfo] Verify getRegionFor
Michael Kruse [Tue, 11 Aug 2015 15:16:43 +0000 (15:16 +0000)]
[RegionInfo] Verify getRegionFor

Summary:
Check the contents of BBtoRegion during analysis verification. It only takes place if -verify-region-info is passed or LLVM is compiled with XDEBUG.

RegionBase<Tr>::verifyRegion() also checks the RegionInfoBase<Tr>::VerifyRegionInfo flag, which is redundant, but verifyRegion() is public API and might be invoked from other sites. In order to avoid behavioral change, this check is not removed. In any case, no region will be verified unless VerifyRegionInfo is set.

Reviewers: grosser

Subscribers: llvm-commits

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

llvm-svn: 244611

8 years agofix code that was accidentally commented out in previous commit
Sanjay Patel [Tue, 11 Aug 2015 15:08:29 +0000 (15:08 +0000)]
fix code that was accidentally commented out in previous commit

llvm-svn: 244610

8 years agofix typos in comments; NFC
Sanjay Patel [Tue, 11 Aug 2015 15:04:51 +0000 (15:04 +0000)]
fix typos in comments; NFC

llvm-svn: 244609

8 years agoAssign regions to all BBs from CodeGeneration
Michael Kruse [Tue, 11 Aug 2015 14:47:37 +0000 (14:47 +0000)]
Assign regions to all BBs from CodeGeneration

In order to have a valid region analysis, we assign all newly created blocks to the parent of the scop's region. This is correct for any pre-existing regions (including the scop's region and its parent), but does not discover any region inside the generated code. For Polly this is not necessary because we do not want to re-run Polly on its own generated code anyway.

Reviewers: grosser

Part of Differential Revision: http://reviews.llvm.org/D11867

llvm-svn: 244608

8 years agofix typo in comment; NFC
Sanjay Patel [Tue, 11 Aug 2015 14:45:08 +0000 (14:45 +0000)]
fix typo in comment; NFC

llvm-svn: 244607

8 years agoRevise the simplification of regions
Michael Kruse [Tue, 11 Aug 2015 14:39:21 +0000 (14:39 +0000)]
Revise the simplification of regions

The previous code had several problems:

For newly created BasicBlocks it did not (always) call RegionInfo::setRegionFor in order to update its analysis. At the moment RegionInfo does not verify its BBMap, but will in the future. This is fixed by determining the region new BBs belong to and set it accordingly. The new executeScopConditionally() requires accurate getRegionFor information.

Which block is created by SplitEdge depends on the incoming and outgoing edges of the blocks it connects, which makes handling its output more difficult than it needs to be. Especially for finding which block has been created an to assign a region to it for the setRegionFor problem above. This patch uses an implementation for splitEdge that always creates a block between the predecessor and successor. simplifyRegion has also been simplified by using SplitBlockPredecessors instead of SplitEdge. Isolating the entries and exits have been refectored into individual functions.

Previously simplifyRegion did more than just ensuring that there is only one entering and one exiting edge. It ensured that the entering block had no other outgoing edge which was necessary for executeScopConditionally(). Now the latter uses the alternative splitEdge implementation which can handle this situation so simplifyRegion really only needs to simplify the region.

Also, executeScopConditionally assumed that there can be no PHI nodes in blocks with one incoming edge. This is wrong and LCSSA deliberately produces such edges. However, previous passes ensured that there can be no such PHIs in exit nodes, but which will no longer hold in the future.

The new code that the property that it preserves the identity of region block (the property that the memory address of the BasicBlock containing the instructions remains the same; new blocks only contain PHI nodes and a terminator), especially the entry block. As a result, there is no need to update the reference to the BasicBlock of ScopStmt that contain its instructions because they have been moved to other basic blocks.

Reviewers: grosser

Part of Differential Revision: http://reviews.llvm.org/D11867

llvm-svn: 244606

8 years agodelete FIXME comment; it's fixed
Sanjay Patel [Tue, 11 Aug 2015 14:35:29 +0000 (14:35 +0000)]
delete FIXME comment; it's fixed

llvm-svn: 244605

8 years agofix minsize detection: minsize attribute implies optimizing for size
Sanjay Patel [Tue, 11 Aug 2015 14:31:14 +0000 (14:31 +0000)]
fix minsize detection: minsize attribute implies optimizing for size

llvm-svn: 244604

8 years agoadd missing test for machine combiner when optimizing for size
Sanjay Patel [Tue, 11 Aug 2015 14:29:45 +0000 (14:29 +0000)]
add missing test for machine combiner when optimizing for size

The minsize test will be fixed in the next commit.

llvm-svn: 244603

8 years ago1. Disable tests that currently cannot work on windows due to missing path canonicali...
Manuel Klimek [Tue, 11 Aug 2015 14:21:26 +0000 (14:21 +0000)]
1. Disable tests that currently cannot work on windows due to missing path canonicalization in the file manager.
2. Add better output when a clang-tidy unit test fails so it's clear what the error is.

llvm-svn: 244602

8 years ago[X86] Allow merging of immediates within a basic block for code size savings
Michael Kuperstein [Tue, 11 Aug 2015 14:10:58 +0000 (14:10 +0000)]
[X86] Allow merging of immediates within a basic block for code size savings

First step in preventing immediates that occur more than once within a single
basic block from being pulled into their users, in order to prevent unnecessary
large instruction encoding .Currently enabled only when optimizing for size.

Patch by: zia.ansari@intel.com
Differential Revision: http://reviews.llvm.org/D11363

llvm-svn: 244601

8 years agoIntroduce splitBlock and use it in splitEntryBlockForAlloca
Michael Kruse [Tue, 11 Aug 2015 14:04:06 +0000 (14:04 +0000)]
Introduce splitBlock and use it in splitEntryBlockForAlloca

RegionInfo::splitBlock did not update RegionInfo correctly. Specifically, it tried to make the new block the entry block if possible. This breaks for nested regions that have edges to the old block.

We simply do not change the entry block. Updating RegionInfo becomes trivial as both block will always be in the same region.

splitEntryBlockForAlloca makes use of the new splitBlock.

Reviewers: grosser

Part of Differential Revision: http://reviews.llvm.org/D11867

llvm-svn: 244600

8 years agoAlso ClangTidyTests requires clangLex.
NAKAMURA Takumi [Tue, 11 Aug 2015 13:16:51 +0000 (13:16 +0000)]
Also ClangTidyTests requires clangLex.

llvm-svn: 244599

8 years agoFix strict dependency uncovered by windows bot.
Manuel Klimek [Tue, 11 Aug 2015 13:11:29 +0000 (13:11 +0000)]
Fix strict dependency uncovered by windows bot.

llvm-svn: 244598

8 years agoDo not use inheriting constructors.
Manuel Klimek [Tue, 11 Aug 2015 12:59:22 +0000 (12:59 +0000)]
Do not use inheriting constructors.

llvm-svn: 244597

8 years agoDefault initialize from explicitly constructed object.
Manuel Klimek [Tue, 11 Aug 2015 12:13:15 +0000 (12:13 +0000)]
Default initialize from explicitly constructed object.

llvm-svn: 244596

8 years ago[AArch64] Match fminnum/fmaxnum for vector fminnm/fmaxnm instead of an intrinsic.
James Molloy [Tue, 11 Aug 2015 12:06:37 +0000 (12:06 +0000)]
[AArch64] Match fminnum/fmaxnum for vector fminnm/fmaxnm instead of an intrinsic.

Lower Intrinsic::aarch64_neon_fmin/fmax to fminnum/fmannum and match that instead. Minimal functional change:

  - Extra tests added because coverage of scalar fminnm/fmaxnm instructions was nonexistant.
  - f16 test updated because now we actually generate scalar fminnm/fmaxnm we no longer need to bail out to a libcall!

llvm-svn: 244595

8 years ago[AArch64] Replace the custom AArch64ISD::FMIN/MAX nodes with ISD::FMINNAN/MAXNAN
James Molloy [Tue, 11 Aug 2015 12:06:33 +0000 (12:06 +0000)]
[AArch64] Replace the custom AArch64ISD::FMIN/MAX nodes with ISD::FMINNAN/MAXNAN

NFCI. This just removes custom ISDNodes that are no longer needed.

llvm-svn: 244594

8 years ago[ARM] Match fminnan/fmaxnan for vector vmin/vmax instead of an intrinsic
James Molloy [Tue, 11 Aug 2015 12:06:28 +0000 (12:06 +0000)]
[ARM] Match fminnan/fmaxnan for vector vmin/vmax instead of an intrinsic

Lower Intrinsic::arm_neon_vmins/vmaxs to fminnan/fmaxnan and match that instead. This is important because SDAG will soon be able to select FMINNAN itself, so we need a unified lowering path for intrinsics and SDAG.

NFCI.

llvm-svn: 244593

8 years ago[ARM] Match fminnum/fmaxnum for vector vminnm/vmaxnm instead of an intrinsic
James Molloy [Tue, 11 Aug 2015 12:06:25 +0000 (12:06 +0000)]
[ARM] Match fminnum/fmaxnum for vector vminnm/vmaxnm instead of an intrinsic

Lower the intrinsic to a FMINNUM/FMAXNUM node and select that instead. This is important because soon SDAG will be able to select FMINNUM/FMAXNUM itself, so we need an integrated lowering path between SDAG and intrinsics.

NFCI.

llvm-svn: 244592

8 years ago[ARM] Replace ARMISD::VMINNM/VMAXNM with ISD::FMINNUM/FMAXNUM
James Molloy [Tue, 11 Aug 2015 12:06:22 +0000 (12:06 +0000)]
[ARM] Replace ARMISD::VMINNM/VMAXNM with ISD::FMINNUM/FMAXNUM

NFCI. This replaces another custom ISDNode with a generic equivalent.

llvm-svn: 244591

8 years ago[ARM] Replace ARMISD::FMIN/FMAX with the shiny new ISD::FMINNAN/FMAXNAN.
James Molloy [Tue, 11 Aug 2015 12:06:15 +0000 (12:06 +0000)]
[ARM] Replace ARMISD::FMIN/FMAX with the shiny new ISD::FMINNAN/FMAXNAN.

NFCI. This removes a custom ISDNode.

llvm-svn: 244590

8 years agoRevert r244516; it was causing cmake configuration failures on Windows with Visual...
Aaron Ballman [Tue, 11 Aug 2015 12:06:04 +0000 (12:06 +0000)]
Revert r244516; it was causing cmake configuration failures on Windows with Visual Studio.

http://bb.pgr.jp/builders/msbuild-llvmclang-x64-msc18-DA/builds/475

llvm-svn: 244589

8 years ago[X86] Add SAL mnemonics for Intel syntax
Marina Yatsina [Tue, 11 Aug 2015 12:05:06 +0000 (12:05 +0000)]
[X86] Add SAL mnemonics for Intel syntax

SAL and SHL instructions perform the same operation

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

llvm-svn: 244588

8 years agoFix shadowing of type with variable.
Manuel Klimek [Tue, 11 Aug 2015 12:02:28 +0000 (12:02 +0000)]
Fix shadowing of type with variable.

llvm-svn: 244587

8 years agoAdd an IncludeInserter to clang-tidy.
Manuel Klimek [Tue, 11 Aug 2015 11:37:48 +0000 (11:37 +0000)]
Add an IncludeInserter to clang-tidy.

Will be used to allow checks to insert includes at the right position.

llvm-svn: 244586

8 years agoUpdate isl to isl-0.15-117-ge42acfe
Tobias Grosser [Tue, 11 Aug 2015 11:31:18 +0000 (11:31 +0000)]
Update isl to isl-0.15-117-ge42acfe

Besides other changes this version of isl contains a fundamental fix to memory
corruption issues we have seen with imath-32 backed isl_ints.

This update also contains a fix that ensures that the schedule-tree based
version of isl's dependence analysis takes the domain of the schedule into
account.

llvm-svn: 244585

8 years ago[X86] Fix REPE, REPZ, REPNZ for intel syntax
Marina Yatsina [Tue, 11 Aug 2015 11:28:10 +0000 (11:28 +0000)]
[X86] Fix REPE, REPZ, REPNZ for intel syntax

REPE, REPZ, REPNZ, REPNE should have mnemonics for Intel syntax as well.
Currently using these instructions causes compilation errors for Intel syntax.

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

llvm-svn: 244584

8 years agoRevert "[CUDA] Add implicit __attribute__((used)) to all __global__ functions."
Daniel Jasper [Tue, 11 Aug 2015 11:02:09 +0000 (11:02 +0000)]
Revert "[CUDA] Add implicit __attribute__((used)) to all __global__ functions."

This is breaking internal test. I'll provide a reproduction.

llvm-svn: 244583

8 years ago[X86] Fix imul alias for intel syntax
Marina Yatsina [Tue, 11 Aug 2015 10:43:04 +0000 (10:43 +0000)]
[X86] Fix imul alias for intel syntax

The "imul reg, imm" alias is not defined for intel syntax.
In intel syntax there is no w/l/q suffix for the imul instruction.

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

llvm-svn: 244582

8 years agoAdd new ISD nodes: ISD::FMINNAN and ISD::FMAXNAN
James Molloy [Tue, 11 Aug 2015 09:13:05 +0000 (09:13 +0000)]
Add new ISD nodes: ISD::FMINNAN and ISD::FMAXNAN

The intention of these is to be a corollary to ISD::FMINNUM/FMAXNUM,
differing only on how NaNs are treated. FMINNUM returns the non-NaN
input (when given one NaN and one non-NaN), FMINNAN returns the NaN
input instead.

This patch includes support for scalarizing, widening and splitting
vectors, but not expansion or softening. The reason is that these
should never be needed - FMINNAN nodes are only going to be created
in one place (SDAGBuilder::visitSelect) and there we'll check if the
node is legal or custom. I could preemptively add expand and soften
code, but I'm fairly opposed to adding code I can't test. It's bad
enough I can't create tests with this patch, but at least this code
will be exercised by the ARM and AArch64 backends fairly shortly.

llvm-svn: 244581

8 years agoAdd support for floating-point minnum and maxnum
James Molloy [Tue, 11 Aug 2015 09:12:57 +0000 (09:12 +0000)]
Add support for floating-point minnum and maxnum

The select pattern recognition in ValueTracking (as used by InstCombine
and SelectionDAGBuilder) only knew about integer patterns. This teaches
it about minimum and maximum operations.

matchSelectPattern() has been extended to return a struct containing the
existing Flavor and a new enum defining the pattern's behavior when
given one NaN operand.

C minnum() is defined to return the non-NaN operand in this case, but
the idiomatic C "a < b ? a : b" would return the NaN operand.

ARM and AArch64 at least have different instructions for these different cases.

llvm-svn: 244580

8 years ago[mips] Remap move as or.
Vasileios Kalintiris [Tue, 11 Aug 2015 08:56:25 +0000 (08:56 +0000)]
[mips] Remap move as or.

Summary:
This patch remaps the assembly idiom 'move' to 'or' instead of 'daddu' or
'addu'. The use of addu/daddu instead of or as move was highlighted as a
performance issue during the analysis of a recent 64bit design. Originally
move was encoded as 'or' by binutils but was changed for the r10k cpu family
due to their pipeline which had 2 arithmetic units and a single logical unit,
and so could issue multiple (d)addu based moves at the same time but only 1
logical move.

This patch preserves the disassembly behaviour so that disassembling a old style
(d)addu move still appears as move, but assembling move always gives an or

Patch by Simon Dardis.

Reviewers: vkalintiris

Subscribers: llvm-commits

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

llvm-svn: 244579

8 years ago[X86] When optimizing for minsize, use POP for small post-call stack clean-up
Michael Kuperstein [Tue, 11 Aug 2015 08:48:48 +0000 (08:48 +0000)]
[X86] When optimizing for minsize, use POP for small post-call stack clean-up

When optimizing for size, replace "addl $4, %esp" and "addl $8, %esp"
following a call by one or two pops, respectively. We don't try to do it in
general, but only when the stack adjustment immediately follows a call - which
is the most common case.

That allows taking a short-cut when trying to find a free register to pop into,
instead of a full-blown liveness check. If the adjustment immediately follows a
call, then every register the call clobbers but doesn't define should be dead at
that point, and can be used.

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

llvm-svn: 244578

8 years agoAllow PeepholeOptimizer to fold a few more cases
Michael Kuperstein [Tue, 11 Aug 2015 08:19:43 +0000 (08:19 +0000)]
Allow PeepholeOptimizer to fold a few more cases

The condition for clearing the folding candidate list was clamped together
with the "uninteresting instruction" condition. This is too conservative,
e.g. we don't need to clear the list when encountering an IMPLICIT_DEF.

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

llvm-svn: 244577

8 years agoBlockGenerator: Do not store 'store' statements in BBMap
Tobias Grosser [Tue, 11 Aug 2015 08:13:15 +0000 (08:13 +0000)]
BlockGenerator: Do not store 'store' statements in BBMap

A store statement has no return value and can consequently not be referenced
from another statement.

llvm-svn: 244576

8 years ago[GMR] Be a bit smarter about which globals don't alias when doing recursive lookups
Michael Kuperstein [Tue, 11 Aug 2015 08:06:44 +0000 (08:06 +0000)]
[GMR] Be a bit smarter about which globals don't alias when doing recursive lookups

Should hopefully fix the remainder of PR24288.

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

llvm-svn: 244575

8 years ago[RuntimeDyld][AArch64] Add explicit addends before calling relocationValueRef.
Lang Hames [Tue, 11 Aug 2015 06:27:53 +0000 (06:27 +0000)]
[RuntimeDyld][AArch64] Add explicit addends before calling relocationValueRef.

relocationValueRef uses the addend, so it has to be set before the call.

llvm-svn: 244574

8 years agoAdd size field to library load event (MI)
Ilia K [Tue, 11 Aug 2015 06:07:14 +0000 (06:07 +0000)]
Add size field to library load event (MI)

Summary:
(This revision supersedes the abandon: http://reviews.llvm.org/D9716)
Size field is used to let the debugger attribute an address to a specific library when symbols are not available.
For example:
OpenGLESApp4.app!Cube_draw() Line 74 C
  OpenGLESApp4.app!-[GameViewController glkView:drawInRect:](GameViewController * self, SEL _cmd, GLKView * view, CGRect rect) Line 89 C++
  GLKit!<redacted>
  QuartzCore!<redacted>
  QuartzCore!<redacted>
  QuartzCore!<redacted>
  QuartzCore!<redacted>
  QuartzCore!<redacted>
  UIKit!<redacted>
  UIKit!<redacted>
  UIKit!<redacted>
  UIKit!<redacted>
  FrontBoardServices!<redacted>
  CoreFoundation!<redacted>

Patch from paulmay@microsoft.com

Reviewers: ChuckR, abidh, ki.stfu

Subscribers: greggm, lldb-commits

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

llvm-svn: 244573

8 years agoEnable five passing dsymutil tests on Windows.
Yaron Keren [Tue, 11 Aug 2015 06:05:27 +0000 (06:05 +0000)]
Enable five passing dsymutil tests on Windows.
These tests pass with Windows 7 x64 + MSYS2. I'll see if the bots like
them as well and disable the failing ones.

llvm-svn: 244572