David Blaikie [Thu, 23 Oct 2014 22:27:50 +0000 (22:27 +0000)]
DebugInfo: Remove DwarfDebug::CurrentFnArguments since we have to handle argument ordering of other arguments (abstract arguments) in the same way and already have code for that too.
While refactoring this code I was confused by both the name I had
introduced (addNonArgumentVariable... but it has all this logic to
handle argument numbering and keep things in order?) and by the
redundancy. Seems when I fixed the misordered inlined argument handling,
I didn't realize it was mostly redundant with the argument ordering code
(which I may've also written, I'm not sure). So let's just rely on the
more general case.
The only oddity in output this produces is that it means when we emit
all the variables for the current function, we don't track when we've
finished the argument variables and are about to start the local
variables and insert DW_AT_unspecified_parameters (for varargs
functions) there. Instead it ends up after the local variables, scopes,
etc. But this isn't invalid and doesn't cause DWARF consumers problems
that I know of... so we'll just go with that because it makes the code
nice & simple.
(though, let's see what the buildbots have to say about this - *crosses
fingers*)
There will be some cleanup commits to follow to remove the now trivial
wrappers, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220527
91177308-0d34-0410-b5e6-
96231b3b80d8
Timur Iskhodzhanov [Thu, 23 Oct 2014 22:25:31 +0000 (22:25 +0000)]
PR21189: Teach llvm-readobj to dump bits of COFF symbol subsections required to debug using VS2012+
Reviewed at http://reviews.llvm.org/D5755
Thanks to Andrey Guskov for his help investigating this!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220526
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 23 Oct 2014 22:04:30 +0000 (22:04 +0000)]
DebugInfo: Sink DwarfDebug::addNonArgumentScopeVariable into DwarfFile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220520
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Thu, 23 Oct 2014 21:59:17 +0000 (21:59 +0000)]
MachODump.cpp: fix MSVC build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220518
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Thu, 23 Oct 2014 21:55:31 +0000 (21:55 +0000)]
[X86] Improve mul w/ overflow codegen, to MUL8+SETO.
Currently, @llvm.smul.with.overflow.i8 expands to 9 instructions, where
3 are really needed.
This adds X86ISD::UMUL8/SMUL8 SD nodes, and custom lowers them to
MUL8/IMUL8 + SETO.
i8 is a special case because there is no two/three operand variants of
(I)MUL8, so the first operand and return value need to go in AL/AX.
Also, we can't write patterns for these instructions: TableGen refuses
patterns where output operands don't match SDNode results. In this case,
instructions where the output operand is an implicitly defined register.
A related special case (and FIXME) exists for MUL8 (X86InstrArith.td):
// FIXME: Used for 8-bit mul, ignore result upper 8 bits.
// This probably ought to be moved to a def : Pat<> if the
// syntax can be accepted.
[(set AL, (mul AL, GR8:$src)), (implicit EFLAGS)]
Ideally, these go away with UMUL8, but we still need to improve TableGen
support of implicit operands in patterns.
Before this change:
movsbl %sil, %eax
movsbl %dil, %ecx
imull %eax, %ecx
movb %cl, %al
sarb $7, %al
movzbl %al, %eax
movzbl %ch, %esi
cmpl %eax, %esi
setne %al
After:
movb %dil, %al
imulb %sil
seto %al
Also, remove a made-redundant testcase for PR19858, and enable more FastISel
ALU-overflow tests for SelectionDAG too.
Differential Revision: http://reviews.llvm.org/D5809
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220516
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 23 Oct 2014 21:53:17 +0000 (21:53 +0000)]
DebugInfo: Remove DwarfDebug::addCurrentFnArgument declaration now that it's moved to DwarfFile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220515
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 23 Oct 2014 21:52:45 +0000 (21:52 +0000)]
Handle sqrt() shrinking in SimplifyLibCalls like any other call
This patch removes a chunk of special case logic for folding
(float)sqrt((double)x) -> sqrtf(x)
in InstCombineCasts and handles it in the mainstream path of SimplifyLibCalls.
No functional change intended, but I loosened the restriction on the existing
sqrt testcases to allow for this optimization even without unsafe-fp-math because
that's the existing behavior.
I also added a missing test case for not shrinking the llvm.sqrt.f64 intrinsic
in case the result is used as a double.
Differential Revision: http://reviews.llvm.org/D5919
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220514
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 23 Oct 2014 19:53:12 +0000 (19:53 +0000)]
Change the name of the field BindTable to bindtable to not over lap the type.
Should fix the build bot issues from commit r220500.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220504
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 23 Oct 2014 19:51:40 +0000 (19:51 +0000)]
Make llvm-go test dependency optional.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220503
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 23 Oct 2014 19:40:45 +0000 (19:40 +0000)]
Make llvm-link behave a bit more like LTO.
* Read modules lazily
* Don't treat the first file specially, instead merge all inputs into an empty
module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220501
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 23 Oct 2014 19:37:31 +0000 (19:37 +0000)]
Update llvm-objdump’s Mach-O symbolizer code for Objective-C references.
This prints disassembly comments for Objective-C references to CFStrings,
Selectors, Classes and method calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220500
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 23 Oct 2014 19:36:21 +0000 (19:36 +0000)]
Cleanup this test a bit.
Use simpler names and remove unnecessary fields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220499
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 23 Oct 2014 19:23:42 +0000 (19:23 +0000)]
Cleanup this test a bit.
Use simpler names and remove unnecessary fields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220498
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 23 Oct 2014 19:12:43 +0000 (19:12 +0000)]
DebugInfo: Simplify/tidy/correct global variable decl/def emission handling.
This fixes a bug (introduced by fixing the IR emitted from Clang where
the definition of a static member would be scoped within the class,
rather than within its lexical decl context) where the definition of a
static variable would be placed inside a class.
It also improves source fidelity by scoping static class member
definitions inside the lexical decl context in which tehy are written
(eg: namespace n { class foo { static int i; } int foo::i; } - the
definition of 'i' will be within the namespace 'n' in the DWARF output
now).
Lastly, and the original goal, this reduces debug info size slightly
(and makes debug info easier to read, etc) by placing the definitions of
non-member global variables within their namespace, rather than using a
separate namespace-scoped declaration along with a definition at global
scope.
Based on patches and discussion with Frédéric.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220497
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 23 Oct 2014 18:52:46 +0000 (18:52 +0000)]
Make this test a bit stricter.
This now:
* Forces the linker to include the internal definition.
* Checks the full output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220495
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 23 Oct 2014 18:44:07 +0000 (18:44 +0000)]
Make this test a bit stricter.
This now:
* Forces the linker to include the internal definition.
* Checks the full output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220494
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 23 Oct 2014 17:50:42 +0000 (17:50 +0000)]
Revert "Don't count inreg params when mangling fastcall functions"
This reverts commit r214981.
I'm not sure what I was thinking when I wrote this. Testing with MSVC
shows that this function is mangled to '@f@8':
int __fastcall f(int a, int b);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220492
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 23 Oct 2014 17:22:14 +0000 (17:22 +0000)]
Adding llvm-shlib to CMake build system with a few new bells and whistles
Summary:
This patch adds a new CMake build setting LLVM_BUILD_LLVM_DYLIB, which defaults to OFF. When set to ON, this will generate a shared library containing most of LLVM. The contents of the shared library can be overriden by specifying LLVM_DYLIB_COMPONENTS. LLVM_DYLIB_COMPONENTS can be set to a semi-colon delimited list of any LLVM components that you llvm-config can resolve.
On Windows, unless you are using Cygwin, you must specify an explicit symbol export file using LLVM_EXPORTED_SYMBOL_FILE. On Cygwin and all unix-like platforms if you do not specify LLVM_EXPORTED_SYMBOL_FILE, an export file containing only the LLVM C API will be auto-generated from the list of LLVM components specified in LLVM_DYLIB_COMPONENTS.
Reviewers: rnk
Reviewed By: rnk
Subscribers: rnk, llvm-commits
Differential Revision: http://reviews.llvm.org/D5890
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220490
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 23 Oct 2014 16:12:58 +0000 (16:12 +0000)]
Remove explicit (void) use of DwarfFile::DD that was accidentally left in r220452.
Caught in post-commit review by Frédéric.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220487
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Thu, 23 Oct 2014 15:31:50 +0000 (15:31 +0000)]
Do not emit intermediate register for zero FP immediate
This updates check for double precision zero floating point constant to allow
use of instruction with immediate value rather than temporary register.
Currently "a == 0.0", where "a" is of "double" type generates:
vmov.i32 d16, #0x0
vcmpe.f64 d0, d16
With this change it becomes:
vcmpe.f64 d0, #0
Patch by Sergey Dmitrouk.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220486
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 23 Oct 2014 15:20:05 +0000 (15:20 +0000)]
clang-format two code snippets to make the next patch easy to read.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220484
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 23 Oct 2014 14:45:19 +0000 (14:45 +0000)]
Add unittest for extreme alignments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220483
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 23 Oct 2014 11:32:16 +0000 (11:32 +0000)]
Hexagon/Disassembler/LLVMBuild.txt: Update libdeps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220482
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 23 Oct 2014 11:32:03 +0000 (11:32 +0000)]
Hexagon/LLVMBuild.txt: Prune CRLF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220481
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 23 Oct 2014 11:31:50 +0000 (11:31 +0000)]
[CMake] Prune CRLF in CMakeLists.txt(s).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220480
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 23 Oct 2014 11:31:33 +0000 (11:31 +0000)]
[CMake] Prune trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220479
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 23 Oct 2014 11:31:22 +0000 (11:31 +0000)]
Revert r220427, "[Hexagon] Adding encoding bits for add opcode."
It brought cyclic dependecy between HexagonAsmPrinter and HexagonDesc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220478
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Thu, 23 Oct 2014 11:13:59 +0000 (11:13 +0000)]
[mips][microMIPS] Implement ADDIUR1SP instruction
Differential Revision: http://reviews.llvm.org/D5153
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220477
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Thu, 23 Oct 2014 11:06:34 +0000 (11:06 +0000)]
ps][microMIPS] Implement ADDIUR2 instruction
Differential Revision: http://reviews.llvm.org/D5151
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220476
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Thu, 23 Oct 2014 10:59:24 +0000 (10:59 +0000)]
ps][microMIPS] Implement LI16 instruction
Differential Revision: http://reviews.llvm.org/D5149
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220475
91177308-0d34-0410-b5e6-
96231b3b80d8
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