Diego Novillo [Wed, 26 Aug 2015 20:00:27 +0000 (20:00 +0000)]
Fix memory leak in sample profile pass.
The problem here were the function analyses invoked by the function pass
manager from the new IPO pass. I looked at other IPO passes needing
dominance information and the only one that requires it (partial
inliner) does not use the standard dependency mechanism.
This patch mimics what the partial inliner does to compute dominance,
post-dominance and loop info. One thing I like about this approach is
that I can delay the computation of all this until I actually need it.
This should bring the ASAN buildbot back to green. If there's a better
way to fix this, I'll do it in a follow-up patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246066
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 26 Aug 2015 19:24:59 +0000 (19:24 +0000)]
Revert "Fix LLVM C API for DataLayout"
This reverts commit r246052.
Third attempt, still unpleasant for some bots.
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246057
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 26 Aug 2015 19:12:03 +0000 (19:12 +0000)]
AMDGPU/SI: Report SIFixSGPRLiveRanges changed function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246056
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 26 Aug 2015 18:56:01 +0000 (18:56 +0000)]
Fix LLVM C API for DataLayout
We removed access to the DataLayout on the TargetMachine and
deprecated the C API function LLVMGetTargetMachineData() in r243114.
However the way I tried to be backward compatible was broken: I
changed the wrapper of the TargetMachine to be a structure that
includes the DataLayout as well. However the TargetMachine is also
wrapped by the ExecutionEngine, in the more classic way. A client
using the TargetMachine wrapped by the ExecutionEngine and trying
to get the DataLayout would break.
It seems tricky to solve the problem completely in the C API
implementation. This patch tries to address this backward
compatibility in a more lighter way in the C++ API. The C API is
restored in its original state and the removed C++ API is
reintroduced, but privately. The C API is friended to the
TargetMachine and should be the only consumer for this API.
Reviewers: ributzka
Differential Revision: http://reviews.llvm.org/D12263
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246052
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 26 Aug 2015 18:54:50 +0000 (18:54 +0000)]
AMDGPU: Make sure to reserve super registers
I think this could potentially have broken if
one of the super registers were allocated
that contain v254/v255.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246051
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 26 Aug 2015 18:37:59 +0000 (18:37 +0000)]
Revert "Fix LLVM C API for DataLayout"
This reverts commit r246044.
Build broken, still. It builds for me...
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246049
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 26 Aug 2015 18:37:13 +0000 (18:37 +0000)]
AMDGPU: Produce error on dynamic_stackalloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246048
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 26 Aug 2015 18:30:16 +0000 (18:30 +0000)]
[SimplifyLibCalls] Fix a typo
cbrt(sqrt(x)) calculates the sixth root, not the ninth root.
cbrt(cbrt(x)) calculates the ninth root.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246046
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 26 Aug 2015 18:22:34 +0000 (18:22 +0000)]
Fix LLVM C API for DataLayout
We removed access to the DataLayout on the TargetMachine and
deprecated the C API function LLVMGetTargetMachineData() in r243114.
However the way I tried to be backward compatible was broken: I
changed the wrapper of the TargetMachine to be a structure that
includes the DataLayout as well. However the TargetMachine is also
wrapped by the ExecutionEngine, in the more classic way. A client
using the TargetMachine wrapped by the ExecutionEngine and trying
to get the DataLayout would break.
It seems tricky to solve the problem completely in the C API
implementation. This patch tries to address this backward
compatibility in a more lighter way in the C++ API. The C API is
restored in its original state and the removed C++ API is
reintroduced, but privately. The C API is friended to the
TargetMachine and should be the only consumer for this API.
Reviewers: ributzka
Differential Revision: http://reviews.llvm.org/D12263
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246044
91177308-0d34-0410-b5e6-
96231b3b80d8
James Y Knight [Wed, 26 Aug 2015 17:57:51 +0000 (17:57 +0000)]
[SPARC] Fix stupid oversight in stack realignment support.
If you're going to realign %sp to get object alignment properly (which
the code does), and stack offsets and alignments are calculated going
down from %fp (which they are), then the total stack size had better
be a multiple of the alignment. LLVM did indeed ensure that.
And then, after aligning, the sparc frame code added 96 (for sparcv8)
to the frame size, making any requested alignment of 64-bytes or
higher *guaranteed* to be misaligned. The test case added with r245668
even tests this exact scenario, and asserted the incorrect behavior,
which I somehow failed to notice. D'oh.
This change fixes the frame lowering code to align the stack size
*after* adding the spill area, instead.
Differential Revision: http://reviews.llvm.org/D12349
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246042
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Wed, 26 Aug 2015 17:25:36 +0000 (17:25 +0000)]
[docs][Statepoint] Add definitions for base and derived pointers
This section will be expanded over the next few days. This is just some initial content.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246041
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Wed, 26 Aug 2015 16:20:29 +0000 (16:20 +0000)]
[llvm-mc] Ignore opcode size prefix in 64-bit CALL disassembly
This is a fix for disassembling unusual instruction sequences in 64-bit
mode w.r.t the CALL rel16 instruction. It might be desirable to move the
check somewhere else, but it essentially mimics the special case
handling with JCXZ in 16-bit mode.
The current behavior accepts the opcode size prefix and causes the
call's immediate to stop disassembling after 2 bytes. When debugging
sequences of instructions with this pattern, the disassembler output
becomes extremely unreliable and essentially useless (if you jump midway
into what lldb thinks is a unified instruction, you'll lose %rip). So we
ignore the prefix and consume all 4 bytes when disassembling a 64-bit
mode binary.
Note: in Vol. 2A 3-99 the Intel spec states that CALL rel16 is N.S. N.S.
is defined as:
Indicates an instruction syntax that requires an address override
prefix in 64-bit mode and is not supported. Using an address
override prefix in 64-bit mode may result in model-specific
execution behavior. (Vol. 2A 3-7)
Since 0x66 is an operand override prefix we should be OK (although we
may want to warn about 0x67 prefixes to 0xe8). On the CPUs I tested
with, they all ignore the 0x66 prefix in 64-bit mode.
Patch by Matthew Barney!
Differential Revision: http://reviews.llvm.org/D9573
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246038
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 26 Aug 2015 13:39:48 +0000 (13:39 +0000)]
[AArch64] Remove a use-after-free when collecting stats.
The call to mergePairedInsns() deletes MI, so the later use by isUnscaledLdSt()
is referencing freed memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246033
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 26 Aug 2015 12:26:11 +0000 (12:26 +0000)]
[llvm-objdump] Use the new MinVersion API introduced in r245938. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246031
91177308-0d34-0410-b5e6-
96231b3b80d8
Silviu Baranga [Wed, 26 Aug 2015 11:11:14 +0000 (11:11 +0000)]
[AArch64] Unify the integer min/max vector selection patterns with the intrinsic ones
Summary:
This change lowers the aarch64 integer vector min/max intrinsic nodes to
generic min/max nodes and replaces the intrinsic selection patterns with
the generic ones.
There should already be testing in place for this, so no further tests
were added.
Reviewers: jmolloy
Subscribers: aemerson, llvm-commits, rengolin
Differential Revision: http://reviews.llvm.org/D12276
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246030
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 26 Aug 2015 09:09:29 +0000 (09:09 +0000)]
[SROA] Rip out all support for SSAUpdater in SROA.
This was only added to preserve the old ScalarRepl's use of SSAUpdater
which was originally to avoid use of dominance frontiers. Now, we only
need a domtree, and we'll need a domtree right after this pass as well
and so it makes perfect sense to always and only use the dom-tree
powered mem2reg. This was flag-flipper earlier and has stuck reasonably
so I wanted to gut the now-dead code out of SROA before we waste more
time with it. Among other things, this will make passmanager porting
easier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246028
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 26 Aug 2015 08:05:55 +0000 (08:05 +0000)]
Kaleidoscope: Update libdeps corresponding to r246002.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246025
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 26 Aug 2015 06:41:57 +0000 (06:41 +0000)]
Revert "[dsymutil] Emit real dSYM companion binaries."
This reverts commit r246012.
Some bots do not like it (mips/s390).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246019
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Rosenberg [Wed, 26 Aug 2015 06:11:41 +0000 (06:11 +0000)]
Modernize with range-based for loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246018
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Rosenberg [Wed, 26 Aug 2015 06:11:38 +0000 (06:11 +0000)]
Reduce code duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246017
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Rosenberg [Wed, 26 Aug 2015 06:11:36 +0000 (06:11 +0000)]
Trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246016
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 26 Aug 2015 05:10:04 +0000 (05:10 +0000)]
[dsymutil] Emit real dSYM companion binaries.
The binaries containing the linked DWARF generated by dsymutil are not
standard relocatable object files like emitted did previsously. They should be
dSYM companion files, which means they have a different file type in the
header, but also a couple other peculiarities:
- they contain the segments and sections from the original binary in their
load commands, but not the actual contents. This means they get an address
and a size, but their offset is always 0 (but these are not virtual sections)
- they also conatin all the defined symbols from the original binary
This makes MC a really bad fit to emit these kind of binaries. The approach
that was used in this patch is to leverage MC's section layout for the
debug sections, but to use a replacement for MachObjectWriter that lives
in MachOUtils.cpp. Some of the low-level helpers from MachObjectWriter
were reused too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246012
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 26 Aug 2015 05:09:59 +0000 (05:09 +0000)]
[dsymutil] Store an optional BinaryPath in the debug map.
llvm-dsymutil needs to emit dSYM companion bundles. These are binary files
that replicate some of the orignal binary file properties (sections and
symbols). To get acces to these properties, pass the binary path in the
debug map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246011
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 26 Aug 2015 05:09:55 +0000 (05:09 +0000)]
[dsymutil] Make the warn and error helpers globally available. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246010
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 26 Aug 2015 05:09:52 +0000 (05:09 +0000)]
[dsymutil] Split NonRelocatableStringPool into its own file. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246009
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 26 Aug 2015 05:09:49 +0000 (05:09 +0000)]
[MC] Split the layout part of MCAssembler::finish() into its own method. NFC.
Split a MCAssembler::layout() method out of MCAssembler::finish(). This allows
running the MCSections layout separately from the streaming of the output
file. This way if a client wants to use MC to generate section contents, but
emit something different than the standard relocatable object files it is
possible (llvm-dsymutil is such a client).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246008
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 26 Aug 2015 05:09:46 +0000 (05:09 +0000)]
[MC/MachO] Make some MachObjectWriter methods more generic. NFC.
Hardcode less values in some mach-o header writing routines and pass them
as argument. Doing so will allow reusing this code in llvm-dsymutil.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246007
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 26 Aug 2015 03:07:41 +0000 (03:07 +0000)]
Big Kaleidoscope tutorial update.
This commit switches the underlying JIT for the Kaleidoscope tutorials from
MCJIT to a custom ORC-based JIT, KaleidoscopeJIT. This fixes a lot of the bugs
in Kaleidoscope that were introduced when we deleted the legacy JIT. The
documentation for Chapter 4, which introduces the JIT APIs, is updated to
reflect the change.
Also included are a number of C++11 modernizations and general cleanup. Where
appropriate, the docs have been updated to reflect these changes too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246002
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 26 Aug 2015 03:02:58 +0000 (03:02 +0000)]
Comparing operands should not require the same ValueID
Summary: When comparing basic blocks, there is an additional check that two Value*'s should have the same ID, which interferes with merging equivalent constants of different kinds (such as a ConstantInt and a ConstantPointerNull in the included testcase). The cmpValues function already ensures that the two values in each function are the same, so removing this check should not cause incorrect merging.
Also, the type comparison is redundant, based on reviewing the code and testing on the test suite and several large LTO bitcodes.
Author: jrkoenig
Reviewers: nlewycky, jfb, dschuff
Subscribers: llvm-commits
Differential revision: http://reviews.llvm.org/D12302
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246001
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 26 Aug 2015 02:32:45 +0000 (02:32 +0000)]
Expose more properties of llvm::fltSemantics
Summary: Adds accessor functions for all the fields in llvm::fltSemantics. This will be used in MergeFunctions to order two APFloats with different semanatics.
Author: jrkoenig
Reviewers: jfb
Subscribers: dschuff, llvm-commits
Differential revision: http://reviews.llvm.org/D12253
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245999
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 26 Aug 2015 01:55:47 +0000 (01:55 +0000)]
FastISel: Use finishCondBranch() for ARM,Mips,PowerPC FastISel
Note that after this change branch probabilities are preserved now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245998
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 26 Aug 2015 01:38:00 +0000 (01:38 +0000)]
FastISel: Factor out common code; NFC intended
This should be no functional change but for the record: For three cases
in X86FastISel this will change the order in which the FalseMBB and
TrueMBB of a conditional branch is addedd to the successor/predecessor
lists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245997
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 26 Aug 2015 00:50:49 +0000 (00:50 +0000)]
WebAssembly: add small FIXME for AsmPrinter.
Suggested by @sunfish as a follow-up to r245982.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245996
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Wed, 26 Aug 2015 00:22:41 +0000 (00:22 +0000)]
Refactor to reduce duplication in OnDiskIterableChainedHashTable's iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245995
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Tue, 25 Aug 2015 23:29:43 +0000 (23:29 +0000)]
[dsymutil] actually fix test.
Not all machines have lipo installed. Do not try to invoke it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245991
91177308-0d34-0410-b5e6-
96231b3b80d8
Charles Davis [Tue, 25 Aug 2015 23:27:41 +0000 (23:27 +0000)]
Make variable argument intrinsics behave correctly in a Win64 CC function.
Summary:
This change makes the variable argument intrinsics, `llvm.va_start` and
`llvm.va_copy`, and the `va_arg` instruction behave as they do on Windows
inside a `CallingConv::X86_64_Win64` function. It's needed for a Clang patch
I have to add support for GCC's `__builtin_ms_va_list` constructs.
Reviewers: nadav, asl, eugenis
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1622
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245990
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Tue, 25 Aug 2015 23:19:49 +0000 (23:19 +0000)]
WebAssembly: assert that there aren't any constant pools
WebAssembly will either use globals or immediates, since it's a virtual ISA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245989
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Tue, 25 Aug 2015 23:15:26 +0000 (23:15 +0000)]
[dsymutil] Reapply r245960.
There was an issue in the test setup because the test requires an arch that
wasn't filtered by the lit.local.cfg, but given the set of bots that failed,
I'm not confident this is the (only) issue. So this commit also adds more
output to the test to help me track down the failure if it happens again.
Original commit message:
[dsymutil] Rewrite thumb triple names in user visible messages.
We autodetect triples from the input file(s) while reading the mach-o debug map.
As we need to create a Target from those triples, we always chose the thumb
variant (because the arm variant might not be 'instantiable' eg armv7m). The
user visible architecture names should still be 'arm' and not 'thumb' variants
though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245988
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Tue, 25 Aug 2015 22:58:05 +0000 (22:58 +0000)]
WebAssembly: emit `(func (param t) (result t))` s-expressions
Summary: Match spec format: https://github.com/WebAssembly/spec/blob/master/ml-proto/test/fac.wasm
Reviewers: sunfish
Subscribers: llvm-commits, jfb
Differential Revision: http://reviews.llvm.org/D12307
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245986
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Tue, 25 Aug 2015 22:23:15 +0000 (22:23 +0000)]
WebAssembly: comment out .globl when printing textual assembly
Do the same for .weak (not implemented for now, but may as well to it). Update comment string to two semicolons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245982
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 25 Aug 2015 22:19:11 +0000 (22:19 +0000)]
[msan] Precise instrumentation for icmp sgt %x, -1.
Extend signed relational comparison instrumentation with a special
case for comparisons with -1. This fixes an MSan false positive when
such comparison is used as a sign bit test.
https://llvm.org/bugs/show_bug.cgi?id=24561
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245980
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Tue, 25 Aug 2015 22:06:07 +0000 (22:06 +0000)]
[MC] Add a SetUsed default param to MCSymbol accessors (NFC)
Reviewed by: rafael
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245978
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 25 Aug 2015 22:05:55 +0000 (22:05 +0000)]
MachineBasicBlock: Use MCPhysReg instead of unsigned in livein API
This is friendlier to the readers as it makes it clear that the API is
not meant for vregs but just for physregs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245977
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Tue, 25 Aug 2015 21:34:38 +0000 (21:34 +0000)]
Remove the final bit test during lowering switch statement if all cases in bit test cover a contiguous range.
When lowering switch statement, if bit tests are used then LLVM will always generates a jump to the default statement in the last bit test. However, this is not necessary when all cases in bit tests cover a contiguous range. This is because when generating the bit tests header MBB, there is a range check that guarantees cases in bit tests won't go outside of [low, high], where low and high are minimum and maximum case values in the bit tests. This patch checks if this is the case and then doesn't emit jump to default statement and hence saves a bit test and a branch.
Differential Revision: http://reviews.llvm.org/D12249
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245976
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 25 Aug 2015 20:59:26 +0000 (20:59 +0000)]
Use CHECK-LABEL in MSan IR tests.
This actually found one case when a test was matching instructions
from the output of a different test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245974
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Tue, 25 Aug 2015 18:43:11 +0000 (18:43 +0000)]
Revert "[dsymutil] Rewrite thumb triple names in user visible messages."
This reverts commit r245960.
Multiple bots are failing on the new test. It seemd like llvm-dsymutil exits with an error. Investigating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245964
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 25 Aug 2015 18:27:59 +0000 (18:27 +0000)]
[MachO] Move trivial accessors to header.
Requested by: Jim Grosbach.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245963
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Tue, 25 Aug 2015 18:19:48 +0000 (18:19 +0000)]
[dsymutil] Rewrite thumb triple names in user visible messages.
We autodetect triples from the input file(s) while reading the mach-o debug map.
As we need to create a Target from those triples, we always chose the thumb
variant (because the arm variant might not be 'instantiable' eg armv7m). The
user visible architecture names should still be 'arm' and not 'thumb' variants
though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245960
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Tue, 25 Aug 2015 18:19:43 +0000 (18:19 +0000)]
[dsymutil] Not finding any debug info is not a fatal error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245959
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 25 Aug 2015 18:12:40 +0000 (18:12 +0000)]
fix CHECK-LABEL and wrong label
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245958
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 25 Aug 2015 17:11:17 +0000 (17:11 +0000)]
Update libdeps in LLVMipo and LLVMScalarOpts, corresponding to r245940.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245957
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 25 Aug 2015 17:10:17 +0000 (17:10 +0000)]
SlotIndexes: Introduce an iterator into the idx2MBBMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245956
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 25 Aug 2015 17:07:40 +0000 (17:07 +0000)]
Fix dependencies/shared library build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245955
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 25 Aug 2015 17:01:36 +0000 (17:01 +0000)]
Fix dropped conditional in cleanup in r245752
Code review feedback by Charlie Turner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245954
91177308-0d34-0410-b5e6-
96231b3b80d8
Wei Mi [Tue, 25 Aug 2015 16:43:47 +0000 (16:43 +0000)]
The patch replace the overflow check in loop vectorization with the minimum loop iterations check.
The loop minimum iterations check below ensures the loop has enough trip count so the generated
vector loop will likely be executed, and it covers the overflow check.
Differential Revision: http://reviews.llvm.org/D12107.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245952
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 25 Aug 2015 16:29:21 +0000 (16:29 +0000)]
make fast unaligned memory accesses implicit with SSE4.2 or SSE4a
This is a follow-on from the discussion in http://reviews.llvm.org/D12154.
This change allows memset/memcpy to use SSE or AVX memory accesses for any chip that has
generally fast unaligned memory ops.
A motivating use case for this change is a clang invocation that doesn't explicitly set
the CPU, but does target a feature that we know only exists on a CPU that supports fast
unaligned memops. For example:
$ clang -O1 foo.c -mavx
This resolves a difference in lowering noted in PR24449:
https://llvm.org/bugs/show_bug.cgi?id=24449
Before this patch, we used different store types depending on whether the example can be
lowered as a memset or not.
Differential Revision: http://reviews.llvm.org/D12288
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245950
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 25 Aug 2015 16:07:06 +0000 (16:07 +0000)]
[lit] Speculatively fix PR24554 by manually closing the process handle
My theory is that somehow Python's refcounting and GC strategy isn't
closing the subprocess handle in a timely fashion. This accesses the
private '_handle' field of the Popen object, but I see no other way to
do this. If this doesn't address the problem on the sanitizer-windows
buildbot, we can revert this change. If it does, then let's keep the
hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245946
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 25 Aug 2015 16:06:40 +0000 (16:06 +0000)]
[cmake] Pass /manifest:no to the linker when asan is enabled
This is a workaround for PR24476.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245945
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Tue, 25 Aug 2015 15:25:11 +0000 (15:25 +0000)]
Convert SampleProfile pass into a Module pass.
Eventually, we will need sample profiles to be incorporated into the
inliner's cost models. To do this, we need the sample profile pass to
be a module pass.
This patch makes no functional changes beyond the mechanical adjustments
needed to run SampleProfile as a module pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245940
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 25 Aug 2015 15:02:23 +0000 (15:02 +0000)]
[MachO] Introduce MinVersion API.
While introducing support for MinVersionLoadCommand in llvm-readobj I noticed there's
no API to extract Major/Minor/Update components conveniently. Currently consumers
do the bit twiddling on their own, but this will change from now on.
I'll convert llvm-objdump (and llvm-readobj) in a later commit.
Differential Revision: http://reviews.llvm.org/D12282
Reviewed by: rafael
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245938
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Tue, 25 Aug 2015 07:58:33 +0000 (07:58 +0000)]
[X86] Remove references to _ftol2
As of r245924, _ftol2 is no longer used for fptoui on MS platforms.
Remove the dead code associated with it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245925
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Tue, 25 Aug 2015 07:42:09 +0000 (07:42 +0000)]
[X86] Fix fptoui conversions
This fixes two issues in x86 fptoui lowering.
1) Makes conversions from f80 go through the right path on AVX-512.
2) Implements an inline sequence for fptoui i64 instead of a library
call. This improves performance by 6X on SSE3+ and 3X otherwise.
Incidentally, it also removes the use of ftol2 for fptoui, which was
wrong to begin with, as ftol2 converts to a signed i64, producing
wrong results for values >= 2^63.
Patch by: mitch.l.bodart@intel.com
Differential Revision: http://reviews.llvm.org/D11316
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245924
91177308-0d34-0410-b5e6-
96231b3b80d8
Steve King [Tue, 25 Aug 2015 02:31:21 +0000 (02:31 +0000)]
Pass function attributes instead of boolean in isIntDivCheap().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245921
91177308-0d34-0410-b5e6-
96231b3b80d8
Piotr Padlewski [Tue, 25 Aug 2015 01:48:49 +0000 (01:48 +0000)]
assume.ll test fixup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245920
91177308-0d34-0410-b5e6-
96231b3b80d8
Piotr Padlewski [Tue, 25 Aug 2015 01:34:15 +0000 (01:34 +0000)]
Assume intrinsic handling in global opt
It doesn't solve the problem, when for example we load something, and
then assume that it is the same as some constant value, because
globalopt will fail on unknown load instruction. The proposed solution
would be to skip some instructions that we can't evaluate and they are
safe to skip (f.e. load, assume and many others) and see if they are
required to perform optimization (f.e. we don't care about ephemeral
instructions that may appear using @llvm.assume())
http://reviews.llvm.org/D12266
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245919
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Tue, 25 Aug 2015 01:21:09 +0000 (01:21 +0000)]
Revert "Fix LLVM C API for DataLayout"
This reverts commit
433bfd94e4b7e3cc3f8b08f8513ce47817941b0c.
Broke some bot, have to see why it passed locally.
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245917
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Tue, 25 Aug 2015 01:07:25 +0000 (01:07 +0000)]
Fix LLVM C API for DataLayout
We removed access to the DataLayout on the TargetMachine and
deprecated the C API function LLVMGetTargetMachineData() in r243114.
However the way I tried to be backward compatible was broken: I
changed the wrapper of the TargetMachine to be a structure that
includes the DataLayout as well. However the TargetMachine is also
wrapped by the ExecutionEngine, in the more classic way. A client
using the TargetMachine wrapped by the ExecutionEngine and trying
to get the DataLayout would break.
It seems tricky to solve the problem completely in the C API
implementation. This patch tries to address this backward
compatibility in a more lighter way in the C++ API. The C API is
restored in its original state and the removed C++ API is
reintroduced, but privately. The C API is friended to the
TargetMachine and should be the only consumer for this API.
Reviewers: ributzka
Differential Revision: http://reviews.llvm.org/D12263
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245916
91177308-0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Tue, 25 Aug 2015 00:09:47 +0000 (00:09 +0000)]
[docs] Improvements to CMake.rst
- Fix some grammatical and typographical errors.
- Try to improve upon some awkward/nonstandard phrasings.
- Expand slightly the treatment of how you specify arguments to cmake.
- Update the list of possible LLVM_BUILD_TESTS and state where to find the
definitive list.
- Correct the name of llvm-tblgen.
- Expand slightly the treatment of several build options, including
LLVM_LIT_TOOLS_DIR, LLVM_ENABLE_FFI, and LLVM_EXTERNAL_project_SOURCE_DIR.
Patch by Brian R. Gaeke!
Differential Revision: http://reviews.llvm.org/D11862
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245911
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 24 Aug 2015 23:48:28 +0000 (23:48 +0000)]
[PowerPC] PPCVSXFMAMutate should ignore trivial-copy addends
We might end up with a trivial copy as the addend, and if so, we should ignore
the corresponding FMA instruction. The trivial copy can be coalesced away later,
so there's nothing to do here. We should not, however, assert. Fixes PR24544.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245907
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Mon, 24 Aug 2015 23:34:28 +0000 (23:34 +0000)]
Revert r245355 "Release script: correctly symlink clang-tools-extra into the build (PR22765)"
This worked with the CMake build but broke the Autoconf one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245902
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 24 Aug 2015 23:30:39 +0000 (23:30 +0000)]
Try to fix buildbots
Apparently std::vector::erase(const_iterator) (as opposed to the
non-const iterator) is a part of C++11 but it seems this is not available
on all the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245900
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 24 Aug 2015 23:20:16 +0000 (23:20 +0000)]
fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245899
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 24 Aug 2015 23:19:39 +0000 (23:19 +0000)]
Let's try to fix GNU libstdc++ buildbots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245898
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 24 Aug 2015 23:18:44 +0000 (23:18 +0000)]
fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245896
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 24 Aug 2015 22:59:52 +0000 (22:59 +0000)]
MachineBasicBlock: Add liveins() method returning an iterator_range
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245895
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 24 Aug 2015 22:31:52 +0000 (22:31 +0000)]
[WebAssembly] DYNAMIC_STACKALLOC returns a pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245893
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 24 Aug 2015 22:22:53 +0000 (22:22 +0000)]
LTO: Simplify merged module ownership.
This change moves LTOCodeGenerator's ownership of the merged module to a
field of type std::unique_ptr<Module>. This helps simplify parts of the code
and clears the way for the module to be consumed by LLVM CodeGen (see D12132
review comments).
Differential Revision: http://reviews.llvm.org/D12205
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245891
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Mon, 24 Aug 2015 22:16:48 +0000 (22:16 +0000)]
WebAssembly: Implement call
Summary: Support function calls.
Reviewers: sunfish, sunfishcode
Subscribers: sunfishcode, jfb, llvm-commits
Differential revision: http://reviews.llvm.org/D12219
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245887
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Mon, 24 Aug 2015 22:07:33 +0000 (22:07 +0000)]
Revert two bad commits.
Summary: I forgot to squash git commits before doing an svn dcommit of D12219. Reverting, and re-submitting.
Subscribers: jfb, llvm-commits
Differential Revision: http://reviews.llvm.org/D12298
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245886
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Mon, 24 Aug 2015 22:00:04 +0000 (22:00 +0000)]
Missing print.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245883
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Mon, 24 Aug 2015 21:59:51 +0000 (21:59 +0000)]
call
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245882
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 24 Aug 2015 21:28:13 +0000 (21:28 +0000)]
[X86][SSE] Added tests for zero-extension vector shuffles that don't extend starting from the 0'th lane.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245878
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 24 Aug 2015 21:19:48 +0000 (21:19 +0000)]
[WebAssembly] Make the assembly printer indent instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245875
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 24 Aug 2015 21:15:35 +0000 (21:15 +0000)]
LTO: Rename mergedModule variables to MergedModule to prepare for ownership change.
Also convert a few loops to range-for loops and correct a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245874
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 24 Aug 2015 21:09:41 +0000 (21:09 +0000)]
Report an error if a SHT_SYMTAB_SHNDX section has the wrong size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245873
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 24 Aug 2015 21:03:24 +0000 (21:03 +0000)]
[WebAssembly] CodeGen support for __builtin_wasm_page_size()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245872
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 24 Aug 2015 20:11:14 +0000 (20:11 +0000)]
fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245869
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Mon, 24 Aug 2015 19:27:27 +0000 (19:27 +0000)]
[PPC64LE] Fix PR24546 - Swap optimization and debug values
This patch fixes PR24546, which demonstrates a segfault during the VSX
swap removal pass. The problem is that debug value instructions were
not excluded from the list of instructions to be analyzed for webs of
related computation. I've added the test case from the PR as a crash
test in test/CodeGen/PowerPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245862
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 24 Aug 2015 18:44:37 +0000 (18:44 +0000)]
[WebAssembly] Skeleton FastISel support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245860
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 24 Aug 2015 18:23:13 +0000 (18:23 +0000)]
[WebAssembly] Implement floating point rounding operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245859
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 24 Aug 2015 18:16:02 +0000 (18:16 +0000)]
[docs][PerformanceTips] Framing the generic IR tips
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245858
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 24 Aug 2015 17:46:11 +0000 (17:46 +0000)]
[docs][PerformanceTips] Point people towards llvm-dev
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245856
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 24 Aug 2015 17:38:58 +0000 (17:38 +0000)]
[docs] Further organization of the Performance Tips document
Arranging the language specific property section into readable groupings and adding a couple of notes about pass order, extensions, and the like.
For the record, suggestion for word smithing are welcomed. I'm happy to revise; I'm just trying to get *something* in place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245855
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 24 Aug 2015 17:19:18 +0000 (17:19 +0000)]
[docs] Organize the 'Performance Tips' page
This change just groups the suggestions by broad topic. I'm planning a couple of follow on changes to improve the readability of this document.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245854
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 24 Aug 2015 16:51:46 +0000 (16:51 +0000)]
[WebAssembly] Tell TargetTransformInfo about popcnt and sqrt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245853
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 24 Aug 2015 16:46:31 +0000 (16:46 +0000)]
[WebAssembly] Use the checked form of MachineFunction::getSubtarget. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245852
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 24 Aug 2015 16:39:37 +0000 (16:39 +0000)]
[WebAssembly] Implement the is_zero_undef forms of cttz and ctlz
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245851
91177308-0d34-0410-b5e6-
96231b3b80d8
Adhemerval Zanella [Mon, 24 Aug 2015 13:48:10 +0000 (13:48 +0000)]
[sanitizers] Add DFSan support for AArch64 42-bit VMA
This patch adds support for dfsan on aarch64-linux with 42-bit VMA
(current default config for 64K pagesize kernels). The support is
enabled by defining the SANITIZER_AARCH64_VMA to 42 at build time
for both clang/llvm and compiler-rt. The default VMA is 39 bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245840
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zuckerman [Mon, 24 Aug 2015 10:26:54 +0000 (10:26 +0000)]
[X86] Add support for mmword memory operand size for Intel-syntax x86 assembly
Differential Revision: http://reviews.llvm.org/D12151
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245835
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Mon, 24 Aug 2015 09:47:45 +0000 (09:47 +0000)]
Add DAG optimisation for FP16_TO_FP
The FP16_TO_FP node only uses the bottom 16 bits of its input, so the
following pattern can be optimised by removing the AND:
(FP16_TO_FP (AND op, 0xffff)) -> (FP16_TO_FP op)
This is a common pattern for ARM targets when functions have __fp16
arguments, as they are passed as floats (so that they get passed in the
correct registers), but then bitcast and truncated to ignore the top 16
bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245832
91177308-0d34-0410-b5e6-
96231b3b80d8