oota-llvm.git
11 years agoMove PathV2.h to Path.h
Rafael Espindola [Tue, 11 Jun 2013 22:21:28 +0000 (22:21 +0000)]
Move PathV2.h to Path.h

Most clients have already been moved from Path V1 to V2. The ones using V1
now include PathV1.h explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183801 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM FastISel fix sext/zext fold
JF Bastien [Tue, 11 Jun 2013 22:13:46 +0000 (22:13 +0000)]
ARM FastISel fix sext/zext fold

Sign- and zero-extension folding was slightly incorrect because it wasn't checking that the shift on extensions was zero. Further, I recently added AND rd, rn, #255 as a form of 8-bit zero extension, and failed to add the folding code for it.

This patch fixes both issues.

This patch fixes both, and the test should remain the same:
  test/CodeGen/ARM/fast-isel-fold.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183794 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake host ARM CPU feature detection independent of the vendor
Tobias Grosser [Tue, 11 Jun 2013 21:45:01 +0000 (21:45 +0000)]
Make host ARM CPU feature detection independent of the vendor

For ARM on linux we use /proc/cpuinfo to detect the host CPU's features.
Linux derives these values without ever looking at the vendor of the
specific CPU implementation. Hence, it adds little value, if we parse
the output of /proc/cpuinfo only for certain vendors.

This patch enables us to derive the correct feature flags e.g. for Qualcomm
CPUs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183790 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[PECOFF] Remove COFF header from PE header for simplicity.
Rui Ueyama [Tue, 11 Jun 2013 21:39:48 +0000 (21:39 +0000)]
[PECOFF] Remove COFF header from PE header for simplicity.

COFF header is always present both in executable and in object file. PE header
is present only in executable. So the natural way to handle PE/COFF file is
treating COFF is mandatory header and PE is optional. Current data structre
does not allow it, because PE header includes COFF header. Removing COFF
header will simplify the code to handle PE/COFF files.

Reviewers: Bigcheese

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D952

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183788 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoInclude PathV1.h in files that use it.
Rafael Espindola [Tue, 11 Jun 2013 20:00:56 +0000 (20:00 +0000)]
Include PathV1.h in files that use it.

This is preparation for replacing Path.h with PathV2.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183782 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove Path::getDirname.
Rafael Espindola [Tue, 11 Jun 2013 19:32:57 +0000 (19:32 +0000)]
Remove Path::getDirname.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183780 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove Path::getBasename.
Rafael Espindola [Tue, 11 Jun 2013 19:29:48 +0000 (19:29 +0000)]
Remove Path::getBasename.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183779 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove Path::getLast.
Rafael Espindola [Tue, 11 Jun 2013 19:25:17 +0000 (19:25 +0000)]
Remove Path::getLast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183778 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove GetDLLSuffix.
Rafael Espindola [Tue, 11 Jun 2013 19:18:05 +0000 (19:18 +0000)]
Remove GetDLLSuffix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183777 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove GetRootDirectory.
Rafael Espindola [Tue, 11 Jun 2013 19:13:52 +0000 (19:13 +0000)]
Remove GetRootDirectory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183775 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove GetUserHomeDirectory.
Rafael Espindola [Tue, 11 Jun 2013 19:08:15 +0000 (19:08 +0000)]
Remove GetUserHomeDirectory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183773 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't define LTDL_SHLIBPATH_VAR.
Rafael Espindola [Tue, 11 Jun 2013 19:04:13 +0000 (19:04 +0000)]
Don't define LTDL_SHLIBPATH_VAR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183771 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove GetSystemLibraryPaths.
Rafael Espindola [Tue, 11 Jun 2013 18:58:47 +0000 (18:58 +0000)]
Remove GetSystemLibraryPaths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183770 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't define LLVM_LIBDIR, it is not used anymore.
Rafael Espindola [Tue, 11 Jun 2013 18:52:11 +0000 (18:52 +0000)]
Don't define LLVM_LIBDIR, it is not used anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183769 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Use function TargetInstrInfo::getRegClass.
Akira Hatanaka [Tue, 11 Jun 2013 18:48:16 +0000 (18:48 +0000)]
[mips] Use function TargetInstrInfo::getRegClass.

