oota-llvm.git
10 years ago[DebugInfo] Remove LexicalScopes::isCurrentFunctionScope and CSE a use of LexicalScop...
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

10 years agoFix Mips nacl-mask test for new bundle-aligned label behavior
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

10 years ago[MCJIT] Make repeat calls to MCJIT::getPointerToFunction for declarations safe.
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

10 years agoAttempt to fix the build after r220439
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

10 years ago[MC] Attach labels to existing fragments instead of using a separate fragment
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

10 years ago[Hexagon] Adding encoding bits for add opcode.
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

10 years ago[AArch64] Add support for the .inst directive.
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

10 years agoGo: add binding for LLVMSetUnnamedAddr.
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

10 years agoStrength reduce constant-sized vectors into arrays. No functionality change.
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

10 years agoDo not add -gsplit-dwarf to LLVM_DEFINITIONS.
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

10 years agoLoopVectorize: Simplify code. No functionality change.
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

10 years agoShorten auto iterators for function basic blocks.
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

10 years agoFix number of operands in documentation for minnum / maxnum
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

10 years agotest: Make this test runnable in directories with @ in their names
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

10 years agoFix VS2012 build; C++11 type aliases are not supported.
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

10 years agoAmmending 220393 - Removing unused decoding tables.
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

10 years agoAmmending 220393 - Removing unused functions.
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

10 years ago[PATCH] Support select-cc for VSFRC when VSX is enabled
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

10 years agoUse auto iteration in lib/Transforms/Scalar/SampleProfile.cpp. No functional changes.
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

10 years ago[Hexagon] Adding basic disassembler.
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

10 years agoPreserving 'nonnull' metadata in SimplifyCFG
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

