Commit Graph

175887 Commits

Author SHA1 Message Date
Chad Rosier 3fe0c876c4 [AArch64] Fix the ordering of the accumulate operand in SchedRW list.
Patch by Dave Estes <cestes@codeaurora.org>
http://reviews.llvm.org/D4037

llvm-svn: 210446
2014-06-09 01:54:00 +00:00
Chad Rosier d96e9f14ee [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.

llvm-svn: 210445
2014-06-09 01:25:51 +00:00
Jingyue Wu 5c7b1aed5d [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

llvm-svn: 210444
2014-06-08 23:49:34 +00:00
NAKAMURA Takumi 2d173b5302 Escape "@function" with \verbatim. [-Wdocumentation]
llvm-svn: 210443
2014-06-08 23:25:02 +00:00
Craig Topper 66f09ad041 [C++11] Use 'nullptr'.
llvm-svn: 210442
2014-06-08 22:29:17 +00:00
Joey Gouly 41181d140c Convert tests I recently add to use -verify instead of FileCheck.
This uncovered something strange. Diagnostics for InlineAsm have source locations
that don't really map to where they are within the .c source file.

llvm-svn: 210440
2014-06-08 21:28:54 +00:00
Jingyue Wu 01ceeb190d [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

llvm-svn: 210439
2014-06-08 20:19:38 +00:00
Jingyue Wu 48a5abeec0 Refactor canonicalizing array indices to a helper function
No functionality changes.

llvm-svn: 210438
2014-06-08 20:15:45 +00:00
Jingyue Wu f2b85881d4 [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.

llvm-svn: 210437
2014-06-08 20:01:42 +00:00
David Blaikie 1848660d1f 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.

llvm-svn: 210436
2014-06-08 19:33:40 +00:00
Tobias Grosser 40ac10085a 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.

llvm-svn: 210435
2014-06-08 19:21:20 +00:00
David Blaikie 402cb2c981 SmallVector: More movable improvements - don't copy elements to make space when inserting repeated elements.
Also split and improve tests a bit.

llvm-svn: 210433
2014-06-08 19:12:31 +00:00
David Blaikie ae8a932ed8 SmallVector: Move, don't copy, elements to make space for an insertion.
llvm-svn: 210432
2014-06-08 19:12:28 +00:00
Saleem Abdulrasool 4acde1d4dc X86: simplify data layout calculation
X86Subtarget::isTargetCygMing || X86Subtarget::isTargetKnownWindowsMSVC is
equivalent to all Windows environments.  Simplify the check to isOSWindows.
NFC.

llvm-svn: 210431
2014-06-08 19:08:36 +00:00
David Blaikie 8ef8b7373e 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.

llvm-svn: 210430
2014-06-08 17:33:47 +00:00
David Blaikie 40d4e34a1f 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)

llvm-svn: 210429
2014-06-08 16:55:13 +00:00
Stephen Canon d327828141 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.

llvm-svn: 210428
2014-06-08 16:53:31 +00:00
David Blaikie 960ea3f018 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.

llvm-svn: 210427
2014-06-08 16:18:35 +00:00
David Blaikie 789df06f87 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)

llvm-svn: 210426
2014-06-08 16:00:02 +00:00
Simon Atanasyan 8804e5cb49 [Mips] Make got16.test test case independent from external input files.
llvm-svn: 210425
2014-06-08 11:33:05 +00:00
Alp Toker 267d1f1cc9 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.

llvm-svn: 210424
2014-06-08 09:13:42 +00:00
Craig Topper 416fa34b87 [C++11] Use 'nullptr'. Unittests edition.
llvm-svn: 210423
2014-06-08 08:38:12 +00:00
Craig Topper 69186e731f [C++11] Use 'nullptr'. Tools edition.
llvm-svn: 210422
2014-06-08 08:38:04 +00:00
Alp Toker 71e07869af Remove outdated CMake MSVC workaround
llvm-svn: 210421
2014-06-08 07:37:17 +00:00
Alp Toker 1b935a88d5 Split out inline asm parsing into ParseStmtAsm.cpp
This change isolates various llvm/MC headers from the rest of the parser and
better aligns with the existing SemaStmtAsm.cpp.

No change in functionality, code move only.

llvm-svn: 210420
2014-06-08 05:40:04 +00:00
Alp Toker 4700163b53 Remove redundant typedef from MCAsmParserSemaCallback
The last use has been removed in clang r210418.

llvm-svn: 210419
2014-06-08 05:14:54 +00:00
Alp Toker 1039927808 Don't include llvm/MC/MCParser throughout all of Sema
Requires LLVM r210417.

llvm-svn: 210418
2014-06-08 05:11:37 +00:00
Alp Toker f945e7b672 Make InlineAsmIdentifierInfo forward-declarable
This helps localize header inclusion in the frontend.

llvm-svn: 210417
2014-06-08 05:07:38 +00:00
David Majnemer c986fcc9aa MS ABI: Simplify microsoft mangling of template instantiations
Use mangled template instantiation name as key for back references.
Templates have their own context for back references, so their mangling
is always the same regardless of context. This avoids mangling template
instantiations twice.

Patch by Agustín Bergé!

llvm-svn: 210416
2014-06-08 04:51:13 +00:00
Saleem Abdulrasool 70a0206e4b 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.

llvm-svn: 210415
2014-06-08 03:57:49 +00:00
Reed Kotler 491c33e955 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

llvm-svn: 210414
2014-06-08 03:30:32 +00:00
Reed Kotler fb77bc9806 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

llvm-svn: 210413
2014-06-08 03:04:42 +00:00
Alp Toker 6de91b5671 Re-enable ARM ELF tests
r210408 inadvertently disabled them when X86 is not selected.

llvm-svn: 210412
2014-06-08 02:46:02 +00:00
Alp Toker 7bfa48b10b 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.

llvm-svn: 210411
2014-06-08 02:45:56 +00:00
Reed Kotler 9fe25f35fe 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

llvm-svn: 210410
2014-06-08 02:08:43 +00:00
Saleem Abdulrasool f0806cd75d test: add test case for SVN r210406
Add missing test case for constructor section selection.  Thanks David Blaikie!

llvm-svn: 210409
2014-06-08 01:27:32 +00:00
Saleem Abdulrasool 46f1d9fb5d 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.

llvm-svn: 210408
2014-06-08 01:04:05 +00:00
Saleem Abdulrasool 13b414a332 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.

llvm-svn: 210407
2014-06-08 00:34:34 +00:00
Saleem Abdulrasool ed7fc4b775 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.

llvm-svn: 210406
2014-06-08 00:34:27 +00:00
Saleem Abdulrasool a35f04aa90 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.

llvm-svn: 210405
2014-06-08 00:34:23 +00:00
Alp Toker 84c424089f DeclObjC: Fix comments about bad API
What's going on here isn't overriding but rather the sketchy practice of member
hiding (shadowing of base members).

llvm-svn: 210404
2014-06-07 23:31:01 +00:00
Alp Toker 541d5070bf Avoid dubious IdentifierInfo::getNameStart() uses
These cases in particular were incurring an extra strlen() when we already knew
the length. They appear to be leftovers from when the interfaces worked with C
strings that have continued to compile due to the implicit StringRef ctor.

llvm-svn: 210403
2014-06-07 23:30:53 +00:00
Alp Toker 4925ba7ffe StringRefize TargetInfo::getABI()
llvm-svn: 210402
2014-06-07 23:30:42 +00:00
Alp Toker 5c53639492 Fix typos
llvm-svn: 210401
2014-06-07 21:23:09 +00:00
Alp Toker 17dd8efe9e 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.

llvm-svn: 210400
2014-06-07 20:39:53 +00:00
Saleem Abdulrasool 90386ad60a ARM: correct assertion for long-calls on WoA
COFF/PE, so the relocation model is never static.  Loosen the assertion
accordingly.  The relocation can still be emitted properly, as it will be
converted to an IMAGE_REL_ARM_ADDR32 which will be resolved by the loader
taking the base relocation into account.  This is necessary to permit the
emission of long calls which can be controlled via the -mlong-calls option in
the driver.

llvm-svn: 210399
2014-06-07 20:29:27 +00:00
Saleem Abdulrasool aea65e9b13 Driver: add -m{,no-}long-calls support
This mirrors the GCC option for the ARM backend.  This option enables the
backend option "-enable-arm-long-calls".  The default behaviour is that this is
disabled due to the slight overhead of the generated calls.

If the target of jumps are greater than 64M range of offset-based jumps, then
the target address must be loaded into a register to make an indirect jump.  The
backend support for this has been present, but was not previously controllable
by the proper flag.

llvm-svn: 210398
2014-06-07 19:32:38 +00:00
Saleem Abdulrasool c86b54c86d tools: add a high level explanation for WoA EH data
Add a brief explanation of the data section layout for the unwind data that the
Windows on ARM EH models.  This is simply to provide a rough idea of the layout
of the code involved in the decoding of the unwinding.  Details on the involved
data structures are available in the associated support header.  The bulk of it
is related to printing out the byte-code to help validate generation of WoA EH.

No functional change.

llvm-svn: 210397
2014-06-07 19:23:07 +00:00
Peter Zotov c86d1c1e5e [OCaml] Commit missing parts of r210395
llvm-svn: 210396
2014-06-07 15:53:28 +00:00
Peter Zotov 7ce15f7684 [OCaml] Introduce an llmdkind abstract type.
Patch by Gabriel Radanne.

While this commit technically breaks API, no code should have supplied
the integer IDs directly, and thus no code should break.

llvm-svn: 210395
2014-06-07 15:15:10 +00:00