No functionality changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183767 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove Path::GetBitcodeLibraryPaths.
Rafael Espindola [Tue, 11 Jun 2013 18:45:35 +0000 (18:45 +0000)]
Remove Path::GetBitcodeLibraryPaths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183765 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unused FindLibrary function.
Rafael Espindola [Tue, 11 Jun 2013 18:41:07 +0000 (18:41 +0000)]
Remove unused FindLibrary function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183764 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove sys::identifyFileType.
Rafael Espindola [Tue, 11 Jun 2013 18:18:02 +0000 (18:18 +0000)]
Remove sys::identifyFileType.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183763 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix documentation on the path to Bitcode reader/writer
Michael Liao [Tue, 11 Jun 2013 18:09:21 +0000 (18:09 +0000)]
Fix documentation on the path to Bitcode reader/writer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183761 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConvert another use of sys::identifyFileType.
Rafael Espindola [Tue, 11 Jun 2013 18:05:26 +0000 (18:05 +0000)]
Convert another use of sys::identifyFileType.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183759 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConvert another use of sys::identifyFileType.
Rafael Espindola [Tue, 11 Jun 2013 18:01:14 +0000 (18:01 +0000)]
Convert another use of sys::identifyFileType.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183758 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoChange how globalopt handles aliases in llvm.used.
Rafael Espindola [Tue, 11 Jun 2013 17:48:06 +0000 (17:48 +0000)]
Change how globalopt handles aliases in llvm.used.

Instead of a custom implementation of replaceAllUsesWith, we just call
replaceAllUsesWith and recreate llvm.used and llvm.compiler-used.

This change is particularity interesting because it makes llvm see
through what clang is doing with static used functions in extern "C"
contexts. With this change, running clang -O2 in

extern "C" {
  __attribute__((used)) static void foo() {}
}

produces

@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to
i8*)], section "llvm.metadata"
define internal void @foo() #0 {
entry:
  ret void
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183756 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConvert another use of sys::identifyFileType.
Rafael Espindola [Tue, 11 Jun 2013 17:28:56 +0000 (17:28 +0000)]
Convert another use of sys::identifyFileType.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183754 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPort r183666 to identify_magic.
Rafael Espindola [Tue, 11 Jun 2013 17:25:45 +0000 (17:25 +0000)]
Port r183666 to identify_magic.

It will be tested in the next commit which moves another user to identify_magic.

Original message:

Fix an out of bounds array access.

We were looking at Magic[5] without checking Length. Since this path would not
return unless Length >= 18 anyway, just move the >= 18 check up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183753 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix variable name.
Rafael Espindola [Tue, 11 Jun 2013 17:22:12 +0000 (17:22 +0000)]
Fix variable name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183752 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix variable name style. Don't cast to and from int.
Rafael Espindola [Tue, 11 Jun 2013 15:29:10 +0000 (15:29 +0000)]
Fix variable name style. Don't cast to and from int.

This enables the compiler to see the enum and produce warnings about a switch
not being fully covered. Fix one of these warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183749 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConvert another use of sys::identifyFileType.
Rafael Espindola [Tue, 11 Jun 2013 15:19:04 +0000 (15:19 +0000)]
Convert another use of sys::identifyFileType.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183747 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConvert another use of sys::identifyFileType.
Rafael Espindola [Tue, 11 Jun 2013 15:09:43 +0000 (15:09 +0000)]
Convert another use of sys::identifyFileType.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183746 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConvert a use of sys::identifyFileType to sys::fs::identify_magic.
Rafael Espindola [Tue, 11 Jun 2013 14:39:59 +0000 (14:39 +0000)]
Convert a use of sys::identifyFileType to sys::fs::identify_magic.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183745 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Make helper functions static.
Benjamin Kramer [Tue, 11 Jun 2013 13:32:25 +0000 (13:32 +0000)]
R600: Make helper functions static.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183744 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRequire members of llvm.used to be named.
Rafael Espindola [Tue, 11 Jun 2013 13:18:13 +0000 (13:18 +0000)]
Require members of llvm.used to be named.

