Aaron Ballman [Wed, 12 Aug 2015 21:10:41 +0000 (21:10 +0000)]
Move the object being used to move-initialize when calling the base class' constructor from the ctor-initializer. This should have no effect given the triviality of the class, but it allows for easier maintenance should the semantics of the base class change. NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244812
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 12 Aug 2015 21:00:22 +0000 (21:00 +0000)]
MIR Serialization: Serialize the GOT pseudo source values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244809
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Wed, 12 Aug 2015 21:00:20 +0000 (21:00 +0000)]
[RewriteStatepointsForGC] Handle extractelement fully in the base pointer algorithm
When rewriting the IR such that base pointers are available for every live pointer, we potentially need to duplicate instructions to propagate the base. The original code had only handled PHI and Select under the belief those were the only instructions which would need duplicated. When I added support for vector instructions, I'd added a collection of hacks for ExtractElement which caught most of the common cases. Of course, I then found the one test case my hacks couldn't cover. :)
This change removes all of the early hacks for extract element. By defining extractelement as a BDV (rather than trying to look through it), we can extend the rewriting algorithm to duplicate the extract as needed. Note that a couple of peephole optimizations were left in for the moment, because while we now handle extractelement as a first class citizen, we're not yet handling insertelement. That change will follow in the near future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244808
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 12 Aug 2015 20:44:16 +0000 (20:44 +0000)]
MIR Serialization: Serialize the stack pseudo source values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244806
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 12 Aug 2015 20:36:18 +0000 (20:36 +0000)]
fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244805
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 12 Aug 2015 20:34:40 +0000 (20:34 +0000)]
Update a comment; Emscripten no longer uses le32 and le64. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244804
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 12 Aug 2015 20:33:26 +0000 (20:33 +0000)]
MIR Serialization: Serialize the constant pool pseudo source values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244803
91177308-0d34-0410-b5e6-
96231b3b80d8
Lenny Maiorani [Wed, 12 Aug 2015 20:00:10 +0000 (20:00 +0000)]
Fix missing space in libfuzzer's help text.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244800
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 12 Aug 2015 18:27:23 +0000 (18:27 +0000)]
Docs: keep copyright years up-to-date.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244789
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 12 Aug 2015 18:10:45 +0000 (18:10 +0000)]
[PM/AA] Add missing static dependency edges from DSE and memdep to TLI.
I forgot to add these in r244780 and r244778. Sorry about that.
Also order the static dependencies in a lexicographical order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244787
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 12 Aug 2015 18:06:08 +0000 (18:06 +0000)]
[PM/AA] Explicitly depend on TLI rather than getting it out of the
AliasAnalysis.
Same as the other commits, the TLI access from an alias analysis is
going away and isn't very clean -- it is better to explicitly mark the
dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244785
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 12 Aug 2015 18:01:44 +0000 (18:01 +0000)]
[PM/AA] Stop getting the TargetLibraryInfo out of the AliasAnalysis and
just depend on it directly.
This was particularly frustrating because there was a really wide
mixture of using a member variable and re-extracting it from the AA that
happened to be around. I think the result is much more clear.
I've also deleted all of the pointless null checks and used references
across the APIs where I could to make it explicit that this cannot be
null in a useful fashion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244780
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 12 Aug 2015 17:53:29 +0000 (17:53 +0000)]
WebAssembly: floating-point comparisons
Summary:
D11924 implemented part of the floating-point comparisons, this patch implements the rest:
* Tell ISelLowering that all booleans are either 0 or 1.
* Expand the eq/ne/lt/le/gt/ge floating-point comparisons to the canonical ones (similar to what Mips32r6InstrInfo.td does).
* Add tests for ord/uno.
* Add tests for ueq/one/ult/ule/ugt/uge.
* Fix existing comparison tests to remove the (res & 1) code, which setBooleanContents stops from generating.
Reviewers: sunfish
Subscribers: llvm-commits, jfb
Differential Revision: http://reviews.llvm.org/D11970
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244779
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 12 Aug 2015 17:47:44 +0000 (17:47 +0000)]
[PM/AA] Have memdep explicitly get and use TargetLibraryInfo rather than
relying on sneaking it out of its AliasAnalysis.
This abuse of AA (to shuffle TLI around rather than explicitly depending
on it) is going away with my refactor of AA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244778
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 12 Aug 2015 17:09:25 +0000 (17:09 +0000)]
Use /Zc:inline when building with MSVC.
This reduces the total .obj size when building llvm from
496,690,342 to 219,334,936 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244767
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 12 Aug 2015 17:00:50 +0000 (17:00 +0000)]
Cleaned up test. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244765
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 12 Aug 2015 16:51:19 +0000 (16:51 +0000)]
[LoopVer] Optionally allow using memchecks from LAA
r243382 changed the behavior to always require a set of memchecks to be
passed to LoopVer. This change restores the prior behavior as an
alternative to the new behavior. This allows the checks to be
implicitly taken from the LAA object.
Patch by Ashutosh Nema!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244763
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 12 Aug 2015 15:12:25 +0000 (15:12 +0000)]
80-cols; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244755
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Wed, 12 Aug 2015 15:11:43 +0000 (15:11 +0000)]
[ValueTracking] Tweak a comment slightly
Hal asked for this change in D11146, but I missed it when I committed originally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244754
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 12 Aug 2015 15:09:09 +0000 (15:09 +0000)]
fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244753
91177308-0d34-0410-b5e6-
96231b3b80d8
John Brawn [Wed, 12 Aug 2015 15:05:39 +0000 (15:05 +0000)]
Redo "Make global aliases have symbol size equal to their type"
r242520 was reverted in r244313 as the expected behaviour of the alias
attribute in C is that the alias has the same size as the aliasee. However
we can re-introduce adding the size on the alias when the aliasee does not,
from a source code or object perspective, exist as a discrete entity. This
happens when the aliasee is not a symbol, or when that symbol is private.
Differential Revision: http://reviews.llvm.org/D11943
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244752
91177308-0d34-0410-b5e6-
96231b3b80d8
John Brawn [Wed, 12 Aug 2015 13:36:48 +0000 (13:36 +0000)]
[GlobalMerge] Only emit aliases for internal linkage variables for non-Mach-O
On Mach-O emitting aliases for the variables that make up a MergedGlobals
variable can cause problems when linking with dead stripping enabled so don't
do that, except for external variables where we must emit an alias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244748
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Wed, 12 Aug 2015 12:45:16 +0000 (12:45 +0000)]
[mips][microMIPS] Create microMIPS64r6 subtarget and implement DALIGN, DAUI, DAHI, DATI, DEXT, DEXTM and DEXTU instructions
Differential Revision: http://reviews.llvm.org/D10923
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244744
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Wed, 12 Aug 2015 11:27:26 +0000 (11:27 +0000)]
[X86] Disable mul -> shl + lea combine when compiling for minsize
Differential Revision: http://reviews.llvm.org/D11904
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244740
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 12 Aug 2015 10:36:16 +0000 (10:36 +0000)]
[MC] Convert the last test using macho-dump under X86/ to llvm-readobj.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244732
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Wed, 12 Aug 2015 10:14:58 +0000 (10:14 +0000)]
[X86] Allow x86 call frame optimization to fold more loads into pushes
This abstracts away the test for "when can we fold across a MachineInstruction"
into the the MI interface, and changes call-frame optimization use the same test
the peephole optimizer users.
Differential Revision: http://reviews.llvm.org/D11945
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244729
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 12 Aug 2015 09:04:44 +0000 (09:04 +0000)]
AMDGPU: Fix assert on dbg_value instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244728
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 12 Aug 2015 08:23:36 +0000 (08:23 +0000)]
unused variable warning fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244725
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 12 Aug 2015 08:08:56 +0000 (08:08 +0000)]
[InstCombine] Move SSE/AVX vector blend folding to instcombiner
As discussed in D11886, this patch moves the SSE/AVX vector blend folding to instcombiner from PerformINTRINSIC_WO_CHAINCombine (which allows us to remove this completely).
InstCombiner already had partial support for this, I just had to add support for zero (ConstantAggregateZero) masks and also the case where both selection inputs were the same (allowing us to ignore the mask).
I also moved all the relevant combine tests into InstCombine/blend_x86.ll
Differential Revision: http://reviews.llvm.org/D11934
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244723
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 12 Aug 2015 06:43:10 +0000 (06:43 +0000)]
[TableGen] Remove unused constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244718
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 12 Aug 2015 02:01:36 +0000 (02:01 +0000)]
X86: hoist a condition into a variable (NFC)
The same value is used multiple times through the function. Hoist the condition
into a variable. This should fix a silly static analysis warning where the
conditions flip around. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244713
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 12 Aug 2015 01:55:37 +0000 (01:55 +0000)]
[libFuzzer] add two flags, -tbm_depth and -tbm_width to control how the trace-based-mutations are applied
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244712
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 12 Aug 2015 01:04:27 +0000 (01:04 +0000)]
[libFuzzer] add colons to the stats output to avoid confusion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244708
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 12 Aug 2015 00:55:09 +0000 (00:55 +0000)]
[libFuzzer] use raw C IO to reduce the risk of a deadlock in a signal handler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244707
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 12 Aug 2015 00:29:10 +0000 (00:29 +0000)]
[x86] enable machine combiner reassociations for 256-bit vector FP mul/add
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244705
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 12 Aug 2015 00:21:59 +0000 (00:21 +0000)]
[LoopDist] Add test for missing coverage
Add a testcase to ensure that if we can't find bounds for a necessary
memcheck we don't distribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244703
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 11 Aug 2015 23:23:17 +0000 (23:23 +0000)]
PseudoSourceValue: Transform the mips subclass to target independent subclasses
This commit transforms the mips-specific 'MipsCallEntry' subclass of the
'PseudoSourceValue' class into two, target-independent subclasses named
'GlobalValuePseudoSourceValue' and 'ExternalSymbolPseudoSourceValue'.
This change makes it easier to serialize the pseudo source values by removing
target-specific pseudo source values.
Reviewers: Akira Hatanaka
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244698
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 11 Aug 2015 23:09:45 +0000 (23:09 +0000)]
PseudoSourceValue: Replace global manager with a manager in a machine function.
This commit removes the global manager variable which is responsible for
storing and allocating pseudo source values and instead it introduces a new
manager class named 'PseudoSourceValueManager'. Machine functions now own an
instance of the pseudo source value manager class.
This commit also modifies the 'get...' methods in the 'MachinePointerInfo'
class to construct pseudo source values using the instance of the pseudo
source value manager object from the machine function.
This commit updates calls to the 'get...' methods from the 'MachinePointerInfo'
class in a lot of different files because those calls now need to pass in a
reference to a machine function to those methods.
This change will make it easier to serialize pseudo source values as it will
enable me to transform the mips specific MipsCallEntry PseudoSourceValue
subclass into two target independent subclasses.
Reviewers: Akira Hatanaka
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244693
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 11 Aug 2015 23:03:09 +0000 (23:03 +0000)]
[LAA] Fix typo in test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244690
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 11 Aug 2015 22:32:00 +0000 (22:32 +0000)]
PseudoSourceValue: Introduce a 'PSVKind' enumerator.
This commit introduces a new enumerator named 'PSVKind' in the
'PseudoSourceValue' class. This enumerator is now used to distinguish between
the various kinds of pseudo source values.
This change is done in preparation for the changes to the pseudo source value
object management and to the PseudoSourceValue's class hierarchy - the next two
PseudoSourceValue commits will get rid of the global variable that manages the
pseudo source values and the mips specific MipsCallEntry subclass.
Reviewers: Akira Hatanaka
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244687
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 11 Aug 2015 22:23:19 +0000 (22:23 +0000)]
PseudoSourceValue: Update comments and fix lowercase variable names. NFC.
This commit updates the documentation comments in PseudoSourceValue.cpp and
PseudoSourceValue.h based on the LLVM's documentation style. It also fixes
several instances of variable names that started with a lowercase letter.
This change is done in preparation for the changes to the pseudo source value
object management and to the PseudoSourceValue's class hierarchy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244686
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 11 Aug 2015 22:17:22 +0000 (22:17 +0000)]
Reformat PseudoSourceValue.cpp and PseudoSourceValue.h. NFC.
This commit reformats the files lib/CodeGen/PseudoSourceValue.cpp and
include/llvm/CodeGen/PseudoSourceValue.h using clang-format. This change is
done in preparation for the changes to the pseudo source value object
management and to the PseudoSourceValue's class hierarchy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244685
91177308-0d34-0410-b5e6-
96231b3b80d8
Mark Heffernan [Tue, 11 Aug 2015 22:16:34 +0000 (22:16 +0000)]
Use 32-bit divides instead of 64-bit divides where possible.
For NVPTX, try to use 32-bit division instead of 64-bit division when the dividend and divisor
fit in 32 bits. This speeds up some internal benchmarks significantly. The underlying reason
is that many index computations are carried out in 64-bits but never actually exceed the
capacity of a 32-bit word.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244684
91177308-0d34-0410-b5e6-
96231b3b80d8
Paul Robinson [Tue, 11 Aug 2015 21:36:45 +0000 (21:36 +0000)]
Make DW_AT_[MIPS_]linkage_name optional, and off by default for SCE.
Mangled "linkage" names can be huge, and if the debugger (or other
tools) have no use for them, the size savings can be very impressive
(on the order of 40%).
Add one test for controlling behavior, and modify a number of tests to
either stop using linkage names, or make llc emit them (so these tests
will still run when the default triple is for PS4).
Differential Revision: http://reviews.llvm.org/D11374
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244678
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 11 Aug 2015 21:33:55 +0000 (21:33 +0000)]
Fix PR24354.
`InstCombiner::OptimizeOverflowCheck` was asserting an
invariant (operands to binary operations are ordered by decreasing
complexity) that wasn't really an invariant. Fix this by instead having
`InstCombiner::OptimizeOverflowCheck` establish the invariant if it does
not hold.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244676
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244674
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 11 Aug 2015 21:24:04 +0000 (21:24 +0000)]
don't repeat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244672
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 11 Aug 2015 21:11:56 +0000 (21:11 +0000)]
fix 80-cols; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244668
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244667
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244665
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Tue, 11 Aug 2015 20:34:48 +0000 (20:34 +0000)]
[libFuzzer] more trophies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244661
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 11 Aug 2015 20:28:28 +0000 (20:28 +0000)]
[cmake] Shorten FreeBSD and DragonFly checks as suggested post-commit
NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244659
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244657
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244656
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244655
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244651
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244649
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244648
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244644
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244643
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244642
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 11 Aug 2015 18:11:17 +0000 (18:11 +0000)]
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
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244637
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244633
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 11 Aug 2015 17:04:31 +0000 (17:04 +0000)]
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
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244630
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 11 Aug 2015 16:51:31 +0000 (16:51 +0000)]
fixed to use FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244627
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 11 Aug 2015 16:43:18 +0000 (16:43 +0000)]
fixed to test attribute, rather than CPU
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244625
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244622
91177308-0d34-0410-b5e6-
96231b3b80d8
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 :-(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244621
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244620
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 11 Aug 2015 16:10:41 +0000 (16:10 +0000)]
fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244619
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 11 Aug 2015 16:05:43 +0000 (16:05 +0000)]
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
Sanjay Patel [Tue, 11 Aug 2015 15:56:31 +0000 (15:56 +0000)]
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
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244615
91177308-0d34-0410-b5e6-
96231b3b80d8
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>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244613
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 11 Aug 2015 15:30:53 +0000 (15:30 +0000)]
remove unnecessary settings/attributes from test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244612
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244611
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 11 Aug 2015 15:08:29 +0000 (15:08 +0000)]
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
Sanjay Patel [Tue, 11 Aug 2015 15:04:51 +0000 (15:04 +0000)]
fix typos in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244609
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 11 Aug 2015 14:45:08 +0000 (14:45 +0000)]
fix typo in comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244607
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 11 Aug 2015 14:35:29 +0000 (14:35 +0000)]
delete FIXME comment; it's fixed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244605
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 11 Aug 2015 14:31:14 +0000 (14:31 +0000)]
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
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244603
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244601
91177308-0d34-0410-b5e6-
96231b3b80d8
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!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244595
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244594
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244593
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244592
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244591
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244590
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244589
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244588
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244584
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244582
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244581
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244580
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244579
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244578
91177308-0d34-0410-b5e6-
96231b3b80d8
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244577
91177308-0d34-0410-b5e6-
96231b3b80d8