Commit Graph

97700 Commits

Author SHA1 Message Date
Eric Christopher ad59015bf7 Simplify testcase.
llvm-svn: 194748
2013-11-14 23:43:10 +00:00
Hans Wennborg a74fd70ac7 Add #include raw_ostream.h in lib/Target/R600/SIFixSGPRCopies.cpp
This was casuing my release+asserts build on Windows to fail.

llvm-svn: 194747
2013-11-14 23:24:09 +00:00
Matt Arsenault 3383eecd68 R600/SI: Specify S_ADDK/S_MULK set SCC and are commutable
llvm-svn: 194738
2013-11-14 22:32:49 +00:00
David Blaikie 32887559c4 DebugInfo: Simplify/narrow null-check for getOrCreateType
llvm-svn: 194737
2013-11-14 22:25:02 +00:00
Rui Ueyama 829c4392e1 Recognize 0x0000 as a COFF file magic.
Summary:
Some machine-type-neutral object files containing only undefined symbols
actually do exist in the Windows standard library. Need to recognize them
as COFF files.

Reviewers: Bigcheese

CC: llvm-commits

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

llvm-svn: 194734
2013-11-14 22:09:08 +00:00
Chad Rosier fd675d932c [AArch64] Remove redundant Neon_immAllOnes/Neon_immAllZeros leaf patterns.
llvm-svn: 194733
2013-11-14 22:02:46 +00:00
David Blaikie bd700e47ca DwarfCompileUnit::getOrCreateContext: Return the compile unit DIE rather than null.
llvm-svn: 194728
2013-11-14 21:24:34 +00:00
David Blaikie 1dbca7018e Remove unnecessary 'else' after return.
llvm-svn: 194724
2013-11-14 19:37:56 +00:00
Paul Robinson 687915ffff Typos. (Test commit.)
llvm-svn: 194720
2013-11-14 18:47:23 +00:00
Dmitri Gribenko 410ba0c3d5 Fix regular expression to work with multiple-digit version numbers
llvm-svn: 194719
2013-11-14 18:31:30 +00:00
Tim Northover 28adfbb0d1 ARM: produce friendly error for invalid inline asm
We used to perform an invalid operation on an MVT and crash, which wasn't much
fun.

Patch by Oliver Stannard.

llvm-svn: 194714
2013-11-14 17:15:39 +00:00
Rafael Espindola f04bb72b61 Add a triple and switch test to FileCheck.
On windows we don't print .weak for function definitions, so count was only
finding 1 'weak'.

llvm-svn: 194713
2013-11-14 17:12:32 +00:00
NAKAMURA Takumi dc23e8b819 llvm-cov.test: Remove XFAIL:arm. Seems this is passing since my tweaks.
llvm-svn: 194712
2013-11-14 17:08:26 +00:00
Rafael Espindola 4929301af4 Error if we see an alias to a declaration.
In ELF and COFF an alias is just another offset in a section. There is no way
to represent an alias to something in another file.

In MachO, the spec has the N_INDR type which should allow for exactly that, but
is not currently implemented. Given that it is specified but not implemented,
we error in codegen to avoid miscompiling but don't reject aliases to
declarations in the verifier to leave the option open of implementing it.

In the past we have used alias to declarations as a way of implementing
weakref, which is why it exists in some old tests which this patch updates.

llvm-svn: 194705
2013-11-14 13:58:06 +00:00
Kostya Serebryany 6da3f74061 [asan] Poor man's coverage that works with ASan
llvm-svn: 194701
2013-11-14 13:27:41 +00:00
Evgeniy Stepanov b22018abed [msan] Use CHECK-DAG instead of CHECK where order of instructions does not matter.
This may fix hexagon-elf bots.

llvm-svn: 194700
2013-11-14 12:46:12 +00:00
Evgeniy Stepanov 585813e33d [msan] Fast path optimization for wrap-indirect-calls feature of MemorySanitizer.
Indirect call wrapping helps MSanDR (dynamic instrumentation companion tool
for MSan) to catch all cases where execution leaves a compiler-instrumented
module by allowing the tool to rewrite targets of indirect calls.

This change is an optimization that skips wrapping for calls when target is
inside the current module. This relies on the linker providing symbols at the
begin and end of the module code (or code + data, does not really matter).
Gold linker provides such symbols by default. GNU (BFD) linker needs a link
flag: -Wl,--defsym=__executable_start=0.

More info:
https://code.google.com/p/memory-sanitizer/wiki/MSanDR#Native_exec

llvm-svn: 194697
2013-11-14 12:29:04 +00:00
NAKAMURA Takumi bef6171f7d llvm-cov requires IR and Support as libraries. Instrumentation would be overkill.
llvm-svn: 194695
2013-11-14 11:45:16 +00:00
NAKAMURA Takumi 8b2f92a374 llvm-cov.test: Tweak win32 hosts not confused by \r\n in llvm-cov's stdout.
"diff -b" -- Ignore space changes.

llvm-svn: 194694
2013-11-14 11:45:10 +00:00
NAKAMURA Takumi 3241dc42be IR/GCOV.cpp: Use PRIu64 as format string with uint64_t.
llvm-svn: 194693
2013-11-14 11:45:04 +00:00
NAKAMURA Takumi 3b55196b15 Whitespace.
llvm-svn: 194692
2013-11-14 11:44:58 +00:00
Elena Demikhovsky 0a74b7da35 AVX-512: Handled extractelement from mask vector;
Added VMOSHDUP/VMOVSLDUP shuffle instructions.

llvm-svn: 194691
2013-11-14 11:29:27 +00:00
Chandler Carruth d9a328437e Fix the header comment of the new pass manager stuff to not claim to be
the legacy stuff. =]

llvm-svn: 194689
2013-11-14 10:55:14 +00:00
Matt Arsenault 671a005e4a Indentation fixes
llvm-svn: 194688
2013-11-14 10:08:50 +00:00
Matt Arsenault f4760455e8 Add a comment
llvm-svn: 194684
2013-11-14 08:06:38 +00:00
Matt Arsenault 269092d747 Fix trailing whitespace in debug printing
llvm-svn: 194683
2013-11-14 08:06:35 +00:00
Matt Arsenault bc63770800 R600/SI: Add testcase for problem I ran into
with the older version of the moveToVALU changes.

llvm-svn: 194682
2013-11-14 07:57:29 +00:00
NAKAMURA Takumi 5b94d28141 yaml::Input::mapTag(): Don't use StringRef to hold return type of std::string.
llvm-svn: 194681
2013-11-14 07:08:56 +00:00
NAKAMURA Takumi 9439c528fe Whitespace.
llvm-svn: 194680
2013-11-14 07:08:49 +00:00
NAKAMURA Takumi b155fa5fb5 AArch64DAGToDAGISel::SelectVTBL(): Fix a warning. [-Wunused-variable]
llvm-svn: 194679
2013-11-14 07:04:07 +00:00
Andrew Trick 561f2218e0 Minor extension to llvm.experimental.patchpoint: don't require a call.
If a null call target is provided, don't emit a dummy call. This
allows the runtime to reserve as little nop space as it needs without
the requirement of emitting a call.

llvm-svn: 194676
2013-11-14 06:54:10 +00:00
Kevin Qin 6e0547dfc9 Add test case for AArch64 NEON instruction set misc.
llvm-svn: 194673
2013-11-14 06:45:17 +00:00
Peter Zotov 9410f77b9f [OCaml] Build stub OCaml libraries for all configured targets
This allows to only link in the needed targets, reducing binary
size and more importantly link time.

Note that this is an incomplete implementation: currently,
LLVM does not have the plumbing which would allow to conditionally
link in AsmPrinter, AsmParser and Disassembler for the targets
which support them. This should be improved in the future.

llvm-svn: 194670
2013-11-14 06:34:21 +00:00
Peter Zotov ea5b2e7493 [OCaml] Expose LLVM's fatal error and stacktrace APIs
llvm-svn: 194669
2013-11-14 06:34:13 +00:00
Rafael Espindola fe4e088dfb Don't mangle \n and "
There is nothing special about quotes and newlines from the object
file point of view, only the assembler has to worry about expanding
the \n and \".

This patch then removes the special handling from the Mangler.

llvm-svn: 194667
2013-11-14 06:05:49 +00:00
Kai Nacke ec6e392975 Add external project LDC to release notes.
LDC, the LLVM-based D compiler, is already using LLVM 3.4.

llvm-svn: 194665
2013-11-14 05:57:40 +00:00
NAKAMURA Takumi b88288f64b R600/SIFixSGPRCopies.cpp: Fix \param to \return. [-Wdocumentation]
llvm-svn: 194662
2013-11-14 04:05:28 +00:00
NAKAMURA Takumi 78e80cd17d Whitespace.
llvm-svn: 194661
2013-11-14 04:05:22 +00:00
Kevin Qin afc8bdfd57 [AArch64 neon] support poly64 and relevant intrinsic functions.
llvm-svn: 194659
2013-11-14 03:27:58 +00:00
Nick Kledzik 4a9f00d8cb remove extra semicolon
llvm-svn: 194658
2013-11-14 03:03:05 +00:00
Kevin Qin aec95baf1a Implement aarch64 neon instruction class SIMD misc.
llvm-svn: 194656
2013-11-14 02:44:13 +00:00
Nick Kledzik dd34f77cbd Add dyn_cast<> support to YAML I/O's IO class
llvm-svn: 194655
2013-11-14 02:38:07 +00:00
Michael Gottesman fd8aee76eb Added BlockFrequencyInfo::view for displaying the block frequency propagation graph via graphviz.
This is useful for debugging issues in the BlockFrequency implementation since
one can easily visualize where probability mass and other errors occur in the
propagation.