The effect of llvm.used is to introduce an invisible reference, so this seems
a reasonable restriction. It will be used to provide an easy ordering of
the entries in llvm.used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183743 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRework r183728, suppress assert(0) for now. Its behavior depends on assertions on...
NAKAMURA Takumi [Tue, 11 Jun 2013 10:01:42 +0000 (10:01 +0000)]
Rework r183728, suppress assert(0) for now. Its behavior depends on assertions on win32 hosts.

FIXME: Introduce yet another checker but assert(0).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183736 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIt adds support for negative zero offsets for loads and stores.
Mihai Popa [Tue, 11 Jun 2013 09:48:35 +0000 (09:48 +0000)]
It adds support for negative zero offsets for loads and stores.
Negative zero is returned by the primary expression parser as INT32_MIN, so all that the method needs to do is to accept this value.
Behavior already present for Thumb2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183734 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThis patch adds support for FPINST/FPINST2 as operands to vmsr/vmrs. These are option...
Mihai Popa [Tue, 11 Jun 2013 09:39:51 +0000 (09:39 +0000)]
This patch adds support for FPINST/FPINST2 as operands to vmsr/vmrs. These are optional registers that may be supported some ARM implementations to aid with resolution of floating point exceptions. The manual pages for vmsr and vmrs do not detail their use. Encodings and other information can be found in ARM Architecture Reference Manual section F, chapter 6, paragraph 3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183733 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: Enforce decoding rules for VLDn instructions
Amaury de la Vieuville [Tue, 11 Jun 2013 08:14:14 +0000 (08:14 +0000)]
ARM: Enforce decoding rules for VLDn instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183731 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: Fix STREX/LDREX reecoding
Amaury de la Vieuville [Tue, 11 Jun 2013 08:03:20 +0000 (08:03 +0000)]
ARM: Fix STREX/LDREX reecoding

The decoded MCInst wasn't reencoded as the same instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183729 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTweak a couple of tests on win32 hosts with +Asserts.
NAKAMURA Takumi [Tue, 11 Jun 2013 06:52:58 +0000 (06:52 +0000)]
Tweak a couple of tests on win32 hosts with +Asserts.

  - Don't use assert(0), or tests may pass or fail according to assertions.
  - For now, The tests are marked as XFAIL for win32 hosts.

FIXME: Could we avoid XFAIL to specify triple in the RUN lines?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183728 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARMAsmBackend.cpp: Use Triple::isOSBinFormatCOFF() instead of isOSWindows().
NAKAMURA Takumi [Tue, 11 Jun 2013 06:52:43 +0000 (06:52 +0000)]
ARMAsmBackend.cpp: Use Triple::isOSBinFormatCOFF() instead of isOSWindows().

FYI, isOSBinFormatCOFF() is as same as isOSWindows(), on trunk.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183727 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhitespace.
NAKAMURA Takumi [Tue, 11 Jun 2013 06:52:36 +0000 (06:52 +0000)]
Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183726 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix dubious type name similar to member name.
Sean Silva [Tue, 11 Jun 2013 00:13:52 +0000 (00:13 +0000)]
Fix dubious type name similar to member name.

Should bring bots back to life.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183715 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix spurious semicolons.
Sean Silva [Mon, 10 Jun 2013 23:48:38 +0000 (23:48 +0000)]
Fix spurious semicolons.

Apparently these macros have semicolons inside of them already.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183712 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[yaml2obj] Initial ELF support.
Sean Silva [Mon, 10 Jun 2013 23:44:15 +0000 (23:44 +0000)]
[yaml2obj] Initial ELF support.

Currently, only emitting the ELF header is supported (no sections or
segments).

