Commit Graph

104405 Commits

Author SHA1 Message Date
Bill Schmidt
4cef3fb022 [PPC64LE] Generate correct little-endian code for v16i8 multiply
The existing code in PPCTargetLowering::LowerMUL() for multiplying two
v16i8 values assumes that vector elements are numbered in big-endian
order.  For little-endian targets, the vector element numbering is
reversed, but the vmuleub, vmuloub, and vperm instructions still
assume big-endian numbering.  To account for this, we must adjust the
permute control vector and reverse the order of the input registers on
the vperm instruction.

The existing test/CodeGen/PowerPC/vec_mul.ll is updated to be executed
on powerpc64 and powerpc64le targets as well as the original powerpc
(32-bit) target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210474 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 16:06:29 +00:00
Evgeniy Stepanov
35d5a437ea Fix test in r210472.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210473 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 14:48:53 +00:00
Evgeniy Stepanov
24f5e55fce [msan] Workaround for invalid origins in shufflevector.
Makes origin propagation ignore literal undef operands, and,
in general, any operand we don't have origin for.

https://code.google.com/p/memory-sanitizer/issues/detail?id=56


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210472 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 14:29:34 +00:00
NAKAMURA Takumi
5b7ac8ba18 llvm/test/CodeGen/X86/2014-05-29-factorial.ll: Relax an expression to match Win32 x64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210471 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 14:20:23 +00:00
Sasa Stankovic
49b83e1e76 [mips] Fix a bug for NaCl target - Don't report the error when non-dangerous
load/store is in branch delay slot.

Differential Revision: http://llvm-reviews.chandlerc.com/D4048

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210470 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 14:09:28 +00:00
Andrea Di Biagio
592d439efe [X86] Avoid emitting unnecessary test instructions.
This patch teaches the backend how to check for the 'NoSignedWrap' flag on
binary operations to improve the emission of 'test' instructions.

If the result of a binary operation is known not to overflow we know that
resetting the Overflow flag is unnecessary and so we can avoid emitting
the test instruction.

Patch by Marcello Maggioni.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210468 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 12:34:50 +00:00
Andrea Di Biagio
bc72c8f0d8 [DAG] Expose NoSignedWrap, NoUnsignedWrap and Exact flags to SelectionDAG.
This patch modifies SelectionDAGBuilder to construct SDNodes with associated
NoSignedWrap, NoUnsignedWrap and Exact flags coming from IR BinaryOperator
instructions.

Added a new SDNode type called 'BinaryWithFlagsSDNode' to allow accessing
nsw/nuw/exact flags during codegen.

Patch by Marcello Maggioni.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210467 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 12:32:53 +00:00
Alexey Volkov
a2bc6951a0 [X86] Use ADD/SUB instead of INC/DEC for Silvermont
According to Intel Software Optimization Manual 
on Silvermont INC or DEC instructions require 
an additional uop to merge the flags.
As a result, a branch instruction depending 
on an INC or a DEC instruction incurs a 1 cycle penalty.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210466 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 11:40:41 +00:00
Artyom Skrobov
a8d18fe946 [AArch64] Missing aliases for CMP/CMN [W]SP with no shift
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210464 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 11:10:14 +00:00
Jeroen Ketema
503447efba [docs] Fix typo, align comments, fix syntax highlighting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210462 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 10:12:29 +00:00
Zoran Jovanovic
0c7ac480e2 [mips][mips64r6] Add LDPC instruction
Differential Revision: http://reviews.llvm.org/D3822


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210460 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 09:49:51 +00:00
Evgeniy Stepanov
503af43f3c Fix line numbers for code inlined from __nodebug__ functions.
Instructions from __nodebug__ functions don't have file:line
information even when inlined into no-nodebug functions. As a result,
intrinsics (SSE and other) from <*intrin.h> clang headers _never_
have file:line information.

With this change, an instruction without !dbg metadata gets one from
the call instruction when inlined.

