Commit Graph

109262 Commits

Author SHA1 Message Date
Peter Zotov
0ce2ef8c2d [OCaml] Unbreak Llvm_executionengine.initialize_native_target.
First, return true on success, as it is the OCaml convention.
Second, also initialize the native assembly printer, which is,
despite the name, required for MCJIT operation.

Since this function did not initialize the assembly printer earlier
and no function to initialize native assembly printer was available
elsewhere, it is safe to break its interface: it means that it
simply could not be used successfully before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220620 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 18:50:02 +00:00
Peter Zotov
60d3f5918d [OCaml] Expose Llvm_executionengine.ExecutionEngine.create_mcjit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220619 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 18:49:56 +00:00
Jingyue Wu
71fe4f0197 [SeparateConstOffsetFromGEP] Fixed a bug related to unsigned modulo
The dividend in "signed % unsigned" is treated as unsigned instead of signed,
causing unexpected behavior such as -64 % (uint64_t)24 == 0.

Added a regression test in split-gep.ll

Patched by Hao Liu.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220618 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 18:34:03 +00:00
Benjamin Kramer
1f79facb06 Unbreak the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220617 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 18:20:17 +00:00
Benjamin Kramer
05b492db56 Clean up assume intrinsic pattern matching, no need to check that the argument is a value.
Also make it const safe and remove superfluous casting. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220616 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 18:09:01 +00:00
Jingyue Wu
5c50ab84b3 [SeparateConstOffsetFromGEP] Fixed a bug in rebuilding OR expressions
The two operands of the new OR expression should be NextInChain and TheOther
instead of the two original operands.

Added a regression test in split-gep.ll.