10 years agoShrinkify libcalls: use float versions of double libm functions with fast-math (bug...
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

10 years agoMake two helper functions static.
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

10 years agoChange error to warning when a profile cannot be found.
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

10 years ago[PowerPC] Support select-cc for VSX
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

10 years agoFixing a -Wsign-compare warning; NFC.
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

10 years agoSupport using sample profiles with partial debug info.
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

10 years ago[AArch64] Cleanup A57PBQPConstraints
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

10 years ago[InstSimplify] Support constant folding to vector of pointers
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

10 years ago[Thumb/Thumb2] Implement restrictions on SP in register list on LDM, STM variants...
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

10 years ago[OCaml] Fix a typo in documentation.
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

10 years agoR600/SI: Add another failing testcase for i1 copies
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

10 years agoR600/SI: Add failing testcase reduced from OpenCV
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

10 years agoHandle spaces and quotes in file names in MRI scripts.
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

10 years agoFix a gcc warning.
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

10 years agoSilence gcc's -Wcomment
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

10 years ago[lit] Fix Python-3 compatibility, patch by Dan Liew.
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

10 years ago[lit] Bump version number.
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

10 years agoFix ShTest parsing error when a keyword line doesn't end with a newline.
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

10 years agoFix typo
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

10 years agoTry to fix documentation bot warning
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

10 years ago[msan] Handle param-tls overflow.
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

10 years agoRevert "Teach the load analysis to allow finding available values which require"...
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

10 years ago[MCJIT] Defer application of AArch64 MachO GOT relocations until resolve time.
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

10 years agoMRI scripts: Add addlib support.
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

10 years agoLTO: respect command-line options that disable vectorization.
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

10 years agoUse a range loop. NFC.
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

10 years agoAdd minnum / maxnum codegen
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

10 years agoAdd minnum / maxnum intrinsics
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

10 years agoIR: Reorder metadata bitcode serialization, NFC
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

10 years agoR600/SI: Add missing parameter to div_fmas intrinsic
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

10 years agoIR: Remove dead code in metadata bitcode writing, NFC
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

10 years agoOverwrite instead of adding to archives when creating them in mri scripts.
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

10 years agoPacify bots and simplify r220321
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

10 years agoConvert a few std::string with StringRef. NFC.
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

10 years agoGCC has supported C++11 ref-qualifiers since 4.8.1
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

10 years agoR600: Use default GlobalDirective
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

10 years agoUse a StringRef. No functionality change.
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

10 years agoTeach combineMetadata how to merge 'nonnull' metadata.
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

10 years agoPreserve 'nonnull' when changing type of the load.
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

10 years agoExtend the verifier to check usage of 'nonnull' metadata.
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

10 years ago[PBQP] Teach PassConfig to tell if the default register allocator is used.
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

10 years agoMove code a bit to avoid a few declarations. NFC.
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

10 years ago[PBQP] Add a testcase for r220302: Fix coalescing benefits
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

10 years agoInstCombine: Simplify FoldICmpCstShrCst
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

10 years agoDrop support for an old version of ld64 (from darwin 9).
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

10 years agoremove function names from comments; NFC
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

10 years agoConvert two tests to use llvm-readobj.
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

10 years agoR600/SI: Add pattern for bswap
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

10 years ago[PBQP] Check for out of bound access in DEBUG builds
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

10 years ago[PBQP] Fix coalescing benefits
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

10 years agoX86AsmInstrumentation.cpp: Dissolve initializer-ranged-for. MSC17 disliked it.
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

10 years agoSilence a -Wcast-qual warning; NFC.
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

10 years agoTest commit
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

10 years agoComment cleanup. NFC.
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

10 years agoAdd support for addmod to mri scripts.
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

10 years ago[PowerPC] Avoid VSX FMA mutate when killed product reg = addend reg
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

10 years ago[ARM] NEON 32-bit scalar moves are also available in VFPv2
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

10 years ago[asan-asm-instrumentation] Fixed memory accesses with rbp as a base or an index register.
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

10 years ago[Thumb2] LDRS?[BH] cannot load to the PC
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

10 years agoTeach the load analysis to allow finding available values which require
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

10 years ago[mips][microMIPS] Implement ADDU16 and SUBU16 instructions
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

10 years ago[mips][microMIPS] Implement AND16, NOT16, OR16 and XOR16 instructions
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

10 years ago[mips][microMIPS] Implement microMIPS 16-bit instructions registers
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

10 years agoFix a bit of confusion about .set and produce more readable assembly.
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

10 years agoDo not attribute static allocas to the call site's DebugLoc.
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

10 years agoMake this test a bit more strict.
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

10 years agoTeach lit to filter the host LDFLAGS down from the build system and into
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

10 years agoPR21202: Memory leak in Windows RWMutexImpl when using SRWLOCK
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

10 years agoMake AsmPrinter::EmitLabelOffsetDifference a static helper and simplify.
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

10 years ago[MCJIT] Temporarily revert r220245 - it broke several bots.
Lang Hames [Tue, 21 Oct 2014 00:24:02 +0000 (00:24 +0000)]
[MCJIT] Temporarily revert r220245 - it broke several bots.

(See e.g. http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/17653)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220249 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoIntroduce enum values for previously defined metadata types. (NFC)
Philip Reames [Tue, 21 Oct 2014 00:13:20 +0000 (00:13 +0000)]
Introduce enum values for previously defined metadata types. (NFC)

Our metadata scheme lazily assigns IDs to string metadata, but we have a mechanism to preassign them as well.  Using a preassigned ID is helpful since we get compile time type checking, and avoid some (minimal) string construction and comparison.  This change adds enum value for three existing metadata types:
+    MD_nontemporal = 9, // "nontemporal"
+    MD_mem_parallel_loop_access = 10, // "llvm.mem.parallel_loop_access"
+    MD_nonnull = 11 // "nonnull"

I went through an updated various uses as well.  I made no attempt to get all uses; I focused on the ones which were easily grepable and easily to translate.  For example, there were several items in LoopInfo.cpp I chose not to update.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220248 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoExtend the verifier to validate range metadata on calls and invokes.
Philip Reames [Mon, 20 Oct 2014 23:52:07 +0000 (23:52 +0000)]
Extend the verifier to validate range metadata on calls and invokes.

Range metadata applies to loads, call, and invokes.  We were validating that metadata applied to loads was correct according to the LangRef, but we were not validating metadata applied to calls or invokes.  This change extracts the checking functionality to a common location, reuses it for all valid locations, and adds a simple test to ensure a misused range on a call gets reported.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220246 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[MCJIT] Make MCJIT honor symbol visibility settings when populating the global
Lang Hames [Mon, 20 Oct 2014 23:39:54 +0000 (23:39 +0000)]
[MCJIT] Make MCJIT honor symbol visibility settings when populating the global
symbol table.

Patch by Anthony Pesch. Thanks Anthony!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220245 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[X86] Fix a bug in the lowering of the mask of VSELECT.
Quentin Colombet [Mon, 20 Oct 2014 23:13:30 +0000 (23:13 +0000)]
[X86] Fix a bug in the lowering of the mask of VSELECT.
X86 code to lower VSELECT messed a bit with the bits set in the mask of VSELECT
when it knows it can be lowered into BLEND. Indeed, only the high bits need to be
set for those and it optimizes those accordingly.
However, when the mask is a compile time constant, the lowering will be handled
by the generic optimizer and those modifications will generate bad code in the
generic optimizer.

This patch fixes that by preventing the optimization if the VSELECT will be
handled by the generic optimizer.

<rdar://problem/18675020>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220242 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoIntroduce a 'nonnull' metadata on Load instructions.
Philip Reames [Mon, 20 Oct 2014 22:40:55 +0000 (22:40 +0000)]
Introduce a 'nonnull' metadata on Load instructions.

The newly introduced 'nonnull' metadata is analogous to existing 'nonnull' attributes, but applies to load instructions rather than call arguments or returns.  Long term, it would be nice to combine these into a single construct.   The value of the load is allowed to vary between successive loads, but null is not a valid value to be loaded by any load marked nonnull.

Reviewed by: Hal Finkel
Differential Revision:  http://reviews.llvm.org/D5220

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220240 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[X86] Memory folding for commutative instructions (updated)
Simon Pilgrim [Mon, 20 Oct 2014 22:14:22 +0000 (22:14 +0000)]
[X86] Memory folding for commutative instructions (updated)

This patch improves support for commutative instructions in the x86 memory folding implementation by attempting to fold a commuted version of the instruction if the original folding fails - if that folding fails as well the instruction is 're-commuted' back to its original order before returning.

Updated version of r219584 (reverted in r219595) - the commutation attempt now explicitly ensures that neither of the commuted source operands are tied to the destination operand / register, which was the source of all the regressions that occurred with the original patch attempt.

Added additional regression test case provided by Joerg Sonnenberger.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220239 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoExplain why we don't always use --gc-sections.
Rafael Espindola [Mon, 20 Oct 2014 21:37:38 +0000 (21:37 +0000)]
Explain why we don't always use --gc-sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220237 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM: rework Thumb1 frame index rewriting
Tim Northover [Mon, 20 Oct 2014 21:28:41 +0000 (21:28 +0000)]
ARM: rework Thumb1 frame index rewriting

The previous code had a few problems, motivating the choices here.

1. It could create instructions clobbering CPSR, but the incoming MachineInstr
   didn't reflect this. A potential source of corruption. This is why the patch
   has a new PseudoInst for before lowering.
2. Similarly, there was some code to handle the incoming instruction not being
   ARMCC::AL, but this would have caused massive problems if it was actually
   invoked when a complex offset needing more than one instruction was requested.
3. It wasn't designed to handle unaligned pointers (or offsets). These should
   probably be minimised anyway, but the code needs to deal with them properly
   regardless.
4. It had some rather dubious ad-hoc code to avoid calling
   emitThumbRegPlusImmediate, a function which should be designed to do precisely
   this job.

We seem to cover the common cases correctly now, and hopefully can enhance
emitThumbRegPlusImmediate to handle any extra optimisations we need to add in
future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220236 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTry to fix GCC error about invalid use of const_cast in const version of ErrorOr...
Alexey Samsonov [Mon, 20 Oct 2014 20:41:21 +0000 (20:41 +0000)]
Try to fix GCC error about invalid use of const_cast in const version of ErrorOr::get()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220233 91177308-0d34-0410-b5e6-96231b3b80d8