Zoran Jovanovic [Thu, 23 Oct 2014 10:42:01 +0000 (10:42 +0000)]
[mips][microMIPS] Implement CodeGen support for SLL16 and SRL16 instructions
Differential Revision: http://reviews.llvm.org/D5774
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220474
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Thu, 23 Oct 2014 08:52:58 +0000 (08:52 +0000)]
[Thumb2] Improve disassembly of memory hints
Currently, the ARM disassembler will disassemble the Thumb2 memory hint
instructions (PLD, PLDW and PLI), even for targets which do not have
these instructions. This patch adds the required checks to the
disassmebler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220472
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Thu, 23 Oct 2014 04:17:05 +0000 (04:17 +0000)]
[ARM, stack protector] If supported, use armv7 instructions.
This commit enables using movt/movw to load the stack guard address:
movw r0, :lower16:(L_g3$non_lazy_ptr-(LPC0_0+8))
movt r0, :upper16:(L_g3$non_lazy_ptr-(LPC0_0+8))
ldr r0, [pc, r0]
Previously a pc-relative load was emitted:
ldr r0, LCPI0_0
ldr r0, [pc, r0]
rdar://problem/
18740489
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220470
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Thu, 23 Oct 2014 04:08:42 +0000 (04:08 +0000)]
Assert that ValueHandleBase::ValueIsRAUWd doesn't change the tracked Value type.
This invariant is enforced in Value::replaceAllUsesWith, thus it seems
logical to apply it also to ValueHandles. This commit fixes InstCombine
to not trigger the assertion during the removal of constant bitcasts in
call instructions.
Differential Revision: http://reviews.llvm.org/D5828
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220468
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Thu, 23 Oct 2014 04:08:38 +0000 (04:08 +0000)]
Modernize doxygen comments in Support/Dwarf.h
In post-commit review of r219442, Rafael pointed out that the comment style
of the newly introduced helper didn't follow LLVM's coding standard.
Modernize the whole file to the new standards.
Differential Revision: http://reviews.llvm.org/D5918
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220467
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Thu, 23 Oct 2014 04:08:34 +0000 (04:08 +0000)]
[dwarfdump] Dump DW_AT_ranges values inline in the debug_info dump.
The output looks like that:
DW_AT_ranges [FORM_data4] (0x00000000
[0x00000001000024a0 - 0x00000001000024c2)
[0x0000000100002505 - 0x000000010000268b))
Differential Revision: http://reviews.llvm.org/D5712
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220466
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 23 Oct 2014 02:33:23 +0000 (02:33 +0000)]
Add llvm-go tool.
This tool lets us build LLVM components within the tree by setting up a
$GOPATH that resembles a tree fetched in the normal way with "go get".
It is intended that components such as the Go frontend will be built in-tree
using this tool.
Differential Revision: http://reviews.llvm.org/D5902
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220462
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Thu, 23 Oct 2014 01:05:46 +0000 (01:05 +0000)]
[msan] Emit checks for constant shadow values under an experimental flag.
Does not change the default behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220457
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 23 Oct 2014 00:16:05 +0000 (00:16 +0000)]
[DebugInfo] Sink DwarfDebug::addCurrentFnArgument down into DwarfFile.
Variable handling will be sunk into DwarfFile so that abstract variables
and the like can be shared across multiple CUs (to handle cross-CU
inlining, for example).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220453
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 23 Oct 2014 00:16:03 +0000 (00:16 +0000)]
[DebugInfo] Add DwarfDebug& to DwarfFile.
Use the DwarfDebug in one function that previously took it as a
parameter, and lay the foundation for use this for other operations
coming soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220452
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 23 Oct 2014 00:06:27 +0000 (00:06 +0000)]
[DebugInfo] Remove LexicalScopes::isCurrentFunctionScope and CSE a use of LexicalScopes::getCurrentFunctionScope
Now that we're sure the only root (non-abstract) scope is the current
function scope, there's no need for isCurrentFunctionScope, the property
can be tested directly instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220451
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Wed, 22 Oct 2014 23:32:00 +0000 (23:32 +0000)]
Fix Mips nacl-mask test for new bundle-aligned label behavior
After r220439 the behavior of labels in bundle-align mode changed,
and I neglected to update this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220447
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 22 Oct 2014 23:18:42 +0000 (23:18 +0000)]
[MCJIT] Make repeat calls to MCJIT::getPointerToFunction for declarations safe.
MCJIT::getPointerForFunction adds the resulting address to the global mapping.
This should be done via updateGlobalMapping rather than addGlobalMapping, since
the latter asserts if a mapping already exists.
MCJIT::getPointerToFunction is actually deprecated - hopefully we can remove it
(or more likely re-task it) entirely soon. In the mean time it should at least
work as advertised.
<rdar://problem/
18727946>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220444
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 22 Oct 2014 22:46:05 +0000 (22:46 +0000)]
Attempt to fix the build after r220439
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220440
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Wed, 22 Oct 2014 22:38:06 +0000 (22:38 +0000)]
[MC] Attach labels to existing fragments instead of using a separate fragment
Summary:
Currently when emitting a label, a new data fragment is created for it if the
current fragment isn't a data fragment.
This change instead enqueues the label and attaches it to the next fragment
(e.g. created for the next instruction) if possible.
When bundle alignment is not enabled, this has no functionality change (it
just results in fewer extra fragments being created). For bundle alignment,
previously labels would point to the beginning of the bundle padding instead
of the beginning of the emitted instruction. This was not only less efficient
(e.g. jumping to the nops instead of past them) but also led to miscalculation
of the address of the GOT (since MC uses a label difference rather than
emitting a "." symbol).
Fixes https://code.google.com/p/nativeclient/issues/detail?id=3982
Test Plan: regression test attached
Reviewers: jvoung, eliben
Subscribers: jfb, llvm-commits
Differential Revision: http://reviews.llvm.org/D5915
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220439
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 22 Oct 2014 20:58:35 +0000 (20:58 +0000)]
[Hexagon] Adding encoding bits for add opcode.
Adding llvm-mc tests.
Removing unit tests.
http://reviews.llvm.org/D5624
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220427
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 22 Oct 2014 20:35:57 +0000 (20:35 +0000)]
[AArch64] Add support for the .inst directive.
This has been implement using the MCTargetStreamer interface as is done in the
ARM, Mips and PPC backends.
Phabricator: http://reviews.llvm.org/D5891
PR20964
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220422
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 22 Oct 2014 20:20:27 +0000 (20:20 +0000)]
Go: add binding for LLVMSetUnnamedAddr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220416
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 22 Oct 2014 19:55:26 +0000 (19:55 +0000)]
Strength reduce constant-sized vectors into arrays. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220412
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 22 Oct 2014 19:49:19 +0000 (19:49 +0000)]
Do not add -gsplit-dwarf to LLVM_DEFINITIONS.
This would cause the flag to appear in the output of "llvm-config --cppflags",
which should contain only preprocessor flags. The -gsplit-dwarf flag in
particular can cause problems with certain downstream users such as cgo.
Differential Revision: http://reviews.llvm.org/D5895
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220410
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 22 Oct 2014 19:13:54 +0000 (19:13 +0000)]
LoopVectorize: Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220405
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Wed, 22 Oct 2014 18:39:50 +0000 (18:39 +0000)]
Shorten auto iterators for function basic blocks.
Use consistent naming for basic block instances.
No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220404
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 22 Oct 2014 18:25:02 +0000 (18:25 +0000)]
Fix number of operands in documentation for minnum / maxnum
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220402
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Wed, 22 Oct 2014 18:18:54 +0000 (18:18 +0000)]
test: Make this test runnable in directories with @ in their names
Jenkins likes to use directories with names involving the '@'
character, which breaks the sed expression in this test. Switch to use
'|' on the assumption that it's less likely to show up in a path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220401
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 22 Oct 2014 17:47:49 +0000 (17:47 +0000)]
Fix VS2012 build; C++11 type aliases are not supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220399
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 22 Oct 2014 17:23:01 +0000 (17:23 +0000)]
Ammending 220393 - Removing unused decoding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220397
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 22 Oct 2014 17:03:19 +0000 (17:03 +0000)]
Ammending 220393 - Removing unused functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220396
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Wed, 22 Oct 2014 16:58:20 +0000 (16:58 +0000)]
[PATCH] Support select-cc for VSFRC when VSX is enabled
A previous patch enabled SELECT_VSRC and SELECT_CC_VSRC for VSX to
handle <2 x double> cases. This patch adds SELECT_VSFRC and
SELECT_CC_VSFRC to allow use of all 64 vector-scalar registers for the
f64 type when VSX is enabled. The changes are analogous to those in
the previous patch. I've added a new variant to vsx.ll to test the
code generation.
(I also cleaned up a little formatting in PPCInstrVSX.td from the
previous patch.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220395
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Wed, 22 Oct 2014 16:51:50 +0000 (16:51 +0000)]
Use auto iteration in lib/Transforms/Scalar/SampleProfile.cpp. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220394
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Wed, 22 Oct 2014 16:49:14 +0000 (16:49 +0000)]
[Hexagon] Adding basic disassembler.
Marking all instructions as CodeGenOnly since encoding bits are not set yet.
http://reviews.llvm.org/D5829?vs=on&id=15023&whitespace=ignore-all#toc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220393
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Wed, 22 Oct 2014 16:37:13 +0000 (16:37 +0000)]
Preserving 'nonnull' metadata in SimplifyCFG
When we hoist two loads above an if, we can preserve the nonnull metadata. We could also do the same for sinking them, but we appear to not handle metadata at all in that case.
Thanks to Hal for the review.
Differential Revision: http://reviews.llvm.org/D5910
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220392
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 22 Oct 2014 15:29:23 +0000 (15:29 +0000)]
Shrinkify libcalls: use float versions of double libm functions with fast-math (bug 17850)
When a call to a double-precision libm function has fast-math semantics
(via function attribute for now because there is no IR-level FMF on calls),
we can avoid fpext/fptrunc operations and use the float version of the call
if the input and output are both float.
We already do this optimization using a command-line option; this patch just
adds the ability for fast-math to use the existing functionality.
I moved the cl::opt from InstructionCombining into SimplifyLibCalls because
it's only ever used internally to that class.
Modified the existing test cases to use the unsafe-fp-math attribute rather
than repeating all tests.
This patch should solve: http://llvm.org/bugs/show_bug.cgi?id=17850
Differential Revision: http://reviews.llvm.org/D5893
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220390
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 Oct 2014 15:05:51 +0000 (15:05 +0000)]
Make two helper functions static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220389
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Wed, 22 Oct 2014 13:36:35 +0000 (13:36 +0000)]
Change error to warning when a profile cannot be found.
When the profile for a function cannot be applied, we use to emit an
error. This seems extreme. The compiler can continue, it's just that the
optimization opportunities won't include profile information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220386
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Wed, 22 Oct 2014 13:13:40 +0000 (13:13 +0000)]
[PowerPC] Support select-cc for VSX
The tests test/CodeGen/Generic/select-cc.ll and
test/CodeGen/PowerPC/select-cc.ll both fail with VSX enabled. The
problem is that the lowering logic for the SELECT and SELECT_CC
operations doesn't currently support the VSX registers. This patch
fixes that.
In lib/Target/PowerPC/PPCInstrInfo.td, we have pseudos to handle this
for other register classes. Similar pseudos are added in
PPCInstrVSX.td (they must be there, because the "vsrc" register class
definition appears there) for the VSRC register class. The
SELECT_VSRC pseudo is then used in pattern matching for SELECT_CC.
The rest of the patch just adds logic for SELECT_VSRC wherever similar
logic appears for SELECT_VRRC.
There are no new test cases because the existing tests above test
this, along with a variant in test/CodeGen/PowerPC/vsx.ll.
After discussion with Hal, a future patch will add similar _VSFRC
variants to override f64 type handling (currently using F8RC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220385
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 22 Oct 2014 13:09:43 +0000 (13:09 +0000)]
Fixing a -Wsign-compare warning; NFC.
I think it might make sense to make COFF::MaxNumberOfSections16 be a uint32_t, however, that may have wider-reaching implications in other projects, which is why I did not change that declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220384
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Wed, 22 Oct 2014 12:59:00 +0000 (12:59 +0000)]
Support using sample profiles with partial debug info.
Summary:
When using a profile, we used to require the use -gmlt so that we could
get access to the line locations. This is used to match line numbers in
the input profile to the line numbers in the function's IR.
But this is actually not necessary. The driver can provide source
location tracking without the emission of debug information. In these
cases, the annotation 'llvm.dbg.cu' is missing from the IR, but the
actual line location annotations are still present.
This patch adds a new way of looking for the start of the current
function. Instead of looking through the compile units in llvm.dbg.cu,
we can walk up the scope for the first instruction in the function with
a debug loc. If that describes the function, we use it. Otherwise, we
keep looking until we find one.
If no such instruction is found, we then give up and produce an error.
Reviewers: echristo, dblaikie
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5887
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220382
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Wed, 22 Oct 2014 12:40:20 +0000 (12:40 +0000)]
[AArch64] Cleanup A57PBQPConstraints
And add a long awaited testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220381
91177308-0d34-0410-b5e6-
96231b3b80d8
Bruno Cardoso Lopes [Wed, 22 Oct 2014 12:18:48 +0000 (12:18 +0000)]
[InstSimplify] Support constant folding to vector of pointers
ConstantFolding crashes when trying to InstSimplify the following load:
@a = private unnamed_addr constant %mst {
i8* inttoptr (i64 -1 to i8*),
i8* inttoptr (i64 -1 to i8*)
}, align 8
%x = load <2 x i8*>* bitcast (%mst* @a to <2 x i8*>*), align 8
This patch fix this by adding support to this type of folding:
%x = load <2 x i8*>* bitcast (%mst* @a to <2 x i8*>*), align 8
==> gets folded to:
%x = <2 x i8*> <i8* inttoptr (i64 -1 to i8*), i8* inttoptr (i64 -1 to i8*)>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220380
91177308-0d34-0410-b5e6-
96231b3b80d8
Jyoti Allur [Wed, 22 Oct 2014 10:41:14 +0000 (10:41 +0000)]
[Thumb/Thumb2] Implement restrictions on SP in register list on LDM, STM variants in thumb mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220379
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Wed, 22 Oct 2014 10:24:05 +0000 (10:24 +0000)]
[OCaml] Fix a typo in documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220377
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 22 Oct 2014 05:30:42 +0000 (05:30 +0000)]
R600/SI: Add another failing testcase for i1 copies
It's not handling phis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220371
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 22 Oct 2014 04:26:10 +0000 (04:26 +0000)]
R600/SI: Add failing testcase reduced from OpenCV
This fails the verifier with:
"Expected a VCSrc_32 register, but got a VReg_1 register"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220368
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 Oct 2014 03:10:56 +0000 (03:10 +0000)]
Handle spaces and quotes in file names in MRI scripts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220364
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 22 Oct 2014 02:23:31 +0000 (02:23 +0000)]
Fix a gcc warning.
Thanks to Filipe Cabecinhas for the report.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220361
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Wed, 22 Oct 2014 02:16:06 +0000 (02:16 +0000)]
Silence gcc's -Wcomment
gcc's (4.7, I think) -Wcomment warning is not "as smart" as clang's and
warns even if the line right after the backslash-newline sequence only has
a line comment that starts at the beginning of the line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220360
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Wed, 22 Oct 2014 01:26:06 +0000 (01:26 +0000)]
[lit] Fix Python-3 compatibility, patch by Dan Liew.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220357
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Wed, 22 Oct 2014 00:48:23 +0000 (00:48 +0000)]
[lit] Bump version number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220355
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Wed, 22 Oct 2014 00:34:31 +0000 (00:34 +0000)]
Fix ShTest parsing error when a keyword line doesn't end with a newline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220354
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 22 Oct 2014 00:28:59 +0000 (00:28 +0000)]
Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220353
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 22 Oct 2014 00:15:53 +0000 (00:15 +0000)]
Try to fix documentation bot warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220352
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Wed, 22 Oct 2014 00:12:40 +0000 (00:12 +0000)]
[msan] Handle param-tls overflow.
ParamTLS (shadow for function arguments) is of limited size. This change
makes all arguments that do not fit unpoisoned, and avoids writing
past the end of a TLS buffer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220351
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Tue, 21 Oct 2014 23:49:52 +0000 (23:49 +0000)]
Revert "Teach the load analysis to allow finding available values which require" (r220277)
This seems to have caused PR21330.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220349
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 21 Oct 2014 23:41:15 +0000 (23:41 +0000)]
[MCJIT] Defer application of AArch64 MachO GOT relocations until resolve time.
On AArch64, GOT references are page relative (ADRP + LDR), so they can't be
applied until we know exactly where, within a page, the GOT entry will be in
the target address space.
Fixes <rdar://problem/
18693976>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220347
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Oct 2014 23:18:51 +0000 (23:18 +0000)]
MRI scripts: Add addlib support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220346
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Tue, 21 Oct 2014 23:18:21 +0000 (23:18 +0000)]
LTO: respect command-line options that disable vectorization.
Summary: Patches 202051 and 208013 added calls to LTO's PassManager which unconditionally add LoopVectorizePass and SLPVectorizerPass instead of following the logic in PassManagerBuilder::populateModulePassManager and honoring the -vectorize-loops -run-slp-after-loop-vectorization flags.
Reviewers: nadav, aschwaighofer, yijiang
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5884
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220345
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Oct 2014 23:04:55 +0000 (23:04 +0000)]
Use a range loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220344
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 21 Oct 2014 23:01:01 +0000 (23:01 +0000)]
Add minnum / maxnum codegen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220342
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 21 Oct 2014 23:00:20 +0000 (23:00 +0000)]
Add minnum / maxnum intrinsics
These are named following the IEEE-754 names for these
functions, rather than the libm fmin / fmax to avoid
possible ambiguities. Some languages may implement something
resembling fmin / fmax which return NaN if either operand is
to propagate errors. These implement the IEEE-754 semantics
of returning the other operand if either is a NaN representing
missing data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220341
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 21 Oct 2014 22:27:47 +0000 (22:27 +0000)]
IR: Reorder metadata bitcode serialization, NFC
Enumerate `MDNode`'s operands *before* the node itself, so that the
reader requires less RAUW. Although this will cause different code
paths to be hit in the reader, this should effectively be no
functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220340
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 21 Oct 2014 22:20:55 +0000 (22:20 +0000)]
R600/SI: Add missing parameter to div_fmas intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220338
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 21 Oct 2014 22:13:34 +0000 (22:13 +0000)]
IR: Remove dead code in metadata bitcode writing, NFC
No one cares how many uses each metadata value has, so don't bother
counting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220337
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Oct 2014 21:56:47 +0000 (21:56 +0000)]
Overwrite instead of adding to archives when creating them in mri scripts.
This matches the behavior of GNU ar and also makes it easier to implemnt
support for the addlib command.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220336
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Tue, 21 Oct 2014 21:50:49 +0000 (21:50 +0000)]
Pacify bots and simplify r220321
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220335
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Oct 2014 21:47:27 +0000 (21:47 +0000)]
Convert a few std::string with StringRef. NFC.
This is a micro optimization, but also makes the code a bit more flexible.
The MRIMembers variable is a short term hack. It is going away in the next
commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220334
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 21 Oct 2014 21:15:45 +0000 (21:15 +0000)]
GCC has supported C++11 ref-qualifiers since 4.8.1
This requires incorporating __GNUC_PATCHLEVEL__ into our prerequisite
check, and renaming our __GNUC_PREREQ to LLVM_GNUC_PREREQ, since it is
now functionally different.
Patch by Chilledheart!
Differential Revision: http://reviews.llvm.org/D5879
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220332
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 21 Oct 2014 21:08:36 +0000 (21:08 +0000)]
R600: Use default GlobalDirective
The overridden one wasn't inserting a space,
so you would end up with .globalfoo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220329
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Oct 2014 21:07:49 +0000 (21:07 +0000)]
Use a StringRef. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220327
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 21 Oct 2014 21:02:19 +0000 (21:02 +0000)]
Teach combineMetadata how to merge 'nonnull' metadata.
combineMetadata is used when merging two instructions into one. This change teaches it how to merge 'nonnull' - i.e. only preserve it on the new instruction if it's set on both sources. This isn't actually used yet since I haven't adjusted any of the call sites to pass in nonnull as a 'known metadata'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220325
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 21 Oct 2014 21:00:03 +0000 (21:00 +0000)]
Preserve 'nonnull' when changing type of the load.
When changing the type of a load in Chandler's recent InstCombine changes, we can preserve the new 'nonnull' metadata.
I considered adding an assert since 'nonnull' is only valid on pointer types, but casting a pointer to a non-pointer would involve more than a bitcast anyways. If someone extends this transform to handle more than bitcasts, the verifier will report the malformed IR, so a separate assertion isn't needed. Also, the fpmath flags would have the same problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220324
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 21 Oct 2014 20:56:29 +0000 (20:56 +0000)]
Extend the verifier to check usage of 'nonnull' metadata.
The recently added !nonnull metadata is only valid on loads of pointer type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220323
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Tue, 21 Oct 2014 20:47:22 +0000 (20:47 +0000)]
[PBQP] Teach PassConfig to tell if the default register allocator is used.
This enables targets to adapt their pass pipeline to the register
allocator in use. For example, with the AArch64 backend, using PBQP
with the cortex-a57, the FPLoadBalancing pass is no longer necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220321
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Oct 2014 20:34:57 +0000 (20:34 +0000)]
Move code a bit to avoid a few declarations. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220317
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Tue, 21 Oct 2014 20:10:21 +0000 (20:10 +0000)]
[PBQP] Add a testcase for r220302: Fix coalescing benefits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220316
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 21 Oct 2014 19:51:55 +0000 (19:51 +0000)]
InstCombine: Simplify FoldICmpCstShrCst
This function was complicated by the fact that it tried to perform
canonicalizations that were already preformed by InstSimplify. Remove
this extra code and move the tests over to InstSimplify. Add asserts to
make sure our preconditions hold before we make any assumptions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220314
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Oct 2014 18:31:09 +0000 (18:31 +0000)]
Drop support for an old version of ld64 (from darwin 9).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220310
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 21 Oct 2014 18:26:57 +0000 (18:26 +0000)]
remove function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220309
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Oct 2014 18:24:31 +0000 (18:24 +0000)]
Convert two tests to use llvm-readobj.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220308
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 21 Oct 2014 16:25:08 +0000 (16:25 +0000)]
R600/SI: Add pattern for bswap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220304
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Tue, 21 Oct 2014 16:24:21 +0000 (16:24 +0000)]
[PBQP] Check for out of bound access in DEBUG builds
It is just too easy to use a virtual register intead of a NodeId without a
compiler warning. This does not fix the fundamental problem, i.e. both
have the same underlying types, but increases the likelyhood to detect it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220303
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Tue, 21 Oct 2014 16:24:15 +0000 (16:24 +0000)]
[PBQP] Fix coalescing benefits
As coalescing registers is a benefit, the cost should be improved (i.e. made smaller) when coalescing is possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220302
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 21 Oct 2014 16:22:52 +0000 (16:22 +0000)]
X86AsmInstrumentation.cpp: Dissolve initializer-ranged-for. MSC17 disliked it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220301
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 21 Oct 2014 16:12:37 +0000 (16:12 +0000)]
Silence a -Wcast-qual warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220300
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 21 Oct 2014 16:03:10 +0000 (16:03 +0000)]
Test commit
Fixing brief comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220299
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Oct 2014 15:49:46 +0000 (15:49 +0000)]
Comment cleanup. NFC.
Don't duplicate names in comments and remove useless ones. Hopefully anyone
reading this knows what main is.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220298
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Oct 2014 14:46:17 +0000 (14:46 +0000)]
Add support for addmod to mri scripts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220294
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Tue, 21 Oct 2014 13:02:37 +0000 (13:02 +0000)]
[PowerPC] Avoid VSX FMA mutate when killed product reg = addend reg
With VSX enabled, test/CodeGen/PowerPC/recipest.ll exposes a bug in
the FMA mutation pass. If we have a situation where a killed product
register is the same register as the FMA target, such as:
%vreg5<def,tied1> = XSNMSUBADP %vreg5<tied0>, %vreg11, %vreg5,
%RM<imp-use>; VSFRC:%vreg5 F8RC:%vreg11
then the substitution makes no sense. We end up getting a crash when
we try to extend the interval associated with the killed product
register, as there is already a live range for %vreg5 there. This
patch just disables the mutation under those circumstances.
Since recipest.ll generates different code with VMX enabled, I've
modified that test to use -mattr=-vsx. I've borrowed the code from
that test that exposed the bug and placed it in fma-mutate.ll, where
it tests several mutation opportunities including the "bad" one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220290
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Tue, 21 Oct 2014 11:49:14 +0000 (11:49 +0000)]
[ARM] NEON 32-bit scalar moves are also available in VFPv2
The 32-bit variants of the NEON scalar<->GPR move instructions are
also available in VFPv2. The 8- and 16-bit variants do require NEON.
Note that the checks in the test file are all -DAG because they are
checking a mixture of stdout and stderr, and the ordering is not
guaranteed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220288
91177308-0d34-0410-b5e6-
96231b3b80d8
Yuri Gorshenin [Tue, 21 Oct 2014 10:22:27 +0000 (10:22 +0000)]
[asan-asm-instrumentation] Fixed memory accesses with rbp as a base or an index register.
Summary: Fixed memory accesses with rbp as a base or an index register.
Reviewers: eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5819
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220283
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Tue, 21 Oct 2014 09:14:15 +0000 (09:14 +0000)]
[Thumb2] LDRS?[BH] cannot load to the PC
The Thumb2 LDRS?[BH] instructions are not valid when the destination
register is the PC (these encodings are used for preload hints).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220278
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 21 Oct 2014 09:00:40 +0000 (09:00 +0000)]
Teach the load analysis to allow finding available values which require
inttoptr or ptrtoint cast provided there is datalayout available.
Eventually, the datalayout can just be required but in practice it will
always be there today.
To go with the ability to expose available values requiring a ptrtoint
or inttoptr cast, helpers are added to perform one of these three casts.
These smarts are necessary to finish canonicalizing loads and stores to
the operational type requirements without regressing fundamental
combines.
I've added some test cases. These should actually improve as the load
combining and store combining improves, but they may fundamentally be
highlighting some missing combines for select in addition to exercising
the specific added logic to load analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220277
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Tue, 21 Oct 2014 08:44:58 +0000 (08:44 +0000)]
[mips][microMIPS] Implement ADDU16 and SUBU16 instructions
Differential Revision: http://reviews.llvm.org/D5118
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220276
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Tue, 21 Oct 2014 08:32:40 +0000 (08:32 +0000)]
[mips][microMIPS] Implement AND16, NOT16, OR16 and XOR16 instructions
Differential Revision: http://reviews.llvm.org/D5117
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220275
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Tue, 21 Oct 2014 08:23:11 +0000 (08:23 +0000)]
[mips][microMIPS] Implement microMIPS 16-bit instructions registers
Differential Revision: http://reviews.llvm.org/D5116
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220273
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Oct 2014 01:17:30 +0000 (01:17 +0000)]
Fix a bit of confusion about .set and produce more readable assembly.
Every target we support has support for assembly that looks like
a = b - c
.long a
What is special about MachO is that the above combination suppresses the
production of a relocation.
With this change we avoid producing the intermediary labels when they don't
add any value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220256
91177308-0d34-0410-b5e6-
96231b3b80d8
Paul Robinson [Tue, 21 Oct 2014 01:00:55 +0000 (01:00 +0000)]
Do not attribute static allocas to the call site's DebugLoc.
When functions are inlined, instructions without debug information are
attributed to the call site's DebugLoc. After inlining, inlined static
allocas are moved to the caller's entry block, adjacent to the caller's
original static alloca instructions. By retaining the call site's
DebugLoc, these instructions could cause instructions that were
subsequently inserted at the entry block to pick up the same DebugLoc.
Patch by Wolfgang Pieb!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220255
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Oct 2014 00:47:49 +0000 (00:47 +0000)]
Make this test a bit more strict.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220253
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 21 Oct 2014 00:36:28 +0000 (00:36 +0000)]
Teach lit to filter the host LDFLAGS down from the build system and into
the CGO build environment. This lets things like -rpath propagate down
to the C++ code that is built along side the Go bindings when testing
them.
Patch by Peter Collingbourne, and verified that it works by me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220252
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 21 Oct 2014 00:34:39 +0000 (00:34 +0000)]
PR21202: Memory leak in Windows RWMutexImpl when using SRWLOCK
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220251
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 21 Oct 2014 00:25:49 +0000 (00:25 +0000)]
Make AsmPrinter::EmitLabelOffsetDifference a static helper and simplify.
It had exactly one caller in a position where we know hasSetDirective is true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220250
91177308-0d34-0410-b5e6-
96231b3b80d8