The ELFYAML code organization is broadly similar to the COFFYAML code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183711 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: diagnose ARM/Thumb assembly switches on CPUs only supporting one.
Tim Northover [Mon, 10 Jun 2013 23:20:58 +0000 (23:20 +0000)]
ARM: diagnose ARM/Thumb assembly switches on CPUs only supporting one.

Some ARM CPUs only support ARM mode (ancient v4 ones, for example) and some
only support Thumb mode (M-class ones currently). This makes sure such CPUs
default to the correct mode and makes the AsmParser diagnose an attempt to
switch modes incorrectly.

rdar://14024354

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183710 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix xemacs mode line, don't put them in .cpp files (just header files). No
Nick Lewycky [Mon, 10 Jun 2013 23:10:59 +0000 (23:10 +0000)]
Fix xemacs mode line, don't put them in .cpp files (just header files). No
functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183709 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove a few fixmes, the only work we're doing is getting the string
Eric Christopher [Mon, 10 Jun 2013 22:24:10 +0000 (22:24 +0000)]
Remove a few fixmes, the only work we're doing is getting the string
to return and this is done all over.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183704 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix up comment.
Eric Christopher [Mon, 10 Jun 2013 22:24:07 +0000 (22:24 +0000)]
Fix up comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183703 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unused function.
Eric Christopher [Mon, 10 Jun 2013 21:59:28 +0000 (21:59 +0000)]
Remove unused function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183698 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIndentCount is only used within NDEBUG code.
Eric Christopher [Mon, 10 Jun 2013 20:58:53 +0000 (20:58 +0000)]
IndentCount is only used within NDEBUG code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183695 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoX86: Stop LEA64_32r doing unspeakable things to its arguments.
Tim Northover [Mon, 10 Jun 2013 20:43:49 +0000 (20:43 +0000)]
X86: Stop LEA64_32r doing unspeakable things to its arguments.

Previously LEA64_32r went through virtually the entire backend thinking it was
using 32-bit registers until its blissful illusions were cruelly snatched away
by MCInstLower and 64-bit equivalents were substituted at the last minute.

This patch makes it behave normally, and take 64-bit registers as sources all
the way through. Previous uses (for 32-bit arithmetic) are accommodated via
SUBREG_TO_REG instructions which make the types and classes agree properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183693 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a missing 'e'.
Rafael Espindola [Mon, 10 Jun 2013 20:32:27 +0000 (20:32 +0000)]
Add a missing 'e'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183692 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agotblgen: Assert that InstRWs doesn't grows when we don't expect it.
Benjamin Kramer [Mon, 10 Jun 2013 20:19:35 +0000 (20:19 +0000)]
tblgen: Assert that InstRWs doesn't grows when we don't expect it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183690 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[PowerPC] Support extended sc mnemonic
Ulrich Weigand [Mon, 10 Jun 2013 17:19:43 +0000 (17:19 +0000)]
[PowerPC] Support extended sc mnemonic

A plain "sc" without argument is supposed to be treated like "sc 0"
by the assembler.  This patch adds a corresponding alias.

Problem reported by Joerg Sonnenberger.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183687 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[PowerPC] Support branch mnemonics with implied CR0
Ulrich Weigand [Mon, 10 Jun 2013 17:19:15 +0000 (17:19 +0000)]
[PowerPC] Support branch mnemonics with implied CR0

The extended branch mnemonics are supposed to use an implied CR0
if there is no explicit condition register specified.  This patch
adds extra variants of the mnemonics to this effect.

Problem reported by Joerg Sonnenberger.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183686 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[PowerPC] Use multiclass to generate extended branch mnemonics
Ulrich Weigand [Mon, 10 Jun 2013 17:18:29 +0000 (17:18 +0000)]
[PowerPC] Use multiclass to generate extended branch mnemonics

This patch removes some redundancy by generating the extended branch
mnemonics via a multiclass.