llvm-svn: 194654
2013-11-14 02:27:46 +00:00
NAKAMURA Takumi 87826253ea Suppress llvm-cov.test on Win32, with REQUIRES: shell
"cd" is unsupported in lit internal runner.

llvm-svn: 194652
2013-11-14 02:05:41 +00:00
Matt Arsenault 1cdefcbb2a Update emacs llvm mode.
It seems this hasn't been done in a while.

llvm-svn: 194650
2013-11-14 02:03:02 +00:00
Jiangning Liu bb60ccf355 Implement AArch64 NEON instruction set AdvSIMD (table).
llvm-svn: 194648
2013-11-14 01:57:32 +00:00
Yunzhong Gao 5cbcf56a7e Fixing a heisenbug where the memory dependence analysis behaves differently
with and without -g.

Adding a test case to make sure that the threshold used in the memory
dependence analysis is respected. The test case also checks that debug
intrinsics are not counted towards this threshold.

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

llvm-svn: 194646
2013-11-14 01:10:52 +00:00
Nick Kledzik 1e6033ca33 Add simple support for tags in YAML I/O
llvm-svn: 194644
2013-11-14 00:59:59 +00:00
Yuchen Wu 7981f5b86c llvm-cov: Slightly improved error checking.
- readInt() should check all 4 bytes can be read, not just 1.
- In the event of false data in the gcno file, it was possible to index
  into a non-existent index of SmallVector, causing assertion error.

llvm-svn: 194639
2013-11-14 00:38:41 +00:00
Yuchen Wu d738beec44 llvm-cov: Removed StringMap holding GCOVLines.
According to the hazy gcov documentation, it appeared to be technically
possible for lines within a block to belong to different source files.
However, upon further investigation, gcov does not actually support
multiple source files for a single block.

This change removes a level of separation between blocks and lines by
replacing the StringMap of GCOVLines with a SmallVector of ints
representing line numbers. This also means that the GCOVLines class is
no longer needed.

This paves the way for supporting the "-a" option, which will output
block information.

llvm-svn: 194637
2013-11-14 00:32:00 +00:00
Yuchen Wu e28da84c96 llvm-cov: Replaced asserts with proper error handling.
Unified the interface for read functions. They all return a boolean
indicating if the read from file succeeded. Functions that previously
returned the read value now store it into a variable that is passed in
by reference instead. Callers will need to check the return value to
detect if an error occurred.

Also added a new test which ensures that no assertions occur when file
contains invalid data. llvm-cov should return with error code 1 upon
failure.

llvm-svn: 194635
2013-11-14 00:07:15 +00:00
Michael Gottesman 857d6e3dd1 Fixed 80+ violations.
llvm-svn: 194634
2013-11-14 00:05:07 +00:00
Tom Stellard 415ef6db68 R600: Fix uninitialized variable usage
llvm-svn: 194632
2013-11-13 23:58:51 +00:00
Reed Kotler 4b7afe5523 Take care of long short branch immediate instructions for mips16 in
constant islands.

llvm-svn: 194630
2013-11-13 23:52:18 +00:00
Tom Stellard 81d871dee3 R600/SI: Add support for private address space load/store
Private address space is emulated using the register file with
MOVRELS and MOVRELD instructions.

llvm-svn: 194626
2013-11-13 23:36:50 +00:00
Tom Stellard 8216602a0b R600/SI: Prefer SALU instructions for bit shift operations
All shift operations will be selected as SALU instructions and then
if necessary lowered to VALU instructions in the SIFixSGPRCopies pass.

This allows us to do more operations on the SALU which will improve
performance and is also required for implementing private memory
using indirect addressing, since the private memory pointers must stay
in the scalar registers.

This patch includes some fixes from Matt Arsenault.

llvm-svn: 194625
2013-11-13 23:36:37 +00:00
Yuchen Wu c60ae7e1fa llvm-cov: Changed XFAIL targets to be more generic.
llvm-svn: 194622
2013-11-13 23:33:17 +00:00
Yuchen Wu aae88013c7 Added basic unit test for llvm-cov.
This test compares the output of llvm-cov against a coverage file
generated by gcov. Currently, llvm-cov does not work on certain
platforms (namely big-endian architectures such as PowerPC, among
others). These platforms are marked as XFAIL for now, but will be fixed
later.

llvm-svn: 194616
2013-11-13 22:50:15 +00:00
Sebastian Pop 7ee147246f add more comments around the delinearization of arrays
llvm-svn: 194612
2013-11-13 22:37:58 +00:00
Rui Ueyama 5e3de7a7eb Path: Add tests for existing file magics.
llvm-svn: 194607
2013-11-13 21:55:41 +00:00
Rui Ueyama 89d1bdb687 Whitespace.
llvm-svn: 194605
2013-11-13 20:31:21 +00:00
Hans Wennborg 4656ec1e70 Revert my CMake patches concerning building with /MT (r194589, r194596)
Reid pointed out we already have LLVM_USE_CRT_{buildtype} to set it.

llvm-svn: 194604
2013-11-13 20:29:10 +00:00
Jakub Staszak 9dca4b3eeb Simplify code. No functionality change.
llvm-svn: 194602
2013-11-13 20:18:38 +00:00
Jakub Staszak 86a7492f0d Use StringRef instead of std::string
llvm-svn: 194601
2013-11-13 20:09:11 +00:00
Chad Rosier d3ae5f895e [AArch64] Add support for legacy AArch32 NEON scalar shift by immediate
instructions.  This patch does not include the shift right and accumulate
instructions.  A number of non-overloaded intrinsics have been remove in favor
of their overloaded counterparts.

llvm-svn: 194598
2013-11-13 20:05:37 +00:00
Hans Wennborg fc59812bee CMake: make building with /MT an option instead of always forcing it
for release builds.

This is a follow-up to r194589. Aaron pointed out that building
libraries with /MT and using them in an application that uses a
different run-time library can be a bad idea.

Move the option to build with /MT behind a CMake option so it can be
turned on selectively, such as when building the toolchain installer.

llvm-svn: 194596
2013-11-13 19:12:02 +00:00
Weiming Zhao 0da5cc0765 Enable generating legacy IT block for AArch32
By default, the behavior of IT block generation will be determinated
dynamically base on the arch (armv8 vs armv7). This patch adds backend
options: -arm-restrict-it and -arm-no-restrict-it.  The former one
restricts the generation of IT blocks (the same behavior as thumbv8) for
both arches. The later one allows the generation of legacy IT block (the
same behavior as ARMv7 Thumb2) for both arches.

Clang will support -mrestrict-it and -mno-restrict-it, which is
compatible with GCC.

llvm-svn: 194592
2013-11-13 18:29:49 +00:00
Hans Wennborg 079cb9b3e5 cmake: link release builds statically against run-time library on windows (use /MT instead of /MD)
This should fix the problem of snapshot builds created with MSVC 2012 not
working for users with MSVC 2010, etc.

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

llvm-svn: 194589
2013-11-13 18:16:23 +00:00
David Blaikie 9208b5ed8e DIEHash: Move header include to be first in the implementation file to flush out header inclusion ordering issues
llvm-svn: 194588
2013-11-13 18:07:27 +00:00
Richard Sandiford 09de091cbe [SystemZ] Add the general form of BCR
At the moment this is just the MC support.

llvm-svn: 194585
2013-11-13 16:57:53 +00:00
Benjamin Kramer 9e501ec239 Move Delinearization pass into an anonymous namespace.
llvm-svn: 194582
2013-11-13 15:35:17 +00:00
Benjamin Kramer 505d2408a1 Make sure LLVMLoadLibraryPermanently gets an extern "C" symbol.
Otherwise it's impossible to use it. Also don't include C++ headers in
a C header.

llvm-svn: 194581
2013-11-13 15:35:13 +00:00
Alexey Samsonov a7181a1b35 FileCheck: fix matching of one check-prefix is a prefix of another
Summary:
Fix a case when "FileCheck --check-prefix=CHECK --check-prefix=CHECKER"
would silently ignore check-lines of the form:
  CHECKER: foo

Reviewers: dsanders

Reviewed By: dsanders

CC: llvm-commits

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

llvm-svn: 194577
2013-11-13 14:12:52 +00:00
Rafael Espindola fdc88137f4 Remove AllowQuotesInName and friends from MCAsmInfo.
Accepting quotes is a property of an assembler, not of an object file. For
example, ELF can support any names for sections and symbols, but the gnu
assembler only accepts quotes in some contexts and llvm-mc in a few more.

LLVM should not produce different symbols based on a guess about which assembler
will be reading the code it is printing.

