Commit Graph

120637 Commits

Author SHA1 Message Date
David Blaikie
b0e0513b4d Fix UB in MCJIT test cases that relied on union type punning
Reviewers: lhames, aaron.ballman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244644 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 18:17:45 +00:00
Justin Bogner
e7e85970eb 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244643 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 18:17:41 +00:00
Chen Li
a0180252f1 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244642 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 18:12:26 +00:00
Rafael Espindola
2f3b47dd61 Use llvm::make_unique to fix the MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244641 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 18:11:17 +00:00
Yaron Keren
539661280d Add SmallString test trying to exercise the realloc() code path
by allocating a small size (will go through malloc) and then large size.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244637 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 17:35:49 +00:00
Reid Kleckner
a5ccfee275 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 17:16:35 +00:00
Sanjay Patel
7654f4c286 fix minsize detection: minsize attribute implies optimizing for size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244631 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 17:04:31 +00:00
Sanjay Patel
ea93eb6cce add missing tests for powi expansion with size optimizations
The minsize test will be fixed in the next commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244630 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 16:58:49 +00:00
Sanjay Patel
c39559f05b fixed to use FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244627 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 16:51:31 +00:00
Sanjay Patel
6f795bacb5 fixed to test attribute, rather than CPU
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244625 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 16:43:18 +00:00
Teresa Johnson
84ee0a2845 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244622 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 16:26:41 +00:00
Rafael Espindola
b4a4468d7b Revert "Add non-member begin and end so that drop_begin works on iterator_range."
This reverts commit r244620.

MSVC doesn't like it :-(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244621 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 16:26:06 +00:00
Rafael Espindola
a09a71fcea Add non-member begin and end so that drop_begin works on iterator_range.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244620 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 16:12:56 +00:00
Sanjay Patel
3e1a54cbec fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244619 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 16:10:41 +00:00
Sanjay Patel
cfaf02b2c7 Variable names should start with an upper case letter; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244618 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 16:05:43 +00:00
Sanjay Patel
eb2a123242 fix minsize detection: minsize attribute implies optimizing for size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244617 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 15:56:31 +00:00
John Brawn
67404cfbc0 [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244615 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 15:48:04 +00:00
Mehdi Amini
d50888216b 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>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244613 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 15:31:17 +00:00
Sanjay Patel
1df36a4e70 remove unnecessary settings/attributes from test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244612 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 15:30:53 +00:00
Michael Kruse
58cee9e869 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244611 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 15:16:43 +00:00
Sanjay Patel
082a39c1fa fix code that was accidentally commented out in previous commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244610 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 15:08:29 +00:00
Sanjay Patel
0044cc3592 fix typos in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244609 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 15:04:51 +00:00
Sanjay Patel
d6a2d8f5d0 fix typo in comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244607 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 14:45:08 +00:00
Sanjay Patel
515c7f9291 delete FIXME comment; it's fixed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244605 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 14:35:29 +00:00
Sanjay Patel
b15598e99a fix minsize detection: minsize attribute implies optimizing for size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244604 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 14:31:14 +00:00
Sanjay Patel
0c91ac75d1 add missing test for machine combiner when optimizing for size
The minsize test will be fixed in the next commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244603 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 14:29:45 +00:00
Michael Kuperstein
f7e5a53c7d [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244601 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 14:10:58 +00:00
James Molloy
3b4cd46ad5 [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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244595 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 12:06:37 +00:00
James Molloy
42fd74f775 [AArch64] Replace the custom AArch64ISD::FMIN/MAX nodes with ISD::FMINNAN/MAXNAN
NFCI. This just removes custom ISDNodes that are no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244594 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 12:06:33 +00:00
James Molloy
7b49489409 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244593 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 12:06:28 +00:00
James Molloy
8b081412aa [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244592 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 12:06:25 +00:00
James Molloy
aed86035a5 [ARM] Replace ARMISD::VMINNM/VMAXNM with ISD::FMINNUM/FMAXNUM
NFCI. This replaces another custom ISDNode with a generic equivalent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244591 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 12:06:22 +00:00
James Molloy
17ec8cc90a [ARM] Replace ARMISD::FMIN/FMAX with the shiny new ISD::FMINNAN/FMAXNAN.
NFCI. This removes a custom ISDNode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244590 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 12:06:15 +00:00
Aaron Ballman
ece40fd6d5 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244589 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 12:06:04 +00:00
Marina Yatsina
5a0390f3ad [X86] Add SAL mnemonics for Intel syntax
SAL and SHL instructions perform the same operation

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244588 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 12:05:06 +00:00
Marina Yatsina
f815c87d9b [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244584 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 11:28:10 +00:00
Marina Yatsina
b54962b9a0 [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244582 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 10:43:04 +00:00
James Molloy
bee32461e9 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244581 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 09:13:05 +00:00
James Molloy
cd45f4f580 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244580 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 09:12:57 +00:00
Vasileios Kalintiris
e7b9d6cf45 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244579 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 08:56:25 +00:00
Michael Kuperstein
18913db07a [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244578 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 08:48:48 +00:00
Michael Kuperstein
fdc5012e06 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244577 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 08:19:43 +00:00
Michael Kuperstein
ea7c99472d [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244575 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 08:06:44 +00:00
Lang Hames
f52c83762e [RuntimeDyld][AArch64] Add explicit addends before calling relocationValueRef.
relocationValueRef uses the addend, so it has to be set before the call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244574 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 06:27:53 +00:00
Yaron Keren
1cca7d1ed6 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244572 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 06:05:27 +00:00
Nick Lewycky
eacc53d67e Fix unused variable 'X' in release builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244571 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 05:57:10 +00:00
JF Bastien
624a11dc4f WebAssembly: NFC fix release build break, unused variable.
Summary: Caused by D11914, pointed out by blaikie.

Subscribers: llvm-commits, jfb, dblaikie

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244570 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 04:52:24 +00:00
Kostya Serebryany
ddbe8126b1 [libFuzzer] fix docs build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244566 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 04:16:37 +00:00
David Majnemer
106f7b5a04 [IR] Verify EH pad predecessors
Make sure that an EH pad's predecessors are using their unwind edge to
transfer control to the EH pad.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244563 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 02:48:30 +00:00
JF Bastien
3c7c622c22 WebAssembly: add basic floating-point tests
Summary: I somehow forgot to add these when I added the basic floating-point opcodes. Also remove ceil/floor/trunc/nearestint for now, and add them only when properly tested.

Subscribers: llvm-commits, sunfish, jfb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244562 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 02:45:15 +00:00