No change in behaviour expected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183685 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSilencing an MSVC warning about comparing signed and unsigned values.
Aaron Ballman [Mon, 10 Jun 2013 16:45:40 +0000 (16:45 +0000)]
Silencing an MSVC warning about comparing signed and unsigned values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183682 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove the old IdentifyFileType now that lld was updated.
Rafael Espindola [Mon, 10 Jun 2013 15:37:29 +0000 (15:37 +0000)]
Remove the old IdentifyFileType now that lld was updated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183671 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPass a StringRef to sys::identifyFileType.
Rafael Espindola [Mon, 10 Jun 2013 15:27:39 +0000 (15:27 +0000)]
Pass a StringRef to sys::identifyFileType.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183669 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix an out of bounds array access.
Rafael Espindola [Mon, 10 Jun 2013 15:22:18 +0000 (15:22 +0000)]
Fix an out of bounds array access.

We were looking at Magic[5] without checking Length. Since this path would not
return unless Length >= 18 anyway, just move the >= 18 check up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183666 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate for current naming conventions.
Rafael Espindola [Mon, 10 Jun 2013 14:56:16 +0000 (14:56 +0000)]
Update for current naming conventions.

I will change identifyFileType to use a StringRef in the next patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183664 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix misleading comments in ARMAsmParser
Amaury de la Vieuville [Mon, 10 Jun 2013 14:17:15 +0000 (14:17 +0000)]
Fix misleading comments in ARMAsmParser

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183657 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: ISB cannot be passed the same options as DMB
Amaury de la Vieuville [Mon, 10 Jun 2013 14:17:08 +0000 (14:17 +0000)]
ARM: ISB cannot be passed the same options as DMB

ISB should only accepts full system sync, other options are reserved

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183656 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[NVPTX] Remove old CONST_NOT_GEN address space that is not being used anymore and...
Justin Holewinski [Mon, 10 Jun 2013 13:29:47 +0000 (13:29 +0000)]
[NVPTX] Remove old CONST_NOT_GEN address space that is not being used anymore and causes constants to be emitted in the global address space

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183652 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAvoid warnings about unused parameters that tend to come up a lot when
Duncan Sands [Mon, 10 Jun 2013 12:09:30 +0000 (12:09 +0000)]
Avoid warnings about unused parameters that tend to come up a lot when
building outside projects with a different compiler than that used to build
LLVM itself (eg switching between gcc and clang).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183650 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd test for ARM FastISel load/store register classes
JF Bastien [Mon, 10 Jun 2013 00:35:57 +0000 (00:35 +0000)]
Add test for ARM FastISel load/store register classes

r183624 fixed an issue that was tested indirectly. Test it directly with this new test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183634 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a regression I introduced when I expanded the complex pseudos in
Reed Kotler [Sun, 9 Jun 2013 23:23:46 +0000 (23:23 +0000)]
Fix a regression I introduced when I expanded the complex pseudos in
the Mips16 port. A few of the psuedos could either take signed
or unsigned arguments and I did not distinguish the case and improperly
rejected some valid cases that the assembler had previously accepted
when they were pure pseudos that expanded as assembly instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183633 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agotblgen: always lookup values from the original vector as it could be grown under...
Benjamin Kramer [Sun, 9 Jun 2013 15:20:23 +0000 (15:20 +0000)]
tblgen: always lookup values from the original vector as it could be grown under our feet.

PR16281.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183630 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a const version of findNearestCommonDominator to PostDom for convenience.
Benjamin Kramer [Sun, 9 Jun 2013 15:09:30 +0000 (15:09 +0000)]
Add a const version of findNearestCommonDominator to PostDom for convenience.

PR16283.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183629 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRefine the ARM EHABI test cases.
Logan Chien [Sun, 9 Jun 2013 12:36:57 +0000 (12:36 +0000)]
Refine the ARM EHABI test cases.

Since we have ARM unwind directive parser and assembler, we
can check the correctness in two stages:

1. From LLVM assembly (.ll) to ARM assembly (.s)
2. From ARM assembly (.s) to ELF object file (.o)

We already have several "*.s to *.o" test cases.  This CL adds
some "*.ll to *.s" test cases and removes the redundant "*.ll to *.o"
test cases.

New test cases to check "*.ll to *.s" code generator:

- ehabi.ll: Check the correctness of the generated unwind directives.
- section-name.ll: Check the section name of functions.

Removed test cases:

- ehabi-mc-cantunwind.ll
  (Covered by ehabi-cantunwind.ll, and eh-directive-cantunwind.s)
- ehabi-mc-compact-pr0.ll
  (Covered by ehabi.ll, eh-compact-pr0.s, eh-directive-save.s, and
   eh-directive-setfp.s)
- ehabi-mc-compact-pr1.ll
  (Covered by ehabi.ll, eh-compact-pr1.s, eh-directive-save.s, and
   eh-directive-setfp.s)
- ehabi-mc.ll
  (Covered by ehabi.ll, and eh-directive-integrated-test.s)
- ehabi-mc-section-group.ll
  (Covered by section-name.ll, and eh-directive-section-comdat.s)
- ehabi-mc-section.ll
  (Covered by section-name.ll, and eh-directive-section.s)
- ehabi-mc-sh_link.ll
  (Covered by eh-directive-text-section.s, and eh-directive-section.s)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183628 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix ARM unwind opcode assembler in several cases.
Logan Chien [Sun, 9 Jun 2013 12:22:30 +0000 (12:22 +0000)]
Fix ARM unwind opcode assembler in several cases.

Changes to ARM unwind opcode assembler:

* Fix multiple .save or .vsave directives.  Besides, the
  order is preserved now.

* For the directives which will generate multiple opcodes,
  such as ".save {r0-r11}", the order of the unwind opcode
  is fixed now, i.e. the registers with less encoding value
  are popped first.

* Fix the $sp offset calculation.  Now, we can use the
  .setfp, .pad, .save, and .vsave directives at any order.

Changes to test cases:

* Add test cases to check the order of multiple opcodes
  for the .save directive.

* Fix the incorrect $sp offset in the test case.  The
  stack pointer offset specified in the test case was
  incorrect.  (Changed test cases: ehabi-mc-section.ll and
  ehabi-mc.ll)

* The opcode to restore $sp are slightly reordered.  The
  behavior are not changed, and the new output is same
  as the output of GNU as.  (Changed test cases:
  eh-directive-pad.s and eh-directive-setfp.s)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183627 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemoved PackedDouble domain from scalar instructions. Added more formats for the...
Elena Demikhovsky [Sun, 9 Jun 2013 07:37:10 +0000 (07:37 +0000)]
Removed PackedDouble domain from scalar instructions. Added more formats for the scalar stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183626 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake DeadArgumentElimination more conservative on variadic functions
Tim Northover [Sun, 9 Jun 2013 02:17:27 +0000 (02:17 +0000)]
Make DeadArgumentElimination more conservative on variadic functions

Variadic functions are particularly fragile in the face of ABI changes, so this
limits how much the pass changes them

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183625 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM FastISel fix load register classes
JF Bastien [Sun, 9 Jun 2013 00:20:24 +0000 (00:20 +0000)]
ARM FastISel fix load register classes

The register classes when emitting loads weren't quite restricting enough, leading to MI verification failure on the result register.

These are new failures that weren't there the first time I tried enabling ARM FastISel for new targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183624 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTargetLowering: Clean up method description comments
David Majnemer [Sat, 8 Jun 2013 23:51:45 +0000 (23:51 +0000)]
TargetLowering: Clean up method description comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183623 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agosys::process::get_id() now returns the process ID instead of a process handle on...
Aaron Ballman [Sat, 8 Jun 2013 20:29:03 +0000 (20:29 +0000)]
sys::process::get_id() now returns the process ID instead of a process handle on Windows.  Patch thanks to Kim Gräsman!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183621 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Sparc] Delete FPMover Pass and remove Fp* Pseudo-instructions from Sparc backend.
Venkatraman Govindaraju [Sat, 8 Jun 2013 15:32:59 +0000 (15:32 +0000)]
[Sparc] Delete FPMover Pass and remove Fp* Pseudo-instructions from Sparc backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183613 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: fix VMOVvnf32 decoding when ambiguous with VCVT
Amaury de la Vieuville [Sat, 8 Jun 2013 13:54:05 +0000 (13:54 +0000)]
ARM: fix VMOVvnf32 decoding when ambiguous with VCVT