llvm-svn: 194575
2013-11-13 14:01:59 +00:00
Rafael Espindola 156227ac2b Don't call doFinalization from verifyFunction.
verifyFunction needs to call doInitialization to collect metadata and avoid
crashing when verifying debug info in a function.

But it should not call doFinalization since that is where the verifier will
check declarations, variables and aliases, which is not desirable when one
only wants to verify a function.

A possible cleanup would be to split the class into a ModuleVerifier and
FunctionVerifier.

Issue reported by Ilia Filippov. Patch by Michael Kruse.

llvm-svn: 194574
2013-11-13 13:44:11 +00:00
Vladimir Medic e10c1125df Fix bug in .gpword directive parsing.
llvm-svn: 194570
2013-11-13 13:18:04 +00:00
Zoran Jovanovic ccb70caa13 Support for microMIPS trap instruction with immediate operands.
llvm-svn: 194569
2013-11-13 13:15:03 +00:00
Alexey Samsonov aa19c0a1c3 Fix -Wdelete-non-virtual-dtor warnings by making SampleProfile methods non-virtual
llvm-svn: 194568
2013-11-13 13:09:39 +00:00
Diego Novillo 8d6568b56b SampleProfileLoader pass. Initial setup.
This adds a new scalar pass that reads a file with samples generated
by 'perf' during runtime. The samples read from the profile are
incorporated and emmited as IR metadata reflecting that profile.

The profile file is assumed to have been generated by an external
profile source. The profile information is converted into IR metadata,
which is later used by the analysis routines to estimate block
frequencies, edge weights and other related data.

External profile information files have no fixed format, each profiler
is free to define its own. This includes both the on-disk representation
of the profile and the kind of profile information stored in the file.
A common kind of profile is based on sampling (e.g., perf), which
essentially counts how many times each line of the program has been
executed during the run.

The SampleProfileLoader pass is organized as a scalar transformation.
On startup, it reads the file given in -sample-profile-file to
determine what kind of profile it contains.  This file is assumed to
contain profile information for the whole application. The profile
data in the file is read and incorporated into the internal state of
the corresponding profiler.

To facilitate testing, I've organized the profilers to support two file
formats: text and native. The native format is whatever on-disk
representation the profiler wants to support, I think this will mostly
be bitcode files, but it could be anything the profiler wants to
support. To do this, every profiler must implement the
SampleProfile::loadNative() function.

The text format is mostly meant for debugging. Records are separated by
newlines, but each profiler is free to interpret records as it sees fit.
Profilers must implement the SampleProfile::loadText() function.

Finally, the pass will call SampleProfile::emitAnnotations() for each
function in the current translation unit. This function needs to
translate the loaded profile into IR metadata, which the analyzer will
later be able to use.

This patch implements the first steps towards the above design. I've
implemented a sample-based flat profiler. The format of the profile is
fairly simplistic. Each sampled function contains a list of relative
line locations (from the start of the function) together with a count
representing how many samples were collected at that line during
execution. I generate this profile using perf and a separate converter
tool.

Currently, I have only implemented a text format for these profiles. I
am interested in initial feedback to the whole approach before I send
the other parts of the implementation for review.

This patch implements:

- The SampleProfileLoader pass.
- The base ExternalProfile class with the core interface.
- A SampleProfile sub-class using the above interface. The profiler
  generates branch weight metadata on every branch instructions that
  matches the profiles.
- A text loader class to assist the implementation of
  SampleProfile::loadText().
- Basic unit tests for the pass.

Additionally, the patch uses profile information to compute branch
weights based on instruction samples.

This patch converts instruction samples into branch weights. It
does a fairly simplistic conversion:

Given a multi-way branch instruction, it calculates the weight of
each branch based on the maximum sample count gathered from each
target basic block.

Note that this assignment of branch weights is somewhat lossy and can be
misleading. If a basic block has more than one incoming branch, all the
incoming branches will get the same weight. In reality, it may be that
only one of them is the most heavily taken branch.

I will adjust this assignment in subsequent patches.

llvm-svn: 194566
2013-11-13 12:22:21 +00:00
Alexey Samsonov 21a340fa99 FileCheck: fix a bug with multiple --check-prefix options.
Summary:
This fixes a subtle bug in new FileCheck feature added
in r194343. When we search for the first satisfying check-prefix,
we should actually return the first encounter of some check-prefix as a
substring, even if it's not a part of valid check-line. Otherwise
"FileCheck --check-prefix=FOO --check-prefix=BAR" with check file:

  FOO not a vaild check-line
  FOO: foo
  BAR: bar

incorrectly accepted file:

  fog
  bar

as it skipped the first two encounters of FOO, matching only BAR: line.

Reviewers: arsenm, dsanders

Reviewed By: dsanders

CC: llvm-commits

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

llvm-svn: 194565
2013-11-13 11:56:22 +00:00
Robert Lytton a83c0482dd XCore target: implement exception handling
llvm-svn: 194564
2013-11-13 10:19:31 +00:00
Sylvestre Ledru 59f661b94e Fix typo + add URL
llvm-svn: 194563
2013-11-13 10:07:16 +00:00
Vladimir Medic 77ffd7af4d This patch fixes a bug in floating point operands parsing, when instruction alias uses default register operand.
llvm-svn: 194562
2013-11-13 09:48:53 +00:00
NAKAMURA Takumi db5d18d245 Add XFAIL:arm again on 4 MCJIT tests, since r194558. AArch64 has been left removed.
They are failing on clang-native-arm-cortex-a9.

Please tweak MCJIT/lit.local.cfg, if this didn't satisfy bots.

llvm-svn: 194561
2013-11-13 07:43:10 +00:00
NAKAMURA Takumi b71b7baa2f Remove XFAIL:aarch64,arm from 4 tests in test/ExecutionEngine/MCJIT.
They are reported as XPASSing.

llvm-svn: 194558
2013-11-13 06:28:00 +00:00
NAKAMURA Takumi 435f62a841 Mips16InstrInfo.cpp: Use <cctype> instead of <ctype.h>
Also, prune <stdlib.h>, seems stray.

llvm-svn: 194557
2013-11-13 06:27:53 +00:00
Reed Kotler 5c8ae09537 Allow the code which returns the length for inline assembler to know
specifically about the .space directive. This allows us to force large
blocks of code to appear in test cases for things like constant islands
without having to make giant test cases to force things like long 
branches to take effect.

llvm-svn: 194555
2013-11-13 04:37:52 +00:00
Peter Zotov de853be2ad Add myself to CODE_OWNERS for the OCaml bindings
Per discussion with Chris Lattner

llvm-svn: 194554
2013-11-13 04:24:13 +00:00
Andrew Trick 5469ae8f21 Add a test case to verify that misusing anyregcc crashes as expected.
llvm-svn: 194553
2013-11-13 03:46:19 +00:00
Chandler Carruth 3d7fd3daa3 Add another (perhaps better) video for Sean's talk. (Thanks Marshall!)
llvm-svn: 194549
2013-11-13 02:49:38 +00:00
Chandler Carruth ccb190972e Fix a null pointer dereference when copying a null polymorphic pointer.
This bug only bit the C++98 build bots because all of the actual uses
really do move. ;] But not *quite* ready to do the whole C++11 switch
yet, so clean it up. Also add a unit test that catches this immediately.

llvm-svn: 194548
2013-11-13 02:48:20 +00:00
Matt Arsenault 00a0d6f672 R600: Fix selection failure on EXTLOAD
llvm-svn: 194547
2013-11-13 02:39:07 +00:00
Juergen Ributzka 34c652d34d SelectionDAG: Teach the legalizer to split SETCC if VSELECT needs splitting too.
This patch reapplies r193676 with an additional fix for the Hexagon backend. The
SystemZ backend has already been fixed by r194148.

The Type Legalizer recognizes that VSELECT needs to be split, because the type
is to wide for the given target. The same does not always apply to SETCC,
because less space is required to encode the result of a comparison. As a result
VSELECT is split and SETCC is unrolled into scalar comparisons.

This commit fixes the issue by checking for VSELECT-SETCC patterns in the DAG
Combiner. If a matching pattern is found, then the result mask of SETCC is
promoted to the expected vector mask type for the given target. Now the type
legalizer will split both VSELECT and SETCC.

This allows the following X86 DAG Combine code to sucessfully detect the MIN/MAX
pattern. This fixes PR16695, PR17002, and <rdar://problem/14594431>.

Reviewed by Nadav

llvm-svn: 194542
2013-11-13 01:57:54 +00:00
Chandler Carruth a477d2ab57 Give folks a reference to some material on the fundamental design
pattern in use here. Addresses review feedback from Sean (thanks!) and
others.

llvm-svn: 194541
2013-11-13 01:51:36 +00:00
Chandler Carruth 74015a7084 Introduce an AnalysisManager which is like a pass manager but with a lot
more smarts in it. This is where most of the interesting logic that used
to live in the implicit-scheduling-hackery of the old pass manager will
live.

Like the previous commits, note that this is a very early prototype!
I expect substantial changes before this is ready to use.

The core of the design is the following:

- We have an AnalysisManager which can be used across a series of
  passes over a module.