Hao Liu reported this bug, and provded the test case and an initial patch.
Thanks! 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220615 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 17:36:21 +00:00
Simon Pilgrim
c31aaa5a3f [X86][SSE] Vector integer/float conversion memory folding
Tidied up some entries in the folding tables so that they are under the correct comment section (they were categorised as AVX2 instructions when they're AVX1).

Minor patch agreed with qcolombet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220613 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 08:11:20 +00:00
David Majnemer
ae7aa60b2d InstCombine: Remove overzealous asserts
These asserts can trigger if the worklist iteration order is
sufficiently unlucky.  Instead of adding special case logic to handle
these edge conditions, just bail out on trying to transform them:
InstSimplify will get them when it reaches them on the worklist.

This fixes PR21378.

N.B.  No test case is included because any test would rely on the
fragile worklist iteration order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220612 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 07:13:13 +00:00
Rafael Espindola
f4a288c0f0 Allow the C API users to keep relying on the OutMessages parameter.
Should fix the Ocaml tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220611 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 04:31:08 +00:00
Rafael Espindola
e272236d69 Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220610 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 04:07:53 +00:00
Rafael Espindola
72478e59c7 Update the error handling of lib/Linker.
Instead of passing a std::string&, use the new diagnostic infrastructure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220608 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 04:06:10 +00:00
Jingyue Wu
1d1d705a95 [NVPTX] aligned byte-buffers for vector return types
Summary:
Fixes PR21100 which is caused by inconsistency between the declared return type
and the expected return type at the call site. The new behavior is consistent
with nvcc and the NVPTXTargetLowering::getPrototype function.

Test Plan: test/Codegen/NVPTX/vector-return.ll

Reviewers: jholewinski

Reviewed By: jholewinski

Subscribers: llvm-commits, meheff, eliben, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220607 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 03:46:16 +00:00
Rafael Espindola
b31d53a60f Add a test for the -suppress-warnings option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220603 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-25 01:14:15 +00:00
Evgeniy Stepanov
e376441786 [msan] Make -msan-check-constant-shadow a bit stronger.
Allow (under the experimental flag) non-Instructions to participate in MSan checks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220601 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 23:34:15 +00:00
Rafael Espindola
c498284e46 Modernize the error handling of the Materialize function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220600 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 22:50:48 +00:00
Kevin Enderby
44ccedc273 Fix a Mach-O assembler segfault for a subtraction expression with an undefined symbol.
In a Mach-O object file a relocatable expression of the form
SymbolA - SymbolB + constant is allowed when both symbols are
defined in a section.  But when either symbol is undefined it
is an error.

The code was crashing when it had an undefined symbol in this case.
And should have printed a error message using the location information
in the relocation entry.

rdar://18678402


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220599 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 22:39:40 +00:00
Frederic Riss
ab08da75d7 Sink DwarfUnit::constructImportedEntityDIE into DwarfCompileUnit.
So that it has access to getOrCreateGlobalVariableDIE. If we ever support
decsribing using directive in C++ classes (thus requiring support in type
units), it will certainly use another mechanism anyway.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220594 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 21:31:09 +00:00
Simon Pilgrim
44efa200e2 [X86][SSE] Bitcast assertion in XFormVExtractWithShuffleIntoLoad
Minor patch to fix an issue in XFormVExtractWithShuffleIntoLoad where a load is unary shuffled, then bitcast (to a type with the same number of elements) before extracting an element.

An undef was created for the second shuffle operand using the original (post-bitcasted) vector type instead of the pre-bitcasted type like the rest of the shuffle node - this was then causing an assertion on the different types later on inside SelectionDAG::getVectorShuffle.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220592 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 21:04:41 +00:00
Colin LeMahieu
8699f5390b [Hexagon] Resubmission of 220427
Modified library structure to deal with circular dependency between HexagonInstPrinter and HexagonMCInst.
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@220584 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 19:00:32 +00:00
Matt Arsenault
a36665918f Fix copy paste comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220581 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 18:13:10 +00:00
Rafael Espindola
68b02dcd54 Don't ever call materializeAllPermanently during LTO.
To do this, change the representation of lazy loaded functions.

The previous representation cannot differentiate between a function whose body
has been removed and one whose body hasn't been read from the .bc file. That
means that in order to drop a function, the entire body had to be read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220580 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 18:13:04 +00:00
Sanjay Patel
51fa1bcef3 Allow AVX vrsqrtps generation.
This is a follow-on to r220570 that allows a 256-bit (v8f32)
version of vrsqrtps to be generated.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220579 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 17:59:18 +00:00
David Blaikie
7f6ba1758b DebugInfo: Sink DwarfDebug::ScopeVariables down into DwarfFile
(part of refactoring to allow subprogram emission in both the skeleton
and main units to enable -gmlt-like data to be included in the skeleton
for live inlined backtracing purposes)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220578 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 17:57:34 +00:00
Sanjay Patel
be5d8bfddd remove class/function/variable names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220577 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 17:55:59 +00:00
David Blaikie
3ad7d41947 Remove DwarfDebug::FirstCU as it has no use
It was only being used as a flag to identify the lack of debug info from
within endModule - use the section labels for that instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220575 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 17:53:38 +00:00
Sanjay Patel
a46f06efe2 Use rsqrt (X86) to speed up reciprocal square root calcs
This is a first step for generating SSE rsqrt instructions for
reciprocal square root calcs when fast-math is allowed.

For now, be conservative and only enable this for AMD btver2
where performance improves significantly - for example, 29%
on llvm/projects/test-suite/SingleSource/Benchmarks/BenchmarkGame/n-body.c
(if we convert the data type to single-precision float).

This patch adds a two constant version of the Newton-Raphson
refinement algorithm to DAGCombiner that can be selected by any target
via a parameter returned by getRsqrtEstimate()..

See PR20900 for more details:
http://llvm.org/bugs/show_bug.cgi?id=20900

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220570 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 17:02:16 +00:00
Daniel Sanders
2992ea0cb5 [mips] Replace MipsABIEnum with a MipsABIInfo class.
Summary:
No functional change yet, it's just an object replacement for an enum.
It will allow us to gather ABI information in a single place so that we can
start testing for properties of the ABI's instead of the ABI itself.

For example we will eventually be able to use:
  ABI.MinStackAlignmentInBytes()
instead of:
  (isABI_N32() || isABI_N64()) ? 16 : 8
which is clearer and more maintainable.

Reviewers: matheusalmeida

Reviewed By: matheusalmeida

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220568 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 16:15:27 +00:00
Benjamin Kramer
5ea04462dc [Object] Fix MachO's getUuid to return a pointer into the object instead of a dangling ArrayRef.
This works because uuid's are always little endian so it's not swapped.
Fixes use-after-return reported by asan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220567 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 15:52:05 +00:00
Aaron Ballman
a653bf1b12 These functions are not actually defined for NDEBUG or !LLVM_DUMP_ENABLED, so guarding the declarations as well. NFC, silences MSVC warnings in release builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220565 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 15:16:39 +00:00
Daniel Sanders
29e46cd4b7 [mips] Fix >80-column line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220564 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 14:46:00 +00:00
Daniel Sanders
4d2ff459e9 [mips] Remove redundant code in RetCC_MipsN. NFC.
Summary:
i32 is always promoted to i64 so it no longer makes sense to assign i32 to
registers.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220561 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 13:49:54 +00:00
Daniel Sanders
de90aa00ac [mips] For N32/N64, structs must be passed in the upper bits of a register.
Summary:
Most structs were fixed by r218451 but those of between >32-bits and
<64-bits remained broken since they were not marked with [ASZ]ExtUpper.
This patch fixes the remaining cases by using
CCPromoteToUpperBitsInType<i64> on i64's in addition to i32 and smaller.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220556 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 13:09:19 +00:00
Oliver Stannard
9bb3f37aa4 [AArch64] Fix fast-isel of cbz of i1, i8, i16
This fixes a miscompilation in the AArch64 fast-isel which was
triggered when a branch is based on an icmp with condition eq or ne,
and type i1, i8 or i16. The cbz instruction compares the whole 32-bit
register, so values with the bottom 1, 8 or 16 bits clear would cause
the wrong branch to be taken.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220553 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 09:54:41 +00:00
Timur Iskhodzhanov
806ccfff11 Update test/MC/ARM/coff-debugging-secrel.ll expectations to fix breakage caused by r220544
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220548 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 06:24:07 +00:00
Marcello Maggioni
77348a5703 Added reset of LexicalScope in LiveDebugVariables reset function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220545 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 02:46:50 +00:00
Timur Iskhodzhanov
92e132a36f Fix PR21189 -- Emit symbol subsection required to debug LLVM-built binaries with VS2012+
Reviewed at http://reviews.llvm.org/D5772

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220544 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 01:27:45 +00:00
David Blaikie
8a5eafb58d DebugInfo: Remove DwarfDebug::addScopeVariable now that it's just a trivial wrapper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220542 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 00:43:47 +00:00
Ahmed Bougacha
636864d8e7 Make test for r220533 more robust by using GPR pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220541 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 00:03:46 +00:00
Adam Nemet
7f7bf0da6a [AVX512] FMA support for the 231 variants
This is asm/diasm-only support, similar to AVX.

For ISeling the register variant, they are no different from 213 other than
whether the multiplication or the addition operand is destructed.

For ISeling the memory variant, i.e. to fold a load, they are no different
than the 132 variant.  The addition operand (op3) in both cases can come from
memory.  Again the ony difference is which operand is destructed.

There could be a post-RA pass that would convert a 213 or 132 into a 231.

Part of <rdar://problem/17082571>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220540 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 00:03:00 +00:00
Adam Nemet
97a3cd4383 [AVX512] Introduce fma3p_forms from AVX
This multiclass generates the different forms: 213, 231, 132 in AVX.

132 in AVX512 is a separate class but I am planning to use this same
multiclass to generate 231 relying on the nice the null_frag trick from AVX to
disable codegen pattern for 231.

No functionality change, no change in X86.td.expanded except for the different
instruction definition names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220539 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-24 00:02:55 +00:00
Nick Lewycky
c08a7201b7 If requested, apply function merging at -O0 too. It's useful there to reduce the time to compile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220537 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 23:49:31 +00:00
Timur Iskhodzhanov
da45b2bdbd Make getDISubprogram(const Function *F) available in LLVM
Reviewed at http://reviews.llvm.org/D5950

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220536 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 23:46:28 +00:00
Ahmed Bougacha
17c1e34c12 [SelectionDAG] Teach the vector scalarizer about FP conversions.
This adds support for legalization of instructions of the form:

  [fp_conv] <1 x i1> %op to <1 x double>

where fp_conv is one of fpto[us]i, [us]itofp.  This used to assert
because they were simply missing from the vector operand scalarizer.

A similar problem arose in r190830, with trunc instead.

Fixes PR20778.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220533 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 22:49:25 +00:00
Ahmed Bougacha
54d95a7074 Update comment and fix typos in assert message. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220531 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 22:40:34 +00:00
Juergen Ributzka
c08387e220 Update llvm.donothing documentation.
llvm.donothing is no longer the only intrinsic that can be invoked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220530 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 22:36:13 +00:00
Tim Northover
c0ecebb32b ScheduleDAG: record PhysReg dependencies represented by CopyFromReg nodes
x86's CMPXCHG -> EFLAGS consumer wasn't being recorded as a real EFLAGS
dependency because it was represented by a pair of CopyFromReg(EFLAGS) ->
CopyToReg(EFLAGS) nodes. ScheduleDAG was expecting the source to be an
implicit-def on the instruction, where the result numbers in the DAG and the
Uses list in TableGen matched up precisely.

The Copy notation seems much more robust, so this patch extends ScheduleDAG
rather than refactoring x86.

Should fix PR20376.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220529 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 22:31:48 +00:00
David Blaikie
991327143f 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
2014-10-23 22:27:50 +00:00
Timur Iskhodzhanov
13535f412a 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
2014-10-23 22:25:31 +00:00
David Blaikie
48ba51a8cd DebugInfo: Sink DwarfDebug::addNonArgumentScopeVariable into DwarfFile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220520 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 22:04:30 +00:00
Hans Wennborg
e4e2ea6839 MachODump.cpp: fix MSVC build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220518 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-23 21:59:17 +00:00