Enforce Table A7-15 (op=1, cmode=0b111) -> UNDEF

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183612 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: enforce SRS decoding constraints
Amaury de la Vieuville [Sat, 8 Jun 2013 13:43:59 +0000 (13:43 +0000)]
ARM: enforce SRS decoding constraints

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183611 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: fix CPS decoding when ambiguous with QADD
Amaury de la Vieuville [Sat, 8 Jun 2013 13:38:52 +0000 (13:38 +0000)]
ARM: fix CPS decoding when ambiguous with QADD

Handle the case when the disassembler table can't tell
the difference between some encodings of QADD and CPS.

Add some necessary safe guards in CPS decoding as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183610 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: fix VCVT decoding
Amaury de la Vieuville [Sat, 8 Jun 2013 13:29:11 +0000 (13:29 +0000)]
ARM: fix VCVT decoding

UNPRED was reported instead of UNDEF

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183608 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate code listings in LLVM tutorial.
Logan Chien [Sat, 8 Jun 2013 09:03:03 +0000 (09:03 +0000)]
Update code listings in LLVM tutorial.

Several LLVM headers are moved.  The code listings in
LLVM tutorial are not updated yet.

This CL removes the code replica in the .rst, and replace
them with a literalinclude directive, so that sphinx can
include the latest code automatically.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183607 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago Fix a potential bug in r183584.
Shuxin Yang [Sat, 8 Jun 2013 04:56:05 +0000 (04:56 +0000)]
  Fix a potential bug in r183584.

  r183584 tries to derive some info from the code *AFTER* a call and apply
these derived info to the code *BEFORE* the call, which is not always safe
as the call in question may never return, and in this case, the derived
info is invalid.

  Thank Duncan for pointing out this potential bug.

rdar://14073661

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183606 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't artifically restrict input object size.
Sean Silva [Sat, 8 Jun 2013 04:32:59 +0000 (04:32 +0000)]
Don't artifically restrict input object size.

sys::IdentifyFileType is already conscious of the length, and
object_error::invalid_file_type is returned below anyway if
sys::IdentifyFileType doesn't recognize the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183605 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix unused variable warning from my previous patch.
JF Bastien [Sat, 8 Jun 2013 00:51:51 +0000 (00:51 +0000)]
Fix unused variable warning from my previous patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183601 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Use a helper function which compares the size of the source and
Akira Hatanaka [Sat, 8 Jun 2013 00:14:54 +0000 (00:14 +0000)]
[mips] Use a helper function which compares the size of the source and
destination operands of an instruction.

No functionality changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183596 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReapply r183552. This time, use a standard type for the option to avoid template
Quentin Colombet [Sat, 8 Jun 2013 00:07:54 +0000 (00:07 +0000)]
Reapply r183552. This time, use a standard type for the option to avoid template
instantiation issue with non-standard type.

Add a backend option to warn on a given stack size limit.
Option: -mllvm -warn-stack-size=<limit>
Output (if limit is exceeded):
warning: Stack size limit exceeded (<actual size>) in <functionName>.

The longer term plan is to hook that to a clang warning.
PR:4072
<rdar://problem/13987214>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183595 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Use a refined heuristic to choose when switching clause
Vincent Lejeune [Fri, 7 Jun 2013 23:30:34 +0000 (23:30 +0000)]
R600: Use a refined heuristic to choose when switching clause

This is using a hint from AMD APP OpenCL Programming Guide with
empirically tweaked parameters.
I used Unigine Heaven 3.0 to determine best parameters on my system
(i7 2600/Radeon 6950/Kernel 3.9.4) the benchmark :
it went from 38.8 average fps to 39.6, which is ~3% gain.
(Lightmark 2008.2 gain is much more marginal: from 537 to 539)