- The code setting up a pass pipeline registers the analyses available
  with the manager.
- Individual transform passes can check than an analysis manager
  provides the analyses they require in order to fail-fast.
- There is *no* implicit registration or scheduling.
- Analysis passes are different from other passes: they produce an
  analysis result that is cached and made available via the analysis
  manager.
- Cached results are invalidated automatically by the pass managers.
- When a transform pass requests an analysis result, either the analysis
  is run to produce the result or a cached result is provided.

There are a few aspects of this design that I *know* will change in
subsequent commits:
- Currently there is no "preservation" system, that needs to be added.
- All of the analysis management should move up to the analysis library.
- The analysis management needs to support at least SCC passes. Maybe
  loop passes. Living in the analysis library will facilitate this.
- Need support for analyses which are *both* module and function passes.
- Need support for pro-actively running module analyses to have cached
  results within a function pass manager.
- Need a clear design for "immutable" passes.
- Need support for requesting cached results when available and not
  re-running the pass even if that would be necessary.
- Need more thorough testing of all of this infrastructure.

There are other aspects that I view as open questions I'm hoping to
resolve as I iterate a bit on the infrastructure, and especially as
I start writing actual passes against this.
- Should we have separate management layers for function, module, and
  SCC analyses? I think "yes", but I'm not yet ready to switch the code.
  Adding SCC support will likely resolve this definitively.
- How should the 'require' functionality work? Should *that* be the only
  way to request results to ensure that passes always require things?
- How should preservation work?
- Probably some other things I'm forgetting. =]

Look forward to more patches in shorter order now that this is in place.

llvm-svn: 194538
2013-11-13 01:12:08 +00:00
Nadav Rotem ea186b9515 Update the docs to match the function name.
llvm-svn: 194537
2013-11-13 01:12:01 +00:00
Aaron Ballman 4337e97029 Removing llvm::huge_vald and llvm::huge_vall because they are not currently used, and HUGE_VALD does not appear to be supported everywhere anyways.
llvm-svn: 194535
2013-11-13 00:20:43 +00:00
Aaron Ballman 04999041e8 Replacing HUGE_VALF with llvm::huge_valf in order to work around a warning triggered in MSVC 12.
Patch reviewed by Reid Kleckner and Jim Grosbach.

llvm-svn: 194533
2013-11-13 00:15:44 +00:00
Rafael Espindola 6cd1b9aec4 Remove always true flag.
llvm-svn: 194530
2013-11-12 23:27:08 +00:00
Andrew Trick 0ef482ef02 Cleanup the stackmap operand folding code and fix a corner case.
I still don't know how to refer to the fixed operands symbolically. I
plan to look into it.

llvm-svn: 194529
2013-11-12 22:58:39 +00:00
Sebastian Pop a1cc34b981 improve dependence analysis testcases
print the name of the function on which the dependence analysis is performed
such that changes to the testcase are easier to review.

llvm-svn: 194528
2013-11-12 22:47:30 +00:00
Sebastian Pop c62c679c1b delinearization of arrays
llvm-svn: 194527
2013-11-12 22:47:20 +00:00
Sebastian Pop 9f8004fb08 remove virtual methods in SCEVApplyRewriter and SCEVParameterRewriter
llvm-svn: 194526
2013-11-12 22:47:05 +00:00
Nadav Rotem 0ed2fdb5af Fold (iszero(A&K1) | iszero(A&K2)) -> (A&(K1|K2)) != (K1|K2) if we know that K1 and K2 are 'one-hot' (only one bit is on).
llvm-svn: 194525
2013-11-12 22:38:59 +00:00
Nadav Rotem 53d32211b7 FoldBranchToCommonDest merges branches into a single branch with or/and of the condition. It has a heuristics for estimating when some of the dependencies are processed by out-of-order processors. This patch adds another rule to the heuristics that says that if the "BonusInstruction" that we speculatively execute is used by the condition of the second branch then it is okay to hoist it. This change exposes more opportunities for other passes to transform the code. It does not matter that much that we if-convert the code because the selectiondag builder splits or/and branches into multiple branches when profitable.
llvm-svn: 194524
2013-11-12 22:37:16 +00:00
Akira Hatanaka d6c9f6ebbe [mips] Fix a bug in function CC_MipsO32_FP64. The second double precision
argument was not being passed in $f14.
 

llvm-svn: 194522
2013-11-12 22:16:18 +00:00
Akira Hatanaka c8e4bd156b [mips] Run test case with command line option -mattr=+fp64.
llvm-svn: 194519
2013-11-12 22:06:45 +00:00
Eric Christopher a01c954d73 Add a FIXME for 32-bit q modifiers.
llvm-svn: 194515
2013-11-12 21:47:44 +00:00
Justin Bogner b10a520c8f Protect user-supplied runtime library functions in LTO
Add user-supplied C runtime and compiler-rt library functions to
llvm.compiler.used to protect them from premature optimization by
passes like -globalopt and -ipsccp.  Calls to (seemingly unused)
runtime library functions can be added by -instcombine and instruction
lowering.

Patch by Duncan Exon Smith, thanks!

Fixes <rdar://problem/14740087>

llvm-svn: 194514
2013-11-12 21:44:01 +00:00
Tim Northover 8eaf1543e5 ARM: diagnose invalid system LDM/STM
The system LDM and STM instructions can't usually writeback to the base
register. The one exception is when an LDM is actually an exception-return
(i.e. contains PC in the register list).

(There's already a test that "ldm sp!, {r0-r3, pc}^" works, which is why there
is no positive test).

rdar://problem/15223374

llvm-svn: 194512
2013-11-12 21:32:41 +00:00
Akira Hatanaka d748e29cd9 [mips] Revert part of r194510 that was accidentally committed.
llvm-svn: 194511
2013-11-12 21:10:25 +00:00
Akira Hatanaka 937ce7c143 [mips] Fix and re-enable a test case that has been disabled for a long time.
llvm-svn: 194510
2013-11-12 21:03:57 +00:00
Peter Zotov 7b321f832f [OCaml] Dynamically link LLVM on --enable-shared builds
This commit significantly speeds up both bytecode and native
builds of LLVM clients (from ~20 second to sub-second link time),
and allows to invoke LLVM functions from OCaml toplevel.

The behavior for --disable-shared builds is unchanged.

llvm-svn: 194509
2013-11-12 20:55:49 +00:00
Peter Zotov b1d1388ee3 [OCaml] Fix a typo
llvm-svn: 194508
2013-11-12 20:55:42 +00:00
Rafael Espindola dd8757abbc Corruptly merge constants with explicit and implicit alignments.
Constant merge can merge a constant with implicit alignment with one that has
explicit alignment. Before this change it was assuming that the explicit
alignment was higher than the implicit one, causing the result to be under
aligned in some cases.

Fixes pr17815.

Patch by Chris Smowton!

llvm-svn: 194506
2013-11-12 20:21:43 +00:00
Weiming Zhao 813432f1ae Export intrinsics:__builtin_arm_{dmb,dsb} to frontend
llvm-svn: 194505
2013-11-12 19:57:43 +00:00
Chad Rosier 1eb0ecf8ce [AArch64] Implemented AdvSIMD scalar x indexed element format and AdvSIMD scalar
copy in MC layer. Added the MC layer tests.  Fixed triple setting in test cases.

Patch by Ana Pazos <apazos@codeaurora.org>.

llvm-svn: 194501
2013-11-12 19:13:08 +00:00
Roman Divacky b6517850fb Expand rotate instructions on sparcv9 as well.
llvm-svn: 194500
2013-11-12 19:04:45 +00:00
Andrew Trick 3112a5e4c0 Simplify operand folding when rematerializing a load.
We already know how to fold a reload from a frameindex without
analyzing the load instruction. Generalize this to handle any
frameindex load. This streamlines the logic for rematerializing loads
from stack arguments. As a side effect, it allows stackmaps to record
a stack argument location without spilling it.

Verified no effect on codegen for llvm test-suite.

llvm-svn: 194497
2013-11-12 18:06:12 +00:00
Andrew Trick eb443d7f23 GraphViz CFGPrinter: wrap long lines.
llvm-svn: 194496
2013-11-12 18:06:09 +00:00
Andrew Trick 0926513eb1 whitespace
llvm-svn: 194495
2013-11-12 18:06:06 +00:00
Rafael Espindola e1b88dad8f Revert "Remove unused variable."
This reverts commit r194485.

The variable is unused in some macro instantiations, but not others. We should
probably fix clang to not warn on this.

llvm-svn: 194486
2013-11-12 16:37:31 +00:00
Rafael Espindola 984d3c4587 Remove unused variable.
llvm-svn: 194485
2013-11-12 16:31:59 +00:00
Vincent Lejeune aee3a10440 R600: Reenable llvm.R600.load.input/interp.input for compatibility
llvm-svn: 194484
2013-11-12 16:26:47 +00:00
Daniel Sanders 8b59af15ed [mips][msa] Enable inlinse assembly for MSA.
Like GCC, this re-uses the 'f' constraint and a new 'w' print-modifier:
  asm ("ldi.w %w0, 1", "=f"(result));