Fixes PR19001.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210459 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 09:09:19 +00:00
Evgeniy Stepanov
544c895d71 [msan] Fix vector pack intrinsic handling.
This fixes a crash on MMX intrinsics, as well as a corner case in handling of
all unsigned pack intrinsics.

PR19953.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210454 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 08:40:16 +00:00
Matt Arsenault
6959336f6e R600: Add more and testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210453 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 08:36:53 +00:00
Patrik Hagglund
cbbf570823 Fix gcc warning (enumeral and non-enumeral type in conditional expression)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210450 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 07:35:07 +00:00
Chad Rosier
451cc566c1 [AArch64] Fix the ordering of the accumulate operand in SchedRW list.
Patch by Dave Estes <cestes@codeaurora.org>
http://reviews.llvm.org/D4037

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210446 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 01:54:00 +00:00
Chad Rosier
0607e82c0a [AArch64] When combining constant mul of power of 2 plus/minus 1, prefer shift
plus add.  The shift can be folded into the add.  This only effects codegen
when the constant is 3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210445 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 01:25:51 +00:00
Jingyue Wu
09d6a9040c [SeparateConstOffsetFromGEP] inbounds zext => sext for better splitting
For each array index that is in the form of zext(a), convert it to sext(a)
if we can prove zext(a) <= max signed value of typeof(a). The conversion
helps to split zext(x + y) into sext(x) + sext(y).

Reviewed in http://reviews.llvm.org/D4060



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210444 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 23:49:34 +00:00
NAKAMURA Takumi
66a3b9049b Escape "@function" with \verbatim. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210443 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 23:25:02 +00:00
Craig Topper
b177041dfa [C++11] Use 'nullptr'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210442 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 22:29:17 +00:00
Jingyue Wu
d8fdbb2ea8 [SeparateConstOffsetFromGEP] Fix an illegitimate optimization on zext
zext(a + b) != zext(a) + zext(b) even if a + b >= 0 && b >= 0.

e.g., a = i4 0b1111, b = i4 0b0001
zext a + b to i8 = zext 0b0000 to i8 = 0b00000000
(zext a to i8) + (zext b to i8) = 0b00001111 + 0b00000001 = 0b00010000


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210439 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 20:19:38 +00:00
Jingyue Wu
b9422f1d77 Refactor canonicalizing array indices to a helper function
No functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210438 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 20:15:45 +00:00
Jingyue Wu
724d2a8f1a [SeparateConstOffsetFromGEP] make two tests more strict
inbounds are not necessary in these two tests. zext(a +nuw b) = zext(a) +
zext(b) should hold with or without inbounds.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210437 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 20:01:42 +00:00
David Blaikie
cab673f638 SmallVector: Improve test coverage for insert with repetition
To test cases that involve actual repetition (> 1 elements), at least
one element before the insertion point, and some elements of the
original range that still fit in that range space after insertion.

Actually we need coverage for the inverse case too (where no elements
after the insertion point fit into the previously allocated space), but
this'll do for now, and I might end up rewriting bits of SmallVector to
avoid that special case anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210436 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 19:33:40 +00:00
Tobias Grosser
5e66eea5ba ScalarEvolution: Derive element size from the type of the loaded element
Before, we where looking at the size of the pointer type that specifies the
location from which to load the element. This did not make any sense at all.