There is no lit test provided as the parameter were determined
empirically and it it would be nearly impossiblet to find a test
program that check for optimal behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183593 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Anti dep better handled in tex clause
Vincent Lejeune [Fri, 7 Jun 2013 23:30:26 +0000 (23:30 +0000)]
R600: Anti dep better handled in tex clause

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183592 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemember the anyext patterns.
Jakob Stoklund Olesen [Fri, 7 Jun 2013 22:59:29 +0000 (22:59 +0000)]
Remember the anyext patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183589 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd missing zextloadi1 to i64 patterns. PR16721.
Jakob Stoklund Olesen [Fri, 7 Jun 2013 22:55:05 +0000 (22:55 +0000)]
Add missing zextloadi1 to i64 patterns. PR16721.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183587 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago Fix an assertion in MemCpyOpt pass.
Shuxin Yang [Fri, 7 Jun 2013 22:45:21 +0000 (22:45 +0000)]
  Fix an assertion in MemCpyOpt pass.

  The MemCpyOpt pass is capable of optimizing:
      callee(&S); copy N bytes from S to D.
    into:
      callee(&D);
subject to some legality constraints.

  Assertion is triggered when the compiler tries to evalute "sizeof(typeof(D))",
while D is an opaque-typed, 'sret' formal argument of function being compiled.
i.e. the signature of the func being compiled is something like this:
  T caller(...,%opaque* noalias nocapture sret %D, ...)

  The fix is that when come across such situation, instead of calling some
utility functions to get the size of D's type (which will crash), we simply
assume D has at least N bytes as implified by the copy-instruction.

rdar://14073661

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183584 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDisallow i64 div/rem in PPC32 counter loops
Hal Finkel [Fri, 7 Jun 2013 22:16:19 +0000 (22:16 +0000)]
Disallow i64 div/rem in PPC32 counter loops

On PPC32, [su]div,rem on i64 types are transformed into runtime library
function calls. As a result, they are not allowed in counter-based loops (the
counter-loops verification pass caught this error; this change fixes PR16169).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183581 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert commits related to stack warning.
Quentin Colombet [Fri, 7 Jun 2013 22:14:50 +0000 (22:14 +0000)]
Revert commits related to stack warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183579 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoExplicit triple in warn stack size test cases to not depend on OS.
Quentin Colombet [Fri, 7 Jun 2013 21:09:42 +0000 (21:09 +0000)]
Explicit triple in warn stack size test cases to not depend on OS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183574 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't cache the instruction and register info from the TargetMachine, because
Bill Wendling [Fri, 7 Jun 2013 21:04:35 +0000 (21:04 +0000)]
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183572 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't cache the instruction and register info from the TargetMachine, because
Bill Wendling [Fri, 7 Jun 2013 21:00:34 +0000 (21:00 +0000)]
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183571 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unused c'tor.
Bill Wendling [Fri, 7 Jun 2013 20:59:31 +0000 (20:59 +0000)]
Remove unused c'tor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183570 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Fix calculation of stack offset in AMDGPUFrameLowering
Tom Stellard [Fri, 7 Jun 2013 20:52:05 +0000 (20:52 +0000)]
R600: Fix calculation of stack offset in AMDGPUFrameLowering

We weren't computing structure size correctly and we were relying on
the original alloca instruction to compute the offset, which isn't
always reliable.

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183568 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't cache the instruction and register info from the TargetMachine, because
Bill Wendling [Fri, 7 Jun 2013 20:42:15 +0000 (20:42 +0000)]
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183567 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Rework subtarget info and remove AMDILDevice classes
Tom Stellard [Fri, 7 Jun 2013 20:37:48 +0000 (20:37 +0000)]
R600: Rework subtarget info and remove AMDILDevice classes

This should simplify the subtarget definitions and make it easier to
add new ones.

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183566 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't cache the instruction and register info from the TargetMachine, because
Bill Wendling [Fri, 7 Jun 2013 20:35:25 +0000 (20:35 +0000)]
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183565 91177308-0d34-0410-b5e6-96231b3b80d8