Unlike GCC, the 'w' print-modifer is not _required_ to produce the intended
output. This is a consequence of differences in the internal handling of
the registers in each compiler. To be source-compatible between the
compilers, users must use the 'w' print-modifier.

MSA registers (including control registers) are supported in clobber lists.

llvm-svn: 194476
2013-11-12 12:56:01 +00:00
Benjamin Kramer 7c30260ab3 SimplifyCFG: Use existing constant folding logic when forming switch tables.
Both simpler and more powerful than the hand-rolled folding logic.

llvm-svn: 194475
2013-11-12 12:24:36 +00:00
Daniel Sanders e2d3636a1d [mips][msa] Fix buildbot failures caused by an unused variable when assertions are disabled.
llvm-svn: 194472
2013-11-12 11:14:18 +00:00
Daniel Sanders 3f6eb546d3 [mips][msa] Added support for matching bclr, and bclri from normal IR (i.e. not intrinsics)
llvm-svn: 194471
2013-11-12 10:45:18 +00:00
Bradley Smith 9aa8ac9f23 [ARM] Add support for FP_HP_extension build attribute
llvm-svn: 194470
2013-11-12 10:38:05 +00:00
Daniel Sanders a5bc99f164 [mips][msa] Added support for matching bset, bseti, bneg, and bnegi from normal IR (i.e. not intrinsics)
llvm-svn: 194469
2013-11-12 10:31:49 +00:00
Daniel Sanders 44657ef6e5 [mips][msa] Change constant used in ori tests to avoid conflict with bseti (also xori to avoid bnegi)
Upcoming commit(s) are going to add support for bseti and bnegi. This would
cause some existing tests to (correctly) change behaviour and emit a different
instruction. This patch prevents this by changing the constant used in ori and
xori tests so that they will not be matchable by the bseti and bnegi patterns
when these instructions are matchable from normal IR.

llvm-svn: 194467
2013-11-12 10:14:18 +00:00
Robert Lytton 494591b87f XCore target: fix bug in aligning 'byval i8*' on the stack
llvm-svn: 194466
2013-11-12 10:11:35 +00:00
Robert Lytton f7f0c5e326 XCore target test for hidden declaration
llvm-svn: 194465
2013-11-12 10:11:30 +00:00
Robert Lytton 61d9149c73 Add XCore support for ATOMIC_FENCE.
ATOMIC_FENCE is lowered to a compiler barrier which is codegen only. There
is no need to emit an instructions since the XCore provides sequential
consistency.

Original patch by Richard Osborne

llvm-svn: 194464
2013-11-12 10:11:26 +00:00
Robert Lytton ed835b6fd4 XCore target: return error for unsupported alignment
llvm-svn: 194463
2013-11-12 10:11:05 +00:00
Wan Xiaofei b2c8cdc766 Change data structure to memorize computed result in ScalarEvolution
Replace std::map with SmallVector to memorize the cached result since SCEV usually belongs to little Loop/BB
Linear scan on SmallVector is faster than std::map.

Code reviewer : Andrew Trick.
Test result   : Pass Unit Test & LLVM Test Suite

401.bzip2	0.425721	0.419981	101.37%
403.gcc		24.53855	24.2667		101.12%
429.mcf		0.060847	0.059944	101.51%
433.milc	0.646009	0.636119	101.55%
444.namd	1.383928	1.370614	100.97%
445.gobmk	5.836575	5.800225	100.63%
450.soplex	1.911257	1.895963	100.81%
456.hmmer	1.039565	1.032534	100.68%
458.sjeng	0.897401	0.885567	101.34%
464.h264ref	3.645908	3.577991	101.90%
470.lbm		0.049456	0.048398	102.19%
471.omnetpp	5.638575	5.60435		100.61%
bitmnp01	0.045738	0.045291	100.99%
cjpegv2data	0.304359	0.302833	100.50%
idctrn01	0.046433	0.045763	101.46%
quake2		4.534416	4.4952		100.87%
quake		2.688566	2.659208	101.10%
xcsoar		12.42545	12.30385	100.99%
linpack		0.038739	0.03803		101.86%
matrix01	0.053564	0.0528		101.45%
nbench		0.402867	0.395803	101.78%
tblook01	0.021265	0.021015	101.19%
ttsprk01	0.066384	0.065566	101.25%

llvm-svn: 194459
2013-11-12 09:40:41 +00:00
Shuxin Yang f1ec34bdfd Correct a glitch in r194424 which may invalidate iterator.
llvm-svn: 194457
2013-11-12 08:33:03 +00:00
Matt Arsenault 72c83a867c Add new FileCheck feature to 3.4 release notes
llvm-svn: 194456
2013-11-12 08:05:30 +00:00
Yuchen Wu b9a29f2782 Revert "Added basic unit test for llvm-cov."
This reverts commit r194451.

Not sure why the tests are failing on the buildbot. They run fine on my
local machine. Could it possibly be because of the endianness of the
architectures? The GCNO and GCDA files are little-endian encoded, and
llvm-cov expects it to remain that way. Is this a safe assumption?

llvm-svn: 194454
2013-11-12 05:57:06 +00:00
Yuchen Wu 062f24c973 llvm-cov: Added call to update run/program counts.
Also updated test files that were generated from this change.

llvm-svn: 194453
2013-11-12 04:59:08 +00:00
Yuchen Wu b470652431 Added basic unit test for llvm-cov.
This test compares the output of llvm-cov against a coverage file
generated by gcov. Since the source file must be in the current
directory when reading GCNO files, the test will first cd into the
Inputs directory.

llvm-svn: 194451
2013-11-12 04:52:53 +00:00
Matt Arsenault 72b31eee0b R600/SI: Change formatting of printed registers.
Print the range of registers used with a single letter prefix.
This better matches what the shader compiler produces and
is overall less obnoxious than concatenating all of the
subregister names together.

Instead of SGPR0, it will print s0. Instead of SGPR0_SGPR1,
it will print s[0:1] and so on.

There doesn't appear to be a straightforward way
to get the actual register info in the InstPrinter,
so this parses the generated name to print with the
new syntax.

The required test changes are pretty nasty, and register
matching regexes are now worse. Since there isn't a way to
add to a variable in FileCheck, some of the tests now don't
check the exact number of registers used, but I don't think that
will be a real problem.

llvm-svn: 194443
2013-11-12 02:35:51 +00:00
Reed Kotler f0e6968e2f Change the default branch instruction to be the 16 bit variety for mips16.
This has no material effect at this time since we don't have a direct
object emitter for mips16 and the assembler can't tell them apart. I
place a comment "16 bit inst" for those so that I can tell them apart in the
output. The constant island pass has only been minimally changed to allow
this. More complete branch work is forthcoming but this is the first
step.

llvm-svn: 194442
2013-11-12 02:27:12 +00:00
Reid Kleckner e9f36afe7d Extract a bc attr parsing helper that returns Attribute::None on error
The parsing method still returns llvm::error_code for consistency with
other parsing methods.  Minor cleanup, no functionality change.

llvm-svn: 194437
2013-11-12 01:31:00 +00:00
Matt Arsenault dbf9f311b0 R600/SI: Add test that fails due to requiring i64 mul for pointers
llvm-svn: 194433
2013-11-11 23:31:02 +00:00
Lang Hames c2b772351e Lower X86::MORESTACK_RET and X86::MORESTACK_RET_RESTORE_R10 in
X86AsmPrinter::EmitInstruction, rather than X86MCInstLower::Lower.

The aim is to improve the reusability of the X86MCInstLower class by making it
more function-like. The X86::MORESTACK_RET_RESTORE_R10 pseudo broke the
function model by emitting an extra instruction to the MCStreamer attached to
the AsmPrinter.

The patch should have no impact on generated code. 
 

llvm-svn: 194431
2013-11-11 23:00:41 +00:00
Andrew Trick a28099fdd4 Fix the recently added anyregcc convention to handle spilled operands.
Fixes <rdar://15432754> [JS] Assertion: "Folded a def to a non-store!"

The primary purpose of anyregcc is to prevent a patchpoint's call
arguments and return value from being spilled. They must be available
in a register, although the calling convention does not pin the
register. It's up to the front end to avoid using this convention for
calls with more arguments than allocatable registers.

llvm-svn: 194428
2013-11-11 22:40:25 +00:00
Andrew Trick 5ae6ed88fb Print new JavaScript calling conventions symbolically.
llvm-svn: 194427
2013-11-11 22:40:22 +00:00
Vincent Lejeune f143af3fe9 R600: Use function inputs to represent data stored in gpr
llvm-svn: 194425
2013-11-11 22:10:24 +00:00
Shuxin Yang 3168ab3376 Fix PR17952.
The symptom is that an assertion is triggered. The assertion was added by
me to detect the situation when value is propagated from dead blocks.
(We can certainly get rid of assertion; it is safe to do so, because propagating
 value from dead block to alive join node is certainly ok.)

  The root cause of this bug is : edge-splitting is conducted on the fly,
the edge being split could be a dead edge, therefore the block that 
split the critial edge needs to be flagged "dead" as well.

  There are 3 ways to fix this bug:
  1) Get rid of the assertion as I mentioned eariler 
  2) When an dead edge is split, flag the inserted block "dead".
  3) proactively split the critical edges connecting dead and live blocks when
     new dead blocks are revealed.

  This fix go for 3) with additional 2 LOC.

  Testing case was added by Rafael the other day.

