OSDN Git Service
Rafael Espindola [Wed, 8 Jul 2015 21:07:18 +0000 (21:07 +0000)]
Use a raw_svector_ostream and simplify a loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241727
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 8 Jul 2015 21:03:47 +0000 (21:03 +0000)]
[Win64] Only treat some functions as having the Win64 convention
All the usual X86 target-specific conventions are collapsed to the
normal Win64 convention, but the custom conventions like GHC and webkit
should not be.
Previously we would assume that the caller allocated 32 bytes of shadow
space for us, which is not how webkit_jscc or other custom conventions
are supposed to work.
Based on a patch by peavo@outlook.com.
Fixes PR24051.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241725
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 8 Jul 2015 20:47:32 +0000 (20:47 +0000)]
Start adding support for writing archives in BSD format.
No support for the symbol table yet (but will hopefully add it today).
We always use the long filename format so that we can align the member,
which is an advantage of the BSD format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241721
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 8 Jul 2015 20:22:20 +0000 (20:22 +0000)]
MIR Parser: Use source locations for MBB naming errors.
This commit changes the type of the field 'Name' in the struct
'yaml::MachineBasicBlock' from 'std::string' to 'yaml::StringValue'. This change
allows the MIR parser to report errors related to the MBB name with the proper
source locations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241718
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 8 Jul 2015 19:32:39 +0000 (19:32 +0000)]
early exits -> less indenting; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241716
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 8 Jul 2015 19:22:28 +0000 (19:22 +0000)]
[Hexagon] Implement commoning of GetElementPtr instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241714
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 8 Jul 2015 19:00:46 +0000 (19:00 +0000)]
LibDriver: Fix output path inference.
The inferred output file name is based on the first input file, not the
first one with extension .obj. The output file was also being written to
the wrong directory; it needs to be written to whichever directory on the
libpath it was found in. This change fixes both issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241710
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 8 Jul 2015 18:47:38 +0000 (18:47 +0000)]
[LAA] Add missing debug output after r239285
r239285 ([LoopAccessAnalysis] Teach LAA to check the memory dependence
between strided accesses.) introduced a new case under
MemoryDepChecker::isDependent. We normally have debug output for each
case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241707
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Wed, 8 Jul 2015 18:21:09 +0000 (18:21 +0000)]
Object/COFF: Fix import library's getNameType method.
This expression to extract bits were simply wrong.
I'm going to test this functionality from LLD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241703
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 8 Jul 2015 18:09:39 +0000 (18:09 +0000)]
[SEH] Add missing test case from previous realignment commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241700
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 8 Jul 2015 18:08:52 +0000 (18:08 +0000)]
[SEH] Ensure that empty __except blocks have their own BB
The 32-bit lowering assumed that WinEHPrepare had this invariant.
WinEHPrepare did it for C++, but not SEH. The result was that we would
insert calls to llvm.x86.seh.restoreframe in normal basic blocks, which
corrupted the frame pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241699
91177308-0d34-0410-b5e6-
96231b3b80d8
James Y Knight [Wed, 8 Jul 2015 18:08:36 +0000 (18:08 +0000)]
Expand LangRef.html's documentation on LLVM's inline assembly.
While trying to figure out how this was all supposed to work, I
figured I'd start writing down some documentation, since it was
basically completely missing.
Differential Revision: http://reviews.llvm.org/D10816
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241698
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 8 Jul 2015 17:41:53 +0000 (17:41 +0000)]
MC: Make MCSubtargetInfo::isCPUStringValid() const, NFC
This method doesn't modify any members, so it should be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241694
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 8 Jul 2015 17:30:55 +0000 (17:30 +0000)]
MC: Constify MCSubtargetInfo in getDeprecationInfo(), NFC
There's no reason to be able to mutate `MCSubtargetInfo` in
`getDeprecationInfo()`. Constify the reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241693
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 8 Jul 2015 17:26:24 +0000 (17:26 +0000)]
Inline function into only use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241692
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 8 Jul 2015 17:08:26 +0000 (17:08 +0000)]
Add a helper function to reduce a bit of code duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241691
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Wed, 8 Jul 2015 16:33:21 +0000 (16:33 +0000)]
Cosmetic cleanups - NFC
Remove commented lines, trailing whitespace, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241687
91177308-0d34-0410-b5e6-
96231b3b80d8
James Y Knight [Wed, 8 Jul 2015 16:25:12 +0000 (16:25 +0000)]
[SPARC] Cleanup handling of the Y/ASR registers.
- Implement copying ASR to/from GPR regs.
- Mark ASRs as non-allocatable, so it won't try to arbitrarily use
them inappropriately.
- Instead of inserting explicit WRASR/RDASR nodes in the MUL/DIV
routines, just do normal register copies.
- Also...mark div as using Y, not just writing it.
Added a test case with some code which previously died with an
assertion failure (with -O0), or produced wrong code (otherwise).
(Third time's the charm?)
Differential Revision: http://reviews.llvm.org/D10401
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241686
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 8 Jul 2015 16:16:15 +0000 (16:16 +0000)]
Use a range loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241685
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 8 Jul 2015 14:47:34 +0000 (14:47 +0000)]
[Hexagon] Generate "insert" instructions more aggressively
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241683
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 8 Jul 2015 14:34:13 +0000 (14:34 +0000)]
Revert 241681: causes Windows builds to fail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241682
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 8 Jul 2015 14:22:27 +0000 (14:22 +0000)]
[Hexagon] Generate "insert" instructions more aggressively
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241681
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Wed, 8 Jul 2015 10:12:40 +0000 (10:12 +0000)]
[yaml2obj] Align section content using AddressAlign field's value
Use AddressAlign field's value to properly align sections content in the
yaml2obj tool. Before this change the yaml2obj ignored AddressAlign and
always aligned section on 16 bytes boundary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241674
91177308-0d34-0410-b5e6-
96231b3b80d8
Silviu Baranga [Wed, 8 Jul 2015 09:16:33 +0000 (09:16 +0000)]
[LAA] Merge memchecks for accesses separated by a constant offset
Summary:
Often filter-like loops will do memory accesses that are
separated by constant offsets. In these cases it is
common that we will exceed the threshold for the
allowable number of checks.
However, it should be possible to merge such checks,
sice a check of any interval againt two other intervals separated
by a constant offset (a,b), (a+c, b+c) will be equivalent with
a check againt (a, b+c), as long as (a,b) and (a+c, b+c) overlap.
Assuming the loop will be executed for a sufficient number of
iterations, this will be true. If not true, checking against
(a, b+c) is still safe (although not equivalent).
As long as there are no dependencies between two accesses,
we can merge their checks into a single one. We use this
technique to construct groups of accesses, and then check
the intervals associated with the groups instead of
checking the accesses directly.
Reviewers: anemet
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10386
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241673
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 8 Jul 2015 08:07:57 +0000 (08:07 +0000)]
[X86][SSE] Added (V)ROUNDSD + (V)ROUNDSS stack folding support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241671
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Wed, 8 Jul 2015 06:57:24 +0000 (06:57 +0000)]
[yaml2obj] Use regex to match sections offsets. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241669
91177308-0d34-0410-b5e6-
96231b3b80d8
Karthik Bhat [Wed, 8 Jul 2015 03:55:47 +0000 (03:55 +0000)]
Allow constfolding of llvm.sin.* and llvm.cos.* intrinsics
This patch const folds llvm.sin.* and llvm.cos.* intrinsics whenever feasible.
Differential Revision: http://reviews.llvm.org/D10836
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241665
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 8 Jul 2015 02:35:43 +0000 (02:35 +0000)]
Revert r241621, "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working."
It broke the build that relies on LLVM_EXTERNAL_CLANG_*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241663
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 8 Jul 2015 02:04:15 +0000 (02:04 +0000)]
llvm-objdump: Replace the -macho -raw option with a generic -raw-clang-ast
option that works with all object container formats.
Now that clang modules/PCH are object containers this option is useful to
to construct pipes like
llvm-objdump -raw-clang-ast foo.pcm | llvm-bcanalyzer -
to inspect the AST contents in a PCH container.
Will be tested via clang.
Belatedly addresses review feedback for r233390.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241659
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 8 Jul 2015 01:00:38 +0000 (01:00 +0000)]
Remove IsLittleEndian from TargetLowering and redirect to DataLayout
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.
Reviewers: echristo
Subscribers: llvm-commits, rafael, yaron.keren
Differential Revision: http://reviews.llvm.org/D11017
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241655
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 8 Jul 2015 01:00:31 +0000 (01:00 +0000)]
Redirect DataLayout from TargetMachine to Module in SjLjEHPrepare
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.
Reviewers: echristo
Subscribers: yaron.keren, rafael, llvm-commits
Differential Revision: http://reviews.llvm.org/D11009
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241654
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 7 Jul 2015 23:45:58 +0000 (23:45 +0000)]
[WinEH] Make llvm.x86.seh.restoreframe work for stack realignment prologues
The incoming EBP value points to the end of a local stack allocation, so
we can use that to restore ESI, the base pointer. Once we do that, we
can use local stack allocations. If we know we need stack realignment,
spill the original frame pointer in the prologue and reload it after
restoring ESI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241648
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Tue, 7 Jul 2015 23:38:49 +0000 (23:38 +0000)]
Redirect DataLayout from TargetMachine to Module in StackProtector
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.
Reviewers: echristo
Subscribers: llvm-commits, rafael, yaron.keren
Differential Revision: http://reviews.llvm.org/D11010
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241646
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 7 Jul 2015 23:27:53 +0000 (23:27 +0000)]
MIR Printer: Use a module slot tracker to print global address operands. NFC.
This commit adopts the 'ModuleSlotTracker' class, which was surfaced in r240842,
to print the global address operands. This change ensures that the slot tracker
won't have to be recreated every time a global address operand is printed,
making the MIR printing more efficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241645
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 7 Jul 2015 23:23:03 +0000 (23:23 +0000)]
[WinEH] Add localaddress intrinsic instead of using frameaddress
Clang uses this for SEH finally. The new intrinsic will produce the
right value when stack realignment is required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241643
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Tue, 7 Jul 2015 23:13:18 +0000 (23:13 +0000)]
Add more nvcasts
Tim Northover has told me that they can occur when the compiler cleverly
constructs constants - as demonstrated in the test case.
rdar://
21703486
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241641
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Tue, 7 Jul 2015 22:38:06 +0000 (22:38 +0000)]
[WebAssembly] Set the scheduling preference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241637
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 7 Jul 2015 22:25:32 +0000 (22:25 +0000)]
Rename llvm.frameescape and llvm.framerecover to localescape and localrecover
Summary:
Initially, these intrinsics seemed like part of a family of "frame"
related intrinsics, but now I think that's more confusing than helpful.
Initially, the LangRef specified that this would create a new kind of
allocation that would be allocated at a fixed offset from the frame
pointer (EBP/RBP). We ended up dropping that design, and leaving the
stack frame layout alone.
These intrinsics are really about sharing local stack allocations, not
frame pointers. I intend to go further and add an `llvm.localaddress()`
intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being
used to address locals, which should not be confused with the frame
pointer.
Naming suggestions at this point are welcome, I'm happy to re-run sed.
Reviewers: majnemer, nicholas
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11011
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241633
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 7 Jul 2015 22:06:59 +0000 (22:06 +0000)]
[llvm-objdump] Print the call target next to the instruction
GNU binutils provides this behavior. objdump -r doesn't really help
when you aren't dealing with relocation object files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241631
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 7 Jul 2015 21:31:54 +0000 (21:31 +0000)]
fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241629
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonathan Roelofs [Tue, 7 Jul 2015 20:57:47 +0000 (20:57 +0000)]
Fix comment typo. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241625
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 7 Jul 2015 20:34:53 +0000 (20:34 +0000)]
MIR Serialization: Serialize the 'dead' register machine operand flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241624
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Tue, 7 Jul 2015 20:24:58 +0000 (20:24 +0000)]
Minor updates to gitignore so that symlinks are ignored in the projects dir.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241622
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Tue, 7 Jul 2015 20:24:55 +0000 (20:24 +0000)]
[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working.
Summary:
The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are:
* factored out canonicalizing tool names from paths to CMake variables
* removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools
* removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off
* Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code.
* Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt
Reviewers: bogner, samsonov, chapuni, beanz
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10665
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241621
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Tue, 7 Jul 2015 19:26:31 +0000 (19:26 +0000)]
Add CHECK lines to test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241619
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Tue, 7 Jul 2015 19:07:19 +0000 (19:07 +0000)]
Redirect DataLayout from TargetMachine to Module in SelectionDAG
Summary:
SelectionDAG itself is not invoking directly the DataLayout in the
TargetMachine, but the "TargetLowering" class is still using it. I'll
address it in a following commit.
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.
Reviewers: echristo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11000
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241618
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 7 Jul 2015 19:00:02 +0000 (19:00 +0000)]
Don't pass a null pointer to memcpy.
Fixes pr23650.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241617
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 7 Jul 2015 18:49:41 +0000 (18:49 +0000)]
Revert "Revert r241570, it caused PR24053"
This reverts commit r241602. We had a latent bug in SCCP where we would
make a basic block empty and then proceed to ask questions about it's
terminator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241616
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Tue, 7 Jul 2015 18:49:25 +0000 (18:49 +0000)]
Redirect DataLayout from TargetMachine to Module in GlobalMerge
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.
Reviewers: echristo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10987
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241615
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Tue, 7 Jul 2015 18:45:17 +0000 (18:45 +0000)]
Redirect DataLayout from TargetMachine to Module in CodeGen Prepare
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.
Reviewers: echristo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10986
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241614
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Tue, 7 Jul 2015 18:39:02 +0000 (18:39 +0000)]
Redirect DataLayout from TargetMachine to Module in FastISel
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.
Reviewers: echristo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10985
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241613
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Tue, 7 Jul 2015 18:31:55 +0000 (18:31 +0000)]
Add a pattern for a nvcast from v2f64 -> v4f32
Since the NvCast is generated by the selection process the concerns about
endianess and bit reversal don't apply.
rdar://
21703486
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241611
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Tue, 7 Jul 2015 18:20:57 +0000 (18:20 +0000)]
Redirect DataLayout from TargetMachine to Module in MachineFunction
Summary:
This change is part of a series of commits dedicated to have a
single DataLayout during compilation by using always the one owned by the
module.
Reviewers: echristo
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10984
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241610
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 7 Jul 2015 18:12:06 +0000 (18:12 +0000)]
Use default member initializers to deduplicate code in X86MachineFunctionInfo, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241609
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 7 Jul 2015 17:48:00 +0000 (17:48 +0000)]
Fix the -DBUILD_SHARED_LIBS=ON build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241608
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 7 Jul 2015 17:46:43 +0000 (17:46 +0000)]
MIR Parser: wrap 'MBBSlots' from the MI parsing functions in a struct. NFC.
This commit modifies the interface for the machine instruction parsing
functions by wrapping the parameter 'MBBSlots' in a new structure called
'PerFunctionMIParsingState'. This change is useful as in the future I will be
able to pass new parameters to the machine instruction parser just by modifying
the 'PerFunctionMIParsingState' structure instead of adding a new parameter to
each function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241607
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 7 Jul 2015 17:12:59 +0000 (17:12 +0000)]
Delete UnknownAddress. It is a perfectly valid symbol value.
getSymbolValue now returns a value that in convenient for most callers:
* 0 for undefined
* symbol size for common symbols
* offset/address for symbols the rest
Code that needs something more specific can check getSymbolFlags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241605
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 7 Jul 2015 16:45:55 +0000 (16:45 +0000)]
Simplify by passing in the section of the symbol. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241603
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Tue, 7 Jul 2015 16:42:50 +0000 (16:42 +0000)]
Revert r241570, it caused PR24053
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241602
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Tue, 7 Jul 2015 16:02:11 +0000 (16:02 +0000)]
[Hexagon] Fix unused variable warnings in NDEBUG build caused by r241595
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241600
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Liew [Tue, 7 Jul 2015 15:50:33 +0000 (15:50 +0000)]
Fix bug in test-release.sh where the script would not exit if any
of the build stages that are sent through a pipe (e.g. tee) failed.
This potentially allowed builds and/or tests to fail without anyone
noticing. It appears that for the LLVM 3.6.[01] releases this actually
happened for the Ubuntu 14.04LTS binary releases. The essence of the
issue is that without ``set -o pipefail`` the following command in bash
has a zero exit code.
false | tee /dev/null ; exit $?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241599
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 7 Jul 2015 15:47:29 +0000 (15:47 +0000)]
[WinEH] Add a report_fatal_error for 32-bit stack realignment
This type of prologue isn't supported yet. Implementing it should be a
matter of copying the adjusted incoming EBP into ESI (the base pointer)
instead of EBP. The original EBP can be saved and restored from other
memory afterwards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241597
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Tue, 7 Jul 2015 15:16:42 +0000 (15:16 +0000)]
[Hexagon] Implement bit-tracking facility with specifics for Hexagon
This includes code that is intended to be target-independent as well
as the Hexagon-specific details. This is just the framework without
any users.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241595
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 7 Jul 2015 15:05:09 +0000 (15:05 +0000)]
Common symbols don't have a value.
At least not in the interface exposed by ObjectFile. This matches what ELF and
COFF implement.
Adjust existing code that was expecting them to have values. No overall
functionality change intended.
Another option would be to change the interface and the ELF and COFF
implementations to say that the value of a common symbol is its size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241593
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 7 Jul 2015 15:03:53 +0000 (15:03 +0000)]
use range-based for loops; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241592
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 7 Jul 2015 14:45:12 +0000 (14:45 +0000)]
Fix test case to unbreak build.
This commit changes the target arch to fix the test case commited in r241566
that was failing on ninja-x64-msvc-RA-centos6. Also add checks to make sure
the callee's address is loaded to blx's operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241588
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 7 Jul 2015 14:26:39 +0000 (14:26 +0000)]
Common symbols are not undefined, at least for ObjectFile.
They are implemented like that in some object formats, but for the interface
provided by lib/Object, SF_Undefined and SF_Common are different things.
This matches the ELF and COFF implementation and fixes llvm-nm for MachO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241587
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 7 Jul 2015 13:58:32 +0000 (13:58 +0000)]
Simplify, NFC.
In these two contexts we really just want the raw n_value. No need to use
getSymbolValue which checks for special cases where, semantically, the symbol
has no value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241584
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Tue, 7 Jul 2015 09:15:29 +0000 (09:15 +0000)]
[IR] Make getFirstNonPHI return null if the BB is empty
getFirstNonPHI's documentation states that it returns null if there is
no non-PHI instruction. However, it instead returns a pointer to the
end iterator. The implementation of getFirstNonPHI claims that
dereferencing the iterator will result in an assertion failure but this
doesn't occur. Instead, machinery like getFirstInsertionPt will attempt
to isa<> this invalid memory which results in unpredictable behavior.
Instead, make getFirst* return null if no such instruction exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241570
91177308-0d34-0410-b5e6-
96231b3b80d8
Denis Protivensky [Tue, 7 Jul 2015 07:48:48 +0000 (07:48 +0000)]
Fix gcc warnings of different enum and non-enum types in ternaries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241567
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Tue, 7 Jul 2015 06:54:42 +0000 (06:54 +0000)]
[ARM] Define a subtarget feature and use it to decide whether long calls should
be emitted.
This is needed to enable ARM long calls for LTO and enable and disable it on a
per-function basis.
Out-of-tree projects currently using EnableARMLongCalls to emit long calls
should start passing "+long-calls" to the feature string (see the changes made
to clang in r241565).
rdar://problem/
21529937
Differential Revision: http://reviews.llvm.org/D9364
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241566
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 7 Jul 2015 04:09:55 +0000 (04:09 +0000)]
Fix \param in r241472. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241552
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Tue, 7 Jul 2015 02:08:46 +0000 (02:08 +0000)]
MIR Parser: Verify the implicit machine register operands.
This commit verifies that the parsed machine instructions contain the implicit
register operands as specified by the MCInstrDesc. Variadic and call
instructions aren't verified.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10781
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241537
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Tue, 7 Jul 2015 02:05:18 +0000 (02:05 +0000)]
[StackMap Liveness] Calling the base class' getAnalysisUsage method. NFCI.
Calling into the base class' getAnalysisUsage method after we did our pass
specific modifications. This shouldn't really matter since this is the last
pass in the pipeline anyways.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241536
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Tue, 7 Jul 2015 02:05:15 +0000 (02:05 +0000)]
[StackMap Liveness] No need to cache the MachineFunction. NFC.
Don't cache the MachineFunction in the pass and range'ify some loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241535
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 6 Jul 2015 23:58:14 +0000 (23:58 +0000)]
[Triple] Add a helper to switch between big/little endian variants
This will be used from clang's driver.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241527
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 6 Jul 2015 23:51:40 +0000 (23:51 +0000)]
Make UnitTestMain/TestMain.cpp free from llvm/Config/config.h.
llvm/Config/config.h is unavailable outside of build tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241523
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 6 Jul 2015 23:32:10 +0000 (23:32 +0000)]
[FaultMaps] Add statistic to count the # of implicit null checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241521
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 6 Jul 2015 23:14:57 +0000 (23:14 +0000)]
[WebAssembly] Create a CodeGen unittest directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241520
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 6 Jul 2015 23:07:26 +0000 (23:07 +0000)]
MIR Serialization: Serialize the implicit register flag.
This commit serializes the implicit flag for the register machine operands. It
introduces two new keywords into the machine instruction syntax: 'implicit' and
'implicit-def'. The 'implicit' keyword is used for the implicit register
operands, and the 'implicit-def' keyword is used for the register operands that
have both the implicit and the define flags set.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10709
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241519
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 6 Jul 2015 22:55:20 +0000 (22:55 +0000)]
Remove JumpInstrTableInfo.h as it is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241517
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 6 Jul 2015 22:46:46 +0000 (22:46 +0000)]
[X86][AVX] Add support for shuffle decoding of vperm2f128/vperm2i128 with zero'd lanes
The vperm2f128/vperm2i128 shuffle mask decoding was not attempting to deal with shuffles that give zero lanes. This patch fixes this so that the assembly printer can provide shuffle comments.
As this decoder is also used in X86ISelLowering for shuffle combining, I've added an early-out to match existing behaviour. The hope is that we can add zero support in the future, this would allow other ops' decodes (e.g. insertps) to be combined as well.
Differential Revision: http://reviews.llvm.org/D10593
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241516
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 6 Jul 2015 22:35:29 +0000 (22:35 +0000)]
[x86] extend machine combiner reassociation optimization to SSE scalar adds
Extend the reassociation optimization of http://reviews.llvm.org/rL240361 (D10460)
to SSE scalar FP SP adds in addition to AVX scalar FP SP adds.
With the 'switch' in place, we can trivially add other opcodes and test cases in
future patches.
Differential Revision: http://reviews.llvm.org/D10975
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241515
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 6 Jul 2015 22:35:19 +0000 (22:35 +0000)]
[X86][SSE] Vectorized i64 uniform constant SRA shifts
This patch adds vectorization support for uniform constant i64 arithmetic shift right operators.
Differential Revision: http://reviews.llvm.org/D9645
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241514
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Mon, 6 Jul 2015 21:41:59 +0000 (21:41 +0000)]
WebAssembly: add some TODO
Reviewers: sunfish
Subscribers: llvm-commits, jfb
Differential Revision: http://reviews.llvm.org/D10971
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241513
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Jul 2015 21:36:23 +0000 (21:36 +0000)]
llvm-nm: treat weak undefined as undefined.
This matches the behavior of gnu ld.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241512
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 6 Jul 2015 21:13:53 +0000 (21:13 +0000)]
[WinEH] Add some test cases I forgot to add to previous commits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241510
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 6 Jul 2015 21:13:43 +0000 (21:13 +0000)]
[WinEH] Insert the EH code load before the block terminator
The previous code put the load after the terminator, leading to invalid
IR and downstream crashes. This caused http://crbug.com/506446.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241509
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 6 Jul 2015 20:46:41 +0000 (20:46 +0000)]
[X86][SSE4A] Shuffle lowering using SSE4A EXTRQ/INSERTQ instructions
This patch adds support for v8i16 and v16i8 shuffle lowering using the immediate versions of the SSE4A EXTRQ and INSERTQ instructions. Although rather limited (they can only act on the lower 64-bits of the source vectors, leave the upper 64-bits of the result vector undefined and don't have VEX encoded variants), the instructions are still useful for the zero extension of any lane (EXTRQ) or inserting a lane into another vector (INSERTQ). Testing demonstrated that it wasn't typically worth it to use these instructions for v2i64 or v4i32 vector shuffles although they are capable of it.
As well as adding specific pattern matching for the shuffles, the patch uses EXTRQ for zero extension cases where SSE41 isn't available and its more efficient than the SSE2 'unpack' default approach. It also adds shuffle decode support for the EXTRQ / INSERTQ cases when the instructions are handling full byte-sized extractions / insertions.
From this foundation, future patches will be able to make use of the instructions for situations that use their ability to extract/insert at the bit level.
Differential Revision: http://reviews.llvm.org/D10146
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241508
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 6 Jul 2015 20:30:47 +0000 (20:30 +0000)]
[X86][SSE] Use the general SMAX/SMIN/UMAX/UMIN opcodes and remove the X86 implementation
With the completion of D9746 there is now a common implementation of integer signed/unsigned min/max nodes, removing the need for the equivalent X86 specific implementations.
This patch removes the old X86ISD nodes, legalizes the relevant SSE2/SSE41/AVX2/AVX512 instructions for the ISD versions and converts the small amount of existing X86 code.
Differential Revision: http://reviews.llvm.org/D10947
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241506
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Mon, 6 Jul 2015 20:12:54 +0000 (20:12 +0000)]
[TwoAddressInstructionPass] Rename a variable to match the coding style.
Spot by Bruno.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241505
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Jul 2015 19:24:40 +0000 (19:24 +0000)]
Swap operands instead of using !.
This avoids returning true for A == B.
Thanks to Benjamin Kramer for noticing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241490
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Jul 2015 19:21:04 +0000 (19:21 +0000)]
When sorting by address, undefined symbols go first.
This matches gnu nm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241488
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Jul 2015 18:48:47 +0000 (18:48 +0000)]
Reduce code duplication. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241484
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 6 Jul 2015 18:48:02 +0000 (18:48 +0000)]
[llvm-extract] Drop comdats from declarations
The verifier rejects comdats on declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241483
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Jul 2015 18:18:44 +0000 (18:18 +0000)]
Fix printing of common symbols.
Printing the symbol size matches the behavior or both gnu nm and freebsd nm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241480
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 6 Jul 2015 17:44:26 +0000 (17:44 +0000)]
llc: Add a 'run-pass' option.
This commit adds a 'run-pass' option to llc, which instructs the compiler to run
one specific code generation pass only.
Llc already has the 'start-after' and the 'stop-after' options, and this new
option complements the other two by making it easier to write tests that want
to invoke a single pass only.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10776
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241476
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 6 Jul 2015 17:02:20 +0000 (17:02 +0000)]
AMDGPU: Run SIInsertWaits as pre-emit pass
Running this after the scheduler enables scheduling
waits later so other ALU instructions can run while
this would be waiting.
When combined with enabling the post-RA scheduler, this
gives about a ~20% improvement on sgemm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241473
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 6 Jul 2015 16:56:07 +0000 (16:56 +0000)]
Change the last few internal StringRef triples into Triple objects.
Summary:
This concludes the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.
At this point, the StringRef-form of GNU Triples should only be used in the
public API (including IR serialization) and a couple objects that directly
interact with the API (most notably the Module class). The next step is to
replace these Triple objects with the TargetTuple object that will represent
our authoratative/unambiguous internal equivalent to GNU Triples.
Reviewers: rengolin
Subscribers: llvm-commits, jholewinski, ted, rengolin
Differential Revision: http://reviews.llvm.org/D10962
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241472
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Mon, 6 Jul 2015 16:36:02 +0000 (16:36 +0000)]
DIBuilder: Don't rauw null pointers with empty arrays in finalize().
This makes the IR a little easier to read.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241470
91177308-0d34-0410-b5e6-
96231b3b80d8