This change fixes a bug in the delinearization where we failed to delinerize
certain load instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210435 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 19:21:20 +00:00
David Blaikie
62dd118135 SmallVector: More movable improvements - don't copy elements to make space when inserting repeated elements.
Also split and improve tests a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210433 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 19:12:31 +00:00
David Blaikie
aa72ac7dad SmallVector: Move, don't copy, elements to make space for an insertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210432 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 19:12:28 +00:00
Saleem Abdulrasool
aa53e49779 X86: simplify data layout calculation
X86Subtarget::isTargetCygMing || X86Subtarget::isTargetKnownWindowsMSVC is
equivalent to all Windows environments.  Simplify the check to isOSWindows.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210431 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 19:08:36 +00:00
David Blaikie
16aac741f6 SmallVectorTest: Remove some more robust checks added in r210429 since they caught some bugs I haven't fixed yet.
Specifically this caused inserting an element from a SmallVector into
itself when such an insertion would cause a reallocation. We have code
to handle this for non-reallocating cases, but it's not robust against
reallocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210430 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 17:33:47 +00:00
David Blaikie
9262e52075 Fix some more moving-from-moved-from objects issues in SmallVector
(& because it makes it easier to test, this also improves
correctness/performance slightly by moving the last element in an insert
operation, rather than copying it)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210429 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 16:55:13 +00:00
Stephen Canon
bef256f49b APFloat: x - NaN needs to flip the signbit of NaN when x is a number.
Because we don't have a separate negate( ) function, 0 - NaN does double-duty as the IEEE-754 negate( ) operation, which (unlike most FP ops) *does* attach semantic meaning to the signbit of NaN.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210428 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 16:53:31 +00:00
David Blaikie
c50f986b4d AsmMatchers: Use unique_ptr to manage ownership of MCParsedAsmOperand
I saw at least a memory leak or two from inspection (on probably
untested error paths) and r206991, which was the original inspiration
for this change.

I ran this idea by Jim Grosbach a few weeks ago & he was OK with it.
Since it's a basically mechanical patch that seemed sufficient - usual
post-commit review, revert, etc, as needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210427 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 16:18:35 +00:00
David Blaikie
e570687bd8 Ensure SmallVector::insert doesn't overwrite the last element in the range with the already-moved-from value
This would cause the last element in a range to be in a moved-from state
after an insert at a non-end position, losing that value entirely in the
process.

Side note: move_backward is subtle. It copies [A, B) to C-1 and down.
(the fact that it decrements both the second and third iterators before
the first movement is the subtle part... kind of surprising, anyway)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210426 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 16:00:02 +00:00
Alp Toker
6e0ab2f54c Revert "Do materialize for floating point"
1) The commit was made despite profound lack of understanding:

   "I did not understand the comment about using dyn_cast instead of isa. I will
   commit as is and make the update after. You can explain what you meant to me."

   Commit first, understand later isn't OK.

2) Review comments were simply ignored:

   "Can you edit the summary to describe what the patch is for? It appears to be
   a list of commits at the moment."

3) The patch got LGTM'd off-list without any indication of readiness.

4) The public mailing list was excluded from patch review so all of this was
   hidden from the community.

This reverts commit r210414.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210424 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 09:13:42 +00:00
Alp Toker
aa59bc24a5 Remove outdated CMake MSVC workaround
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210421 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 07:37:17 +00:00
Alp Toker
cd1f08ca2e Remove redundant typedef from MCAsmParserSemaCallback
The last use has been removed in clang r210418.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210419 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 05:14:54 +00:00
Alp Toker
06744bb19e Make InlineAsmIdentifierInfo forward-declarable
This helps localize header inclusion in the frontend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210417 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 05:07:38 +00:00
Saleem Abdulrasool
ea3ab85c01 MC: fix text section characteristics for WoA
link.exe requires that the text section has the IMAGE_SCN_MEM_16BIT flag set.
Otherwise, it will treat the function as ARM.  If this occurs, then jumps to the
function will fail, switching from thumb to ARM mode execution.

With this change, it is possible to link using the MSVC linker as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210415 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 03:57:49 +00:00
Reed Kotler
4a0c1d135e Do materialize for floating point
Summary:
start to do simple constants

finish simplestore

add test case

format

Merge branch 'master' into 1756_8

Add basic functionality for assignment of ints. This creates a lot of core infrastructure in which to add, with little effort, quite a bit more to mips fast-isel

Merge branch 'master' into 1756_8

Add basic functionality for assignment of ints. This creates a lot of core infrastructure in which to add, with little effort, quite a bit more to mips fast-isel

in progress

finish integer materialize

test cases

test cases

in progress

Finish up fast-isel materialize for ints.

Finish materialize for ints

test cases

simplestorei.ll

Merge branch 'master' into 1756_8

fix fp constants for fast-isel

Merge branch '1758_1' of dmz-portal.mips.com:llvm into 1758_1

in progress

lastest for fp materialization

clean up

Merge branch 'master' into 1758_1

formatting

add test case

finish test case

Merge branch 'master' into 1758_2

Test Plan:
simplestore.ll

simplestore.ll

Reviewers: dsanders

Reviewed By: dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210414 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 03:30:32 +00:00
Reed Kotler
cf7742cb63 start to clean up buildMI calls in mips fast-isel
Summary: Merge branch 'master' into 1758_6

Test Plan:
No functionality change. Run "make check" and run test-suite.
Because our servers are not yet running again I have not yet run test-suite.
I will further review myself before submission.

Reviewers: dsanders

Reviewed By: dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210413 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 03:04:42 +00:00
Alp Toker
2aa472f4bd Re-enable ARM ELF tests
r210408 inadvertently disabled them when X86 is not selected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210412 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 02:46:02 +00:00
Alp Toker
11e082eb54 Fix build when no native target is enabled
The JITTests and MCJITTests unit test targets require a native arch with JIT
support, otherwise fail to link.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210411 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 02:45:56 +00:00
Reed Kotler
b8ff7273c6 include MipsGenFastISel.inc
Summary:
Included this file which is needed to enable tablegen generated functionality
for fast mips-isel

Test Plan:
This has no visible functionality by itself but just adding the include
file creates some issues so I have it as a separate patch.

Reviewers: dsanders

Reviewed By: dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210410 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 02:08:43 +00:00
Saleem Abdulrasool
e668525dd1 test: add test case for SVN r210406
Add missing test case for constructor section selection.  Thanks David Blaikie!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210409 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 01:27:32 +00:00
Saleem Abdulrasool
e231836fe4 test: move some tests into ARM directory
Rather than requiring ARM support for the ELF tests (which is odd), move the
tests that require ARM into a subdirectory to use lit to disable them if the
support is not present.  Play this game to prevent disabling the ELF tests on
the Windows build bots as they have caught issues in the past with interactions
between various platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210408 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 01:04:05 +00:00
Saleem Abdulrasool
eb5f5ae200 MC: make ELF .type handling more GNU AS compatible
GAS documents the .type directive as having an optional comma following the key
symbol name when using the STT_<TYPE_IN_UPPER_CASE> form.  However, it treats
the comma as optional in all cases.  This makes the IAS support both forms of
inputs.  Furthermore, the prefixed forms take either the upper case name or the
lower case alias.

The tests are split into two separate sets as the hash character serves as a
comment character on x86, which is tested in the second set by using arm-elf
which uses the at symbol as a comment character.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210407 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 00:34:34 +00:00
Saleem Abdulrasool
a926467222 MC: fix ctor/dtor section for windows-itanium
This adjusts the section setup for the windows-itanium environment.  This
environment does not report to be a known windows msvc environment, even though
it is (nearly) identical to the MSVC environment for C code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210406 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 00:34:27 +00:00
Saleem Abdulrasool
83444b887d MC: whitespace, grouping for COFF section setup
Add some whitespace, combine two sequential conditionals into a single one.
Reformat some section definitions to maintain uniformity in the function.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210405 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 00:34:23 +00:00
Alp Toker
3c9b41b949 Fix typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210401 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-07 21:23:09 +00:00
Alp Toker
e4dda5f030 Build fix: remove initializeJumpInstrTablesPass() call from LTO
This was incurring an unsatisfied dependency on CodeGen from LTO breaking
shared builds:

Undefined symbols for architecture x86_64:
  "llvm::initializeJumpInstrTablesPass(llvm::PassRegistry&)", referenced from:
      llvm::LTOCodeGenerator::initializeLTOPasses() in LTOCodeGenerator.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Removed as a temporary measure pending feedback from the author.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210400 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-07 20:39:53 +00:00