llvm-svn: 194424
2013-11-11 22:00:23 +00:00
Akira Hatanaka 8f1caeb0e1 [mips] Partially revert r193641. Stack alignment should not be determined by
the floating point register mode.
 

llvm-svn: 194423
2013-11-11 21:49:03 +00:00
Simon Atanasyan 5c8377f32c Add support for DT_VERxxx and DT_MIPS_xxx .dynamic section entries to the
llvm-readobj.

The patch reviewed by Michael Spencer.
http://llvm-reviews.chandlerc.com/D2113

llvm-svn: 194421
2013-11-11 20:51:48 +00:00
Bob Wilson ed1b2e5d98 Change libLTO back to linking with @executable_path instead of @rpath.
This partially reverts r187641 until ld64 adopts a change to link with an
rpath setting.

llvm-svn: 194418
2013-11-11 20:08:24 +00:00
Arnaud A. de Grandmaison f5f040fa1e CalcSpillWeights: allow overidding the spill weight normalizing function
This will enable the PBQP register allocator to provide its own normalizing function.

No functionnal change.

llvm-svn: 194417
2013-11-11 19:56:14 +00:00
Artyom Skrobov eff45103b3 [ARM] Add support for MVFR2 which is new in ARMv8
llvm-svn: 194416
2013-11-11 19:56:13 +00:00
Andrew Kaylor cfb4a996d0 Fixing a problem with iterator validity in RuntimeDyldImpl::resolveExternalSymbols
llvm-svn: 194415
2013-11-11 19:55:10 +00:00
Justin Holewinski 124e93de93 [NVPTX] Properly handle bitcast ConstantExpr when checking for the alignment of function parameters
llvm-svn: 194410
2013-11-11 19:28:19 +00:00
Justin Holewinski 4f5bc9b33a [NVPTX] Fix logic error in loading vector parameters of more than 4 components
llvm-svn: 194409
2013-11-11 19:28:16 +00:00
Chad Rosier d3684a0566 [AArch64] The shift right/left and insert immediate builtins expect 3
source operands, a vector, an element to insert, and a shift amount.

llvm-svn: 194406
2013-11-11 19:11:11 +00:00
Arnaud A. de Grandmaison ea3ac1612c CalcSpillWeights: give a better describing name to calculateSpillWeights
Besides, this relates it more obviously to the VirtRegAuxInfo::calculateSpillWeightAndHint.

No functionnal change.

llvm-svn: 194404
2013-11-11 19:04:45 +00:00
Eric Christopher aeb105f9fe Unify the adding of enumerators with the construction of the enumeration.
llvm-svn: 194401
2013-11-11 18:52:39 +00:00
Eric Christopher 98b7f17c72 Formatting.
llvm-svn: 194400
2013-11-11 18:52:36 +00:00
Eric Christopher e6c6c4d36b 80-col.
llvm-svn: 194399
2013-11-11 18:52:33 +00:00
Eric Christopher df9955dd89 Just pass the DIComposite type by value instead of by pointer.
llvm-svn: 194398
2013-11-11 18:52:31 +00:00
Chad Rosier 35575e737c [AArch64] Add support for NEON scalar floating-point convert to fixed-point instructions.
llvm-svn: 194394
2013-11-11 18:04:07 +00:00
Daniel Sanders a1840d2f88 Vector forms of SHL, SRA, and SRL can be constant folded using SimplifyVBinOp too
Reviewers: dsanders

Reviewed By: dsanders

CC: llvm-commits, nadav

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

llvm-svn: 194393
2013-11-11 17:23:41 +00:00
Matheus Almeida c051a40506 [mips][msa] CHECK-DAG-ize MSA 3r-a.ll test.
No functional changes.

llvm-svn: 194391
2013-11-11 16:46:20 +00:00
Matheus Almeida ce207fa078 [mips][msa] CHECK-DAG-ize MSA 2rf_int_float.ll test.
No functional changes.

llvm-svn: 194390
2013-11-11 16:38:55 +00:00
Matheus Almeida fed22ad33b [mips][msa] CHECK-DAG-ize MSA 2rf_float_int.ll test.
No functional changes.

llvm-svn: 194389
2013-11-11 16:31:46 +00:00
Renato Golin 3f67a7de36 Move debug message in vectorizer
No functional change, just better reporting.

llvm-svn: 194388
2013-11-11 16:27:35 +00:00
Matheus Almeida c596839e67 [mips][msa] CHECK-DAG-ize MSA 2rf.ll test.
No functional changes.

llvm-svn: 194387
2013-11-11 16:24:53 +00:00
Matheus Almeida 9826d07a2f [mips][msa] CHECK-DAG-ize MSA 2r.ll test.
No functional changes.

llvm-svn: 194386
2013-11-11 16:16:53 +00:00
Rafael Espindola 9d34018954 Add a testcase for pr17852.
llvm-svn: 194385
2013-11-11 15:37:52 +00:00
Hal Finkel c6a243987d Add PPC option for full register names in asm
On non-Darwin PPC systems, we currently strip off the register name prefix
prior to instruction printing. So instead of something like this:

  mr r3, r4

we print this:

  mr 3, 4

The first form is the default on Darwin, and is understood by binutils, but not
yet understood by our integrated assembler. Once our integrated-as understands
full register names as well, this temporary option will be replaced by tying
this functionality to the verbose-asm option. The numeric-only form is
compatible with legacy assemblers and tools, and is also gcc's default on most
PPC systems. On the other hand, it is harder to read, and there are some
analysis tools that expect full register names.

llvm-svn: 194384
2013-11-11 14:58:40 +00:00
Benjamin Kramer ae6bccea9e Simplify code. No functionality change.
llvm-svn: 194383
2013-11-11 14:54:34 +00:00
Peter Zotov 18636a8777 [OCaml] Add missing Llvm_target functions
llvm-svn: 194382
2013-11-11 14:47:28 +00:00
Peter Zotov dfa957746c [OCaml] Accept context explicitly in Llvm_target functions
Llvm_target.intptr_type used to implicitly use global context. As
none of other functions in OCaml bindings do, it is changed to
accept context explicitly.

llvm-svn: 194381
2013-11-11 14:47:20 +00:00
Peter Zotov d52cf17584 [OCaml] Make Llvm_target.DataLayout.t automatically managed
This breaks the API by removing Llvm_target.DataLayout.dispose.

llvm-svn: 194380
2013-11-11 14:47:11 +00:00
Peter Zotov d2cf791ad8 [llvm-c] Remove dead typedef
llvm-svn: 194379
2013-11-11 14:47:01 +00:00
Sylvestre Ledru def97f4f26 Update of the 'Code Review' page. The link is now called 'Create Diff' instead of 'Create Revision'
llvm-svn: 194378
2013-11-11 14:27:56 +00:00
NAKAMURA Takumi dee7160baf [autoconf] Prune "runtime" stuff in configure, corresponding to r191835.
config.status: executing runtime/Makefile commands
  autoconf/install-sh: runtime/Makefile does not exist.

llvm-svn: 194376
2013-11-11 13:53:52 +00:00
Evgeniy Stepanov 560e089355 [msan] Propagate origin for insertvalue, extractvalue.
llvm-svn: 194374
2013-11-11 13:37:10 +00:00
Justin Holewinski eeb109a4ef [NVPTX] Blacklist TailDuplicate pass
This causes issues with virtual registers.  We will likely need
to fix TailDuplicate in the future, or introduce a new version
that plays nicely with vregs.

llvm-svn: 194373
2013-11-11 12:58:14 +00:00
Pete Cooper a8b685cd7b Don't universally enable initialiser lists on GCC. Thanks for catching this Chandler
llvm-svn: 194365
2013-11-11 05:14:42 +00:00
Pete Cooper 020832fb6e Add LLVM_HAS_INITIALIZER_LISTS for upcoming C++11 support. Use it in ArrayRef
llvm-svn: 194362
2013-11-11 03:58:00 +00:00
Tim Northover ef276df244 AArch64: refactor vector list creation to be more uniform
Instructions taking a vector list (e.g. "ld2 {v0.2d, v1.d2}, [x0]") need a
special register-class to deal with the constraints, and C++ code to support
selection. However, that C++ code can be made reasonably uniform to simplify
the selection process. Hence this patch.

No functionality change, so no tests.

llvm-svn: 194361
2013-11-11 03:35:43 +00:00
Arnaud A. de Grandmaison 760c1e0b0a CalculateSpillWeights does not need to be a pass
Based on discussions with Lang Hames and Jakob Stoklund Olesen at the hacker's lab, and in the light of upcoming work on the PBQP register allocator, it was though that CalcSpillWeights does not need to be a pass. This change will enable to customize / tune the spill weight computation depending on the allocator.

Update the documentation style while there.

No functionnal change.

llvm-svn: 194356
2013-11-10 17:46:31 +00:00
NAKAMURA Takumi 5c0be2f67a Mark 36 tests as XFAIL:vg_leak in llvm/test/TableGen.
In historical reason, tblgen is not strictly required to be free from memory leaks.
For now, I mark them as XFAIL, they could be fixed, though.

llvm-svn: 194353
2013-11-10 14:26:08 +00:00
NAKAMURA Takumi cae86ce38b Remove 6 of XFAIL(s) in llvm/test/TableGen, since r193736. They have been XPASSing.
llvm-svn: 194352
2013-11-10 14:25:44 +00:00
Bill Wendling fed6c220ec Revert "Resurrect r191017 " GVN proceeds in the presence of dead code" plus a fix to PR17307 & 17308."
This causes PR17852.

This reverts commit d93e8a06b2ca09ab18f390cd514b7443e2e571f7.

Conflicts:
	test/Transforms/GVN/cond_br2.ll

llvm-svn: 194348
2013-11-10 07:34:34 +00:00
Matt Arsenault c900303e2f Use type form of getIntPtrType.
This should be inconsequential and is work
towards removing the default address space
arguments.

llvm-svn: 194347
2013-11-10 04:46:57 +00:00
Nadav Rotem 5ba1c6ced8 SimplifyCFG has a heuristics for out-of-order processors that decides when it is worthwhile to merge branches. It tries to estimate if the operands of the instruction that we want to hoist are ready. This commit marks function arguments as 'ready' because they require no calculation. This boosts libquantum and a few other workloads from the testsuite.
llvm-svn: 194346
2013-11-10 04:13:31 +00:00
Matt Arsenault b12f2f3b60 Use size function instead of manually calculating it.
llvm-svn: 194345
2013-11-10 03:18:50 +00:00
Matt Arsenault ba035bce21 Resolve TODO in test now that filecheck has multiple check prefixes.
llvm-svn: 194344
2013-11-10 02:16:47 +00:00
Matt Arsenault 13df462691 Allow multiple check prefixes in FileCheck.
This is useful if you want to run multiple variations
of a single test, and the majority of check lines
should be the same.

llvm-svn: 194343
2013-11-10 02:04:09 +00:00
Matt Arsenault 5bcefabcda Teach MergeFunctions about address spaces
llvm-svn: 194342
2013-11-10 01:44:37 +00:00
David Majnemer 3c93dc9f9d IR: Refactor GEP range checks, reuse them for other parts of folding
llvm-svn: 194341
2013-11-10 01:36:22 +00:00
Matt Arsenault c9ad7c9fcb Make method static
llvm-svn: 194340
2013-11-10 01:04:02 +00:00
Matt Arsenault d82c183d70 Fix missing C++ mode comment
llvm-svn: 194339
2013-11-10 01:03:59 +00:00
Matt Arsenault 0fb71e545c Use variable for register name in test
llvm-svn: 194338
2013-11-10 00:57:17 +00:00
Reed Kotler 45c5927c5c Mostly finish up constant islands port for Mips for load constants.
Still need to finish the branch part. Still lots more review of the code,
clean up and testing. 

llvm-svn: 194337
2013-11-10 00:09:26 +00:00
Benjamin Kramer 3e9237a313 Remove some unnecessary temporary strings.
llvm-svn: 194335
2013-11-09 22:48:13 +00:00
Logan Chien a2630db16a [arm] Refine ARMBuildAttrs.h.
This commit cleans up some comments in ARMBuildAttrs.h.
Besides, this commit fixes an error related to AllowWMMXv1
and AllowWMMXv2 (although they are not used currently.)

llvm-svn: 194327
2013-11-09 14:16:52 +00:00
Chandler Carruth 90a835d2a0 [PM] Start sketching out the new module and function pass manager.
This is still just a skeleton. I'm trying to pull together the
experimentation I've done into committable chunks, and this is the first
coherent one. Others will follow in hopefully short order that move this
more toward a useful initial implementation. I still expect the design
to continue evolving in small ways as I work through the different
requirements and features needed here though.

Keep in mind, all of this is off by default.

Currently, this mostly exercises the use of a polymorphic smart pointer
and templates to hide the polymorphism for the pass manager from the
pass implementation. The next step will be more significant, adding the
first framework of analysis support.

llvm-svn: 194325
2013-11-09 13:09:08 +00:00
Chandler Carruth 7caea41545 Move the old pass manager infrastructure into a legacy namespace and
give the files a legacy prefix in the right directory. Use forwarding
headers in the old locations to paper over the name change for most
clients during the transitional period.

No functionality changed here! This is just clearing some space to
reduce renaming churn later on with a new system.

Even when the new stuff starts to go in, it is going to be hidden behind
a flag and off-by-default as it is still WIP and under development.

This patch is specifically designed so that very little out-of-tree code
has to change. I'm going to work as hard as I can to keep that the case.
Only direct forward declarations of the PassManager class are impacted
by this change.

llvm-svn: 194324
2013-11-09 12:26:54 +00:00
Filip Pizlo dfc9b586ae This exposes the new calling conventions (WebKit_JS and AnyReg) via the C API by adding them to the enumeration in Core.h.
llvm-svn: 194323
2013-11-09 06:00:03 +00:00
Chandler Carruth 42fabdead0 Switch to allow implicit construction. In many cases, we're wrapping
a derived type and this makes it *much* easier to write this code.

llvm-svn: 194321
2013-11-09 05:55:03 +00:00
Chandler Carruth b32a79f935 Test the polymorphic behavior of this utility.
llvm-svn: 194320
2013-11-09 04:58:13 +00:00
Chandler Carruth ff272ac0e1 Use something really explicit to test "move semantics" on builds without
r-value references. I still want to test that when we have them,
llvm_move is actually a move.

Have I mentioned that I really want to move to C++11? ;]

llvm-svn: 194318
2013-11-09 04:49:27 +00:00
Chandler Carruth b3b79ce632 Add the critically missing 'clone' method. =]
Clang managed to never instantiate the copy constructor. Added tests to
ensure this path is tested.

We could still use tests for the polymorphic nature. Those coming up
next.

llvm-svn: 194317
2013-11-09 04:32:34 +00:00
Chandler Carruth 8f9bd1fa42 Move the test type out of the function and into the anonymous namespace
to fix C++98 builds.

llvm-svn: 194316
2013-11-09 04:09:50 +00:00
Chandler Carruth 64b0556071 Add a polymorphic_ptr<T> smart pointer data type. It's a somewhat silly
unique ownership smart pointer which is *deep* copyable by assuming it
can call a T::clone() method to allocate a copy of the owned data.

This is mostly useful with containers or other collections of uniquely
owned data in C++98 where they *might* copy. With C++11 we can likely
remove this in favor of move-only types and containers wrapped around
those types.

llvm-svn: 194315
2013-11-09 04:06:02 +00:00
NAKAMURA Takumi 5f847c007b include/llvm/CodeGen/PBQP: Update @param(s) in comments. [-Wdocumentation]
llvm-svn: 194314
2013-11-09 03:54:05 +00:00
NAKAMURA Takumi 866975c26c Fix whitespace.
llvm-svn: 194313
2013-11-09 03:53:55 +00:00
Lang Hames fb82630a91 Re-apply r194300 with fixes for warnings.
llvm-svn: 194311
2013-11-09 03:08:56 +00:00
Akira Hatanaka d1c58ed8a7 [mips] Make sure there is a chain edge dependency between loads that read
formal arguments on the stack and stores created afterwards. We need this to
ensure tail call optimized function calls do not write over the argument area
of the stack before it is read out.
 

llvm-svn: 194309
2013-11-09 02:38:51 +00:00
Nick Lewycky 59886d00ec Revert r194300 which broke the build.
llvm-svn: 194308
2013-11-09 02:01:25 +00:00
Juergen Ributzka 87ed906b2e [Stackmap] Materialize the jump address within the patchpoint noop slide.
This patch moves the jump address materialization inside the noop slide. This
enables patching of the materialization itself or its complete removal. This
patch also adds the ability to define scratch registers that can be used safely
by the code called from the patchpoint intrinsic. At least one scratch register
is required, because that one is used for the materialization of the jump
address. This patch depends on D2009.

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

Reviewed by Andy

llvm-svn: 194306
2013-11-09 01:51:33 +00:00
Adrian Prantl a473a2ba19 Revert "Move copying of global initializers below the cloning of functions."
This would cause internal symbols that are only referenced by global initializers to be removed.

This reverts commit 194219.

llvm-svn: 194304
2013-11-09 00:43:18 +00:00
Adrian Prantl c6e97f66c1 Revert "Run clang-format on file."
This reverts commit 194219.

llvm-svn: 194303
2013-11-09 00:43:12 +00:00
Lang Hames 1662b832d9 Rewrite the PBQP graph data structure.
The new graph structure replaces the node and edge linked lists with vectors.
Free lists (well, free vectors) are used for fast insertion/deletion.

The ultimate aim is to make PBQP graphs cheap to clone. The motivation is that
the PBQP solver destructively consumes input graphs while computing a solution,
forcing the graph to be fully reconstructed for each round of PBQP. This
imposes a high cost on large functions, which often require several rounds of
solving/spilling to find a final register allocation. If we can cheaply clone
the PBQP graph and incrementally update it between rounds then hopefully we can
reduce this cost. Further, once we begin pooling matrix/vector values (future
work), we can cache some PBQP solver metadata and share it between cloned
graphs, allowing the PBQP solver to re-use some of the computation done in
earlier rounds.

For now this is just a data structure update. The allocator and solver still
use the graph the same way as before, fully reconstructing it between each
round. I expect no material change from this update, although it may change
the iteration order of the nodes, causing ties in the solver to break in
different directions, and this could perturb the generated allocations
(hopefully in a completely benign way).

Thanks very much to Arnaud Allard de Grandmaison for encouraging me to get back
to work on this, and for a lot of discussion and many useful PBQP test cases.

llvm-svn: 194300
2013-11-09 00:14:07 +00:00
Juergen Ributzka 9969d3e6e8 [Stackmap] Add AnyReg calling convention support for patchpoint intrinsic.
The idea of the AnyReg Calling Convention is to provide the call arguments in
registers, but not to force them to be placed in a paticular order into a
specified set of registers. Instead it is up tp the register allocator to assign
any register as it sees fit. The same applies to the return value (if
applicable).

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

Reviewed by Andy

llvm-svn: 194293
2013-11-08 23:28:16 +00:00
Pedro Artigas 71f87cb33a increase the accuracy of register pressure computation in the presence of dead definitions by using live intervals, if available, to identify dead definitions and proceed accordingly.
llvm-svn: 194286
2013-11-08 22:46:28 +00:00
Jim Grosbach 2fca51d3b4 X86: Assembly files with .cfi_cfa_def shouldn't hit llvm_unreachable()
On darwin, when trying to create compact unwind info, a .cfi_cfa_def
directive would case an llvm_unreachable() to be hit. Back off when we
see this directive and generate the regular DWARF style eh_frame.

rdar://15406518

llvm-svn: 194285
2013-11-08 22:33:06 +00:00
Lang Hames 8a065703ef Fix some minor issues with r194282 to get the tree healthy again.
llvm-svn: 194284
2013-11-08 22:30:52 +00:00
Lang Hames 3078977d28 Add a method to get the object-file appropriate stack map section.
Thanks to Eric Christopher for the tips on the appropriate way to do this.

llvm-svn: 194282
2013-11-08 22:14:49 +00:00
Hal Finkel 1a642aef37 Remove dead code from LoopUnswitch
LoopUnswitch's code simplification routine has logic to convert conditional
branches into unconditional branches, after unswitching makes the condition
constant, and then remove any blocks that renders dead. Unfortunately, this
code is dead, currently broken, and furthermore, has never been alive (at least
as far back at 2006).

No functionality change intended.

llvm-svn: 194277
2013-11-08 19:58:21 +00:00
Arnaud A. de Grandmaison f7a60a8e01 Revert "CalculateSpillWeights does not need to be a pass"
Temporarily revert my previous commit until I understand why it breaks 3 target tests.

llvm-svn: 194272
2013-11-08 18:19:19 +00:00
Quentin Colombet b06a0ed4b0 [VirtRegMap] Fix for PR17825. Do not ignore noreturn definitions when setting
isPhysRegUsed if the unwind information is required.
Indeed, the runtime may need a correct stack to be able to unwind the call.

llvm-svn: 194271
2013-11-08 18:14:17 +00:00
Richard Barton 5f54c655c1 Make PrintAsmOperand call to the superclass to handle 'n' and 'c' operand modifiers.
llvm-svn: 194270
2013-11-08 18:09:57 +00:00
Arnaud A. de Grandmaison ed812f6590 CalculateSpillWeights does not need to be a pass
Based on discussions with Lang Hames and Jakob Stoklund Olesen at the hacker's lab, and in the light of upcoming work on the PBQP register allocator, it was though that CalcSpillWeights does not need to be a pass. This change will enable to customize / tune the spill weight computation depending on the allocator.

Update the documentation style while there.

No functionnal change.

llvm-svn: 194269
2013-11-08 17:56:29 +00:00
Jordan Rose 09e604333e Add ImmutableSet profiling info for 'bool'.
Useful for tri-state maps: true, false, and "no data yet".

llvm-svn: 194266
2013-11-08 17:23:49 +00:00
Tim Northover 93bcc66e73 ARM: fold prologue/epilogue sp updates into push/pop for code size
ARM prologues usually look like:
    push {r7, lr}
    sub sp, sp, #4

If code size is extremely important, this can be optimised to the single
instruction:
    push {r6, r7, lr}

where we don't actually care about the contents of r6, but pushing it subtracts
4 from sp as a side effect.

This should implement such a conversion, predicated on the "minsize" function
attribute (-Oz) since I've yet to find any code it actually makes faster.

llvm-svn: 194264
2013-11-08 17:18:07 +00:00
Artyom Skrobov 202ff08f97 [ARM] Handling for coprocessor instructions that are undefined starting from ARMv8 (Thumb encodings)
llvm-svn: 194263
2013-11-08 16:25:50 +00:00
Artyom Skrobov d2116a4ef7 [ARM] Handling for coprocessor instructions that are undefined starting from ARMv8 (ARM encodings)
llvm-svn: 194262
2013-11-08 16:17:14 +00:00
Artyom Skrobov e686cec7d4 [ARM] Handling for coprocessor instructions that are undefined starting from ARMv8 (ARM encodings)
llvm-svn: 194261
2013-11-08 16:16:30 +00:00
Artyom Skrobov 08b2257f14 Export MCDisassembler's SubtargetInfo, to allow architecture-aware disassembly
llvm-svn: 194260
2013-11-08 16:07:43 +00:00
Arnaud A. de Grandmaison 3b52f0b135 CalculateSpillWeights cleanup: remove unneeded includes
llvm-svn: 194259
2013-11-08 15:13:05 +00:00
Zoran Jovanovic 2914d2d980 Test for microMIPS trap instructions.
llvm-svn: 194258
2013-11-08 14:55:31 +00:00
NAKAMURA Takumi 0d82bac470 llvm-ar: Let opening a directory failed in llvm-ar.
Linux cannot open directories with open(2), although cygwin and *bsd can.

Motivation: The test, Object/directory.ll, had been failing with --target=cygwin on Linux. XFAIL was improper for host issues.
llvm-svn: 194257
2013-11-08 12:35:56 +00:00
Matheus Almeida a3bac16950 [mips][msa] Update encoding of LDI instruction.
The encoding was updated in MSA r1.07.

llvm-svn: 194255
2013-11-08 10:43:11 +00:00
Artyom Skrobov 8653443902 [ARM] In ARMAsmParser, MatchCoprocessorOperandName() permitted p10 and p11 as operands for coprocessor instructions, resulting in encodings that clash with FP/NEON instruction encodings
llvm-svn: 194253
2013-11-08 09:16:31 +00:00
Bill Wendling 523bea8a39 Remove ^M from the file.
llvm-svn: 194251
2013-11-08 08:13:15 +00:00
David Majnemer d3d140da36 IR: Properly canonicalize PointerType in ConstantExpr GEPs
No additional test was needed, Other/constant-fold-gep.ll detects this
just fine.

llvm-svn: 194221
2013-11-07 22:29:42 +00:00
David Majnemer bd4fef4a89 IR: Do not canonicalize constant GEPs into an out-of-bounds array access
Summary:
Consider a GEP of:
i8* getelementptr ({ [2 x i8], i32, i8, [3 x i8] }* @main.c, i32 0, i32 0, i64 0)

If we proceeded to GEP the aforementioned object by 8, would form a GEP of:
i8* getelementptr ({ [2 x i8], i32, i8, [3 x i8] }* @main.c, i32 0, i32 0, i64 8)

Note that we would go through the first array member, causing an
out-of-bounds accesses.  This is problematic because we might get fooled
if we are trying to evaluate loads using this GEP, for example, based
off of an object with a constant initializer where the array is zero.

This fixes PR17732.

Reviewers: nicholas, chandlerc, void

Reviewed By: void

CC: llvm-commits, echristo, void, aemerson

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

llvm-svn: 194220
2013-11-07 22:15:53 +00:00
Bill Wendling b805c68f4d Run clang-format on file.
llvm-svn: 194219
2013-11-07 20:18:21 +00:00
Bill Wendling 8890460431 Move copying of global initializers below the cloning of functions.
The BlockAddress doesn't have access to the correct basic blocks until the
functions have been cloned. This causes the BlockAddress to point to the old
values. Just wait until the functions have been cloned before copying the
initializers.
PR13163

llvm-svn: 194218
2013-11-07 20:14:51 +00:00
Zoran Jovanovic c18b6d1083 Support for microMIPS trap instructions 1.
llvm-svn: 194205
2013-11-07 14:35:24 +00:00
NAKAMURA Takumi 29c3b55897 llvm-c/Support.h: Add a newline at eof.
llvm-svn: 194203
2013-11-07 13:54:24 +00:00
Reed Kotler e7af1ec97e Disable some code that is causing some warnings. It's in the process
of being converted and this path is not relevant to anything at this time
so I have just disabled it for a few days while I'm at the LLVM conference
and don't have time to complete it or properly fix it.

llvm-svn: 194201
2013-11-07 11:56:33 +00:00