oota-llvm.git
10 years agoMove some X86 subtarget configuration onto the subtarget that's being
Eric Christopher [Sat, 9 Aug 2014 01:07:25 +0000 (01:07 +0000)]
Move some X86 subtarget configuration onto the subtarget that's being
created.

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

10 years agoR600/SI: Custom lower CONCAT_VECTORS
Tom Stellard [Sat, 9 Aug 2014 01:06:56 +0000 (01:06 +0000)]
R600/SI: Custom lower CONCAT_VECTORS

This will lower them using register copies rather than loads and stores
to the stack.

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

10 years agoR600/SI: Update concat_vectors.ll to check for scratch usage
Tom Stellard [Sat, 9 Aug 2014 01:06:53 +0000 (01:06 +0000)]
R600/SI: Update concat_vectors.ll to check for scratch usage

These tests were using SI-NOT: MOVREL to make sure concat vectors
weren't being lowered to stack loads and stores, but we are using
scratch buffers for the stack now instead of registers, so we need
to add an additional SI-NOT check for scratch buffers.

With this change I was able to uncover one broken test which will
be fixed in a future commit.

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

10 years agoFix expected windows result.
Rafael Espindola [Sat, 9 Aug 2014 00:37:05 +0000 (00:37 +0000)]
Fix expected windows result.

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

10 years agoFix typo.
Eric Christopher [Sat, 9 Aug 2014 00:26:27 +0000 (00:26 +0000)]
Fix typo.

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

10 years ago[MCJIT] Simplify immediate decoding code in the RuntimeDyldMachO hierarchy.
Lang Hames [Fri, 8 Aug 2014 23:12:22 +0000 (23:12 +0000)]
[MCJIT] Simplify immediate decoding code in the RuntimeDyldMachO hierarchy.

Cleanup only: no functional change.

This patch makes RuntimeDyldMachO targets directly responsible for decoding
immediates, rather than letting them implement catch a callback from generic
code. Since this is a very target specific operation, it makes sense to let the
target-specific code drive it.

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

10 years ago[FastISel][X86] Silence -Wenum-compare warning
Rui Ueyama [Fri, 8 Aug 2014 22:47:49 +0000 (22:47 +0000)]
[FastISel][X86] Silence -Wenum-compare warning

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

10 years agoFix the windows build.
Rafael Espindola [Fri, 8 Aug 2014 22:09:31 +0000 (22:09 +0000)]
Fix the windows build.

Sorry for the noise.

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

10 years agoReword comment slightly.
Eric Christopher [Fri, 8 Aug 2014 22:09:00 +0000 (22:09 +0000)]
Reword comment slightly.

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

10 years agoRemove dead code. Fixes pr20544.
Rafael Espindola [Fri, 8 Aug 2014 21:35:52 +0000 (21:35 +0000)]
Remove dead code. Fixes pr20544.

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

10 years agoConvert from Windows to Unix paths in sys::path::native.
Rafael Espindola [Fri, 8 Aug 2014 21:29:34 +0000 (21:29 +0000)]
Convert from Windows to Unix paths in sys::path::native.

Part of pr20544. Test to follow in a second.

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

10 years agoAllow large immediates for branch instructions in 32bit mode.
Joerg Sonnenberger [Fri, 8 Aug 2014 20:57:58 +0000 (20:57 +0000)]
Allow large immediates for branch instructions in 32bit mode.

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

10 years agoProvide an implementation of getNoopForMachoTarget for PPC, otherwise
Joerg Sonnenberger [Fri, 8 Aug 2014 19:13:23 +0000 (19:13 +0000)]
Provide an implementation of getNoopForMachoTarget for PPC, otherwise
empty functions will assert in the MC object writer.

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

10 years ago[FastISel][X86] Fix INC/DEC optimization (r215230)
Juergen Ributzka [Fri, 8 Aug 2014 18:47:04 +0000 (18:47 +0000)]
[FastISel][X86] Fix INC/DEC optimization (r215230)

I accidentally also used INC/DEC for unsigned arithmetic which doesn't work,
because INC/DEC don't set the required flag which is used for the overflow
check.

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

10 years agoAArch64: avoid deleting the current iterator in a loop.
Tim Northover [Fri, 8 Aug 2014 17:31:52 +0000 (17:31 +0000)]
AArch64: avoid deleting the current iterator in a loop.

std::map invalidates the iterator to any element that gets deleted, which means
we can't increment it correctly afterwards. This was causing Darwin test
failures.

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

10 years ago[FastISel][AArch64] Attach MachineMemOperands to load and store instructions.
Juergen Ributzka [Fri, 8 Aug 2014 17:24:10 +0000 (17:24 +0000)]
[FastISel][AArch64] Attach MachineMemOperands to load and store instructions.

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

10 years ago[FastISel][X86] Use INC/DEC when possible for {sadd|ssub}.with.overflow intrinsics.
Juergen Ributzka [Fri, 8 Aug 2014 17:21:37 +0000 (17:21 +0000)]
[FastISel][X86] Use INC/DEC when possible for {sadd|ssub}.with.overflow intrinsics.

This is a small peephole optimization to emit INC/DEC when possible.

Fixes <rdar://problem/17952308>.

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

10 years agoDebugInfo: Recommit (reverted in r215217, originally committed in r215157) the assert...
David Blaikie [Fri, 8 Aug 2014 17:12:35 +0000 (17:12 +0000)]
DebugInfo: Recommit (reverted in r215217, originally committed in r215157) the assertion that no argument variable is overwritten by subsequent argument variables.

This turned up a bug in clang where arguments were emitted with
duplicate argument numbers (see r215227).

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

10 years agoAArch64A57FPLoadBalancing.cpp: Define ColorNames in !NDEBUG.
NAKAMURA Takumi [Fri, 8 Aug 2014 17:00:59 +0000 (17:00 +0000)]
AArch64A57FPLoadBalancing.cpp: Define ColorNames in !NDEBUG.

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

10 years agoDataTypes.h.cmake: Define PRIx32 &c for !HAVE_INTTYPES_H hosts.
NAKAMURA Takumi [Fri, 8 Aug 2014 17:00:47 +0000 (17:00 +0000)]
DataTypes.h.cmake: Define PRIx32 &c for !HAVE_INTTYPES_H hosts.

I supposed PRIx32 might be unused in the tree.

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

10 years agoDelete dead code. NFC.
Rafael Espindola [Fri, 8 Aug 2014 16:49:35 +0000 (16:49 +0000)]
Delete dead code. NFC.

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

10 years agoAdded a TLI hook to signal that the target does not have or does not care about
Pedro Artigas [Fri, 8 Aug 2014 16:46:53 +0000 (16:46 +0000)]
Added a TLI hook to signal that the target does not have or does not care about
floating point exceptions, added use of flag to fold potentially exception
raising floating point math in selection DAG. No functionality change, as
targets have to explicitly ask for this behavior and none does today.

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

10 years agoAdd low-level option for avoiding float stores from va_start until
Joerg Sonnenberger [Fri, 8 Aug 2014 16:46:10 +0000 (16:46 +0000)]
Add low-level option for avoiding float stores from va_start until
soft-float is properly supported.

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

10 years agoAdd support for SPE load/store from memory.
Joerg Sonnenberger [Fri, 8 Aug 2014 16:43:49 +0000 (16:43 +0000)]
Add support for SPE load/store from memory.

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

10 years agogetLoadName is only implemented for ELF, make it ELF only.
Rafael Espindola [Fri, 8 Aug 2014 16:39:22 +0000 (16:39 +0000)]
getLoadName is only implemented for ELF, make it ELF only.

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

10 years agoUse a simpler predicate. NFC.
Rafael Espindola [Fri, 8 Aug 2014 16:30:17 +0000 (16:30 +0000)]
Use a simpler predicate. NFC.

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

10 years agoDebugInfo: Remove assertion (added in r215157) that's firing on a blocks
David Blaikie [Fri, 8 Aug 2014 16:21:50 +0000 (16:21 +0000)]
DebugInfo: Remove assertion (added in r215157) that's firing on a blocks
test in the test-suite while I investigate further.

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

10 years agopr20589: Fix duplicated arch flag.
Rafael Espindola [Fri, 8 Aug 2014 16:18:29 +0000 (16:18 +0000)]
pr20589: Fix duplicated arch flag.

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

10 years agopr20588: add missing calls to va_end.
Rafael Espindola [Fri, 8 Aug 2014 15:57:37 +0000 (15:57 +0000)]
pr20588: add missing calls to va_end.

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

10 years ago[mips] Invert the abicalls feature bit to be noabicalls so that it's possible for...
Daniel Sanders [Fri, 8 Aug 2014 15:47:17 +0000 (15:47 +0000)]
[mips] Invert the abicalls feature bit to be noabicalls so that it's possible for -mno-abicalls to take effect.

Also added the testcase that should have been in r215194.

This behaviour has surprised me a few times now. The problem is that the
generated MipsSubtarget::ParseSubtargetFeatures() contains code like this:

   if ((Bits & Mips::FeatureABICalls) != 0) IsABICalls = true;

so '-abicalls' means 'leave it at the default' and '+abicalls' means 'set it to
true'. In this case, (and the similar -modd-spreg case) I'd like the code to be

  IsABICalls = (Bits & Mips::FeatureABICalls) != 0;

or possibly:

   if ((Bits & Mips::FeatureABICalls) != 0)
     IsABICalls = true;
   else
     IsABICalls = false;

and preferably arrange for 'Bits & Mips::FeatureABICalls' to be true by default
(on some triples).

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

10 years agoAdd missing Interpreter intrinsic lowering for sin, cos and ceil
Josh Klontz [Fri, 8 Aug 2014 15:00:12 +0000 (15:00 +0000)]
Add missing Interpreter intrinsic lowering for sin, cos and ceil

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

10 years agoFix for #20408 - CMake LLVM_ENABLE_FFI=ON build fails on reconfigure
Josh Klontz [Fri, 8 Aug 2014 14:32:56 +0000 (14:32 +0000)]
Fix for #20408 - CMake LLVM_ENABLE_FFI=ON build fails on reconfigure

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

10 years ago[AArch64] Fix a type conversion bug for anlyzing compare.
Jiangning Liu [Fri, 8 Aug 2014 14:19:29 +0000 (14:19 +0000)]
[AArch64] Fix a type conversion bug for anlyzing compare.

The bug can cause spec2006/483.xalancbmk failure.

Patched by David Xu.

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

10 years agoFix bug 20125 - clang-format segfaults on bad config.
Rafael Espindola [Fri, 8 Aug 2014 13:58:00 +0000 (13:58 +0000)]
Fix bug 20125 - clang-format segfaults on bad config.

The problem was in unchecked dyn_cast inside of Input::createHNodes.
Patch by Roman Kashitsyn!

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

10 years ago[mips] Remove reason for XFAIL from a test that isn't actually XFAILed.
Daniel Sanders [Fri, 8 Aug 2014 12:58:17 +0000 (12:58 +0000)]
[mips] Remove reason for XFAIL from a test that isn't actually XFAILed.

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

10 years ago[LoopVectorizer] Enable support for floating-point subtraction reductions
James Molloy [Fri, 8 Aug 2014 12:41:08 +0000 (12:41 +0000)]
[LoopVectorizer] Enable support for floating-point subtraction reductions

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

10 years ago[AArch64] Add an FP load balancing pass for Cortex-A57
James Molloy [Fri, 8 Aug 2014 12:33:21 +0000 (12:33 +0000)]
[AArch64] Add an FP load balancing pass for Cortex-A57

For best-case performance on Cortex-A57, we should try to use a balanced mix of odd and even D-registers when performing a critical sequence of independent, non-quadword FP/ASIMD floating-point multiply or multiply-accumulate operations.

This pass attempts to detect situations where the register allocation may adversely affect this load balancing and to change the registers used so as to better utilize the CPU.

Ideally we'd just take each multiply or multiply-accumulate in turn and allocate it alternating even or odd registers. However, multiply-accumulates are most efficiently performed in the same functional unit as their accumulation operand. Therefore this pass tries to find maximal sequences ("Chains") of multiply-accumulates linked via their accumulation operand, and assign them all the same "color" (oddness/evenness).

This optimization affects S-register and D-register floating point multiplies and FMADD/FMAs, as well as vector (floating point only) muls and FMADD/FMA. Q register instructions (and 128-bit vector instructions) are not affected.

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

10 years agollvm-objdump: add missing % in format specifier.
Tim Northover [Fri, 8 Aug 2014 12:08:51 +0000 (12:08 +0000)]
llvm-objdump: add missing % in format specifier.

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

10 years agollvm-objdump: use portable format specifiers for info.
Tim Northover [Fri, 8 Aug 2014 12:00:09 +0000 (12:00 +0000)]
llvm-objdump: use portable format specifiers for info.

ARM bots (& others, I think, now that I look) were failing because we
were using incorrect printf-style format specifiers. They were wrong
on almost any platform, actually, just mostly harmlessly so.

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

10 years ago[mips] Initial implementation of -mabicalls/-mno-abicalls.
Daniel Sanders [Fri, 8 Aug 2014 10:01:29 +0000 (10:01 +0000)]
[mips] Initial implementation of -mabicalls/-mno-abicalls.

This patch implements the main rules for -mno-abicalls such as reserving $gp,
and emitting the correct .option directive.

Patch by Matheus Almeida and Toma Tabacu

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

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

10 years agoAArch64: stop trying to take control of all UnknownArch triples.
Tim Northover [Fri, 8 Aug 2014 08:27:44 +0000 (08:27 +0000)]
AArch64: stop trying to take control of all UnknownArch triples.

This short-circuited our error reporting for incorrectly specified
target triples (you'd get AArch64 code instead).

Should fix PR20567.

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

10 years ago[pr19635] Revert most of r170537, and add new testcase.
Patrik Hagglund [Fri, 8 Aug 2014 08:21:19 +0000 (08:21 +0000)]
[pr19635] Revert most of r170537, and add new testcase.

Patch provided by Andrey Kuharev.

Sorry, r170537 was obviously wrong.

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

10 years agoGlobalOpt: Optimize in the face of insertvalue/extractvalue
David Majnemer [Fri, 8 Aug 2014 05:50:43 +0000 (05:50 +0000)]
GlobalOpt: Optimize in the face of insertvalue/extractvalue

GlobalOpt didn't know how to simulate InsertValueInst or
ExtractValueInst.  Optimizing these is pretty straightforward.

N.B. This came up when looking at clang's IRGen for MS ABI member
pointers; they are represented as aggregates.

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

10 years agoFix llvm/test/DebugInfo/X86/recursive_inlining.ll to use %llc_dwarf.
NAKAMURA Takumi [Fri, 8 Aug 2014 02:24:05 +0000 (02:24 +0000)]
Fix llvm/test/DebugInfo/X86/recursive_inlining.ll to use %llc_dwarf.

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

10 years agoAArch64InstrInfo.cpp: Fix \param(s). [-Wdocumentation]
NAKAMURA Takumi [Fri, 8 Aug 2014 02:04:18 +0000 (02:04 +0000)]
AArch64InstrInfo.cpp: Fix \param(s). [-Wdocumentation]

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

10 years ago[tablegen] - Eliminate memory leaks in TGParser.cpp
Anton Yartsev [Fri, 8 Aug 2014 00:29:54 +0000 (00:29 +0000)]
[tablegen] - Eliminate memory leaks in TGParser.cpp

Ugly solution indicating that a refactoring is necessary to get the ownership under control.

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

10 years ago[AVX512] Add zero-masking variant to AVX512_masking multiclass
Adam Nemet [Thu, 7 Aug 2014 23:53:38 +0000 (23:53 +0000)]
[AVX512] Add zero-masking variant to AVX512_masking multiclass

This completes one item from the todo-list of r215125 "Generate masking
instruction variants with tablegen".

The AddedComplexity is needed just like for the k variant.

Added a codegen test based on valignq.

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

10 years agoFix for multi-line comment warning
Gerolf Hoflehner [Thu, 7 Aug 2014 23:19:55 +0000 (23:19 +0000)]
Fix for multi-line comment warning

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

10 years ago[AVX512] Add codegen test for the masking variant of valign
Adam Nemet [Thu, 7 Aug 2014 23:18:18 +0000 (23:18 +0000)]
[AVX512] Add codegen test for the masking variant of valign

The AddedComplexity is needed just like in avx512_perm_3src.  There may be a
bug in the complexity computation...

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

10 years ago[stack protector] Look through bitcasts to get global variable
Akira Hatanaka [Thu, 7 Aug 2014 23:08:24 +0000 (23:08 +0000)]
[stack protector] Look through bitcasts to get global variable
__stack_chk_guard.

Handle the case where the pointer operand of the load instruction that loads the
stack guard is not a global variable but instead a bitcast.

%StackGuard = load i8** bitcast (i64** @__stack_chk_guard to i8**)
call void @llvm.stackprotector(i8* %StackGuard, i8** %StackGuardSlot)

Original test case provided by Ana Pazos.

This fixes PR20558.

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

10 years agoMake these regexes stricter by disallowing any additional characters in the output.
Adrian Prantl [Thu, 7 Aug 2014 23:04:07 +0000 (23:04 +0000)]
Make these regexes stricter by disallowing any additional characters in the output.
Thanks to dblaikie for pointing this out!

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

10 years agoSLPVectorizer: Use the type of the value loaded/stored to get the ABI alignment
Arnold Schwaighofer [Thu, 7 Aug 2014 22:47:27 +0000 (22:47 +0000)]
SLPVectorizer: Use the type of the value loaded/stored to get the ABI alignment

We were using the pointer type which is incorrect.

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

10 years agoAdd a separate testcase for a DWARF expression describing a value in a
Adrian Prantl [Thu, 7 Aug 2014 22:44:34 +0000 (22:44 +0000)]
Add a separate testcase for a DWARF expression describing a value in a
subregister.

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

10 years agoReflow this comment.
Adrian Prantl [Thu, 7 Aug 2014 22:44:24 +0000 (22:44 +0000)]
Reflow this comment.

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

10 years agoDebugInfo: Fix overwriting/loss of inlined arguments to recursively inlined functions.
David Blaikie [Thu, 7 Aug 2014 22:22:49 +0000 (22:22 +0000)]
DebugInfo: Fix overwriting/loss of inlined arguments to recursively inlined functions.

Due to an unnecessary special case, inlined arguments that happened to
be from the same function as they were inlined into were misclassified
as non-inline arguments and would overwrite the non-inlined arguments.

Assert that we never overwrite a function's arguments, and stop
misclassifying inlined arguments as non-inline arguments to fix this
issue.

Excuse the rather crappy test case - handcrafted IR might do better, or
someone who understands better how to tickle the inliner to create a
recursive inlining situation like this (though it may also be necessary
to tickle the variable in a particular way to cause it to be recorded in
the MMI side table and go down this particular path for location
information).

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

10 years agofix materialization of one bit constants and global values which are accessed through
Reed Kotler [Thu, 7 Aug 2014 22:09:01 +0000 (22:09 +0000)]
fix materialization of one bit constants and global values which are accessed through
a base GOT entry.

Summary:
get tip of tree mips fast-isel to pass test-suite

Two bugs were fixed:

1) one bit booleans were treated as 1 bit signed integers and so the literal '1' could become sign extended.
2) mips uses got for pic but in certain cases, as with string constants for example, many items can be referenced from the same got entry and this case was not handled properly.

Test Plan: test-suite

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: mcrosier

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

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

10 years agoTemporarily Revert "Nuke the old JIT." as it's not quite ready to
Eric Christopher [Thu, 7 Aug 2014 22:02:54 +0000 (22:02 +0000)]
Temporarily Revert "Nuke the old JIT." as it's not quite ready to
be deleted. This will be reapplied as soon as possible and before
the 3.6 branch date at any rate.

Approved by Jim Grosbach, Lang Hames, Rafael Espindola.

This reverts commits r215111, 215115, 215116, 215117, 215136.

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

10 years agoDebugging Utility - optional ability for dumping critical path length
Gerolf Hoflehner [Thu, 7 Aug 2014 21:49:44 +0000 (21:49 +0000)]
Debugging Utility - optional ability for dumping critical path length

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

10 years agoMachineCombiner Pass for selecting faster instruction sequence on AArch64
Gerolf Hoflehner [Thu, 7 Aug 2014 21:40:58 +0000 (21:40 +0000)]
MachineCombiner Pass for selecting faster instruction sequence on AArch64

Re-commit of r214832,r21469 with a work-around that
avoids the previous problem with gcc build compilers

The work-around is to use SmallVector instead of ArrayRef
of basic blocks in preservesResourceLen()/MachineCombiner.cpp

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

10 years agoAdd two missing ARM cpusubtypes to the switch statement in
Kevin Enderby [Thu, 7 Aug 2014 21:30:25 +0000 (21:30 +0000)]
Add two missing ARM cpusubtypes to the switch statement in
MachOObjectFile::getArch(uint32_t CPUType, uint32_t CPUSubType) .

Upcoming changes will cause existing test cases to use this but
I wanted to check in this obvious change separately.

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

10 years agoFix a case in SROA where lifetime intrinsics could inhibit alloca promotion. In
Owen Anderson [Thu, 7 Aug 2014 21:07:35 +0000 (21:07 +0000)]
Fix a case in SROA where lifetime intrinsics could inhibit alloca promotion.  In
this case, the code path dealing with vector promotion was missing the explicit
checks for lifetime intrinsics that were present on the corresponding integer
promotion path.

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

10 years ago[MCJIT] Replace a c-style cast with reinterpret_cast + static_cast.
Lang Hames [Thu, 7 Aug 2014 20:41:57 +0000 (20:41 +0000)]
[MCJIT] Replace a c-style cast with reinterpret_cast + static_cast.

C-style casts (and reinterpret_casts) result in implementation defined
values when a pointer is cast to a larger integer type. On some platforms
this was leading to bogus address computations in RuntimeDyldMachOAArch64.

This should fix http://llvm.org/PR20501.

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

10 years agoRemove Support/IncludeFile.h and its only user. This is actively harmful, since
Richard Smith [Thu, 7 Aug 2014 20:41:17 +0000 (20:41 +0000)]
Remove Support/IncludeFile.h and its only user. This is actively harmful, since
it breaks the modules builds (where CallGraph.h can be quite reasonably
transitively included by an unimported portion of a module, and CallGraph.cpp
not linked in), and appears to have been entirely redundant since PR780 was
fixed back in 2008.

If this breaks anything, please revert; I have only tested this with a single
configuration, and it's possible that this is still somehow fixing something
(though I doubt it, since no other similar file uses this mechanism any more).

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

10 years agoFix test failure on ARM.
Rafael Espindola [Thu, 7 Aug 2014 20:33:06 +0000 (20:33 +0000)]
Fix test failure on ARM.

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

10 years ago[modules] Update module map workaround to cope with the problematic file having
Richard Smith [Thu, 7 Aug 2014 20:27:08 +0000 (20:27 +0000)]
[modules] Update module map workaround to cope with the problematic file having
been relocated.

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

10 years agotest commit: remove trailing whitespace.
Frederic Riss [Thu, 7 Aug 2014 20:04:00 +0000 (20:04 +0000)]
test commit: remove trailing whitespace.

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

10 years agoRemove a few XFAILs.
Rafael Espindola [Thu, 7 Aug 2014 19:35:22 +0000 (19:35 +0000)]
Remove a few XFAILs.

These tests now pass with MCJIT.

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

10 years ago[Branch probability] Recompute branch weights of tail-merged basic blocks.
Akira Hatanaka [Thu, 7 Aug 2014 19:30:13 +0000 (19:30 +0000)]
[Branch probability] Recompute branch weights of tail-merged basic blocks.

BranchFolderPass was not correctly setting the basic block branch weights when
tail-merging created or merged blocks. This patch recomutes the weights of
tail-merged blocks using the following formula:

branch_weight(merged block to successor j) =
sum(block_frequency(bb) * branch_probability(bb -> j))

bb is a block that is in the set of merged blocks.

<rdar://problem/16256423>

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

10 years agoAdd the majority of the remaining SPE instructions.
Joerg Sonnenberger [Thu, 7 Aug 2014 18:52:39 +0000 (18:52 +0000)]
Add the majority of the remaining SPE instructions.

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

10 years agoFileCheck: Add a flag to allow checking empty input
Justin Bogner [Thu, 7 Aug 2014 18:40:37 +0000 (18:40 +0000)]
FileCheck: Add a flag to allow checking empty input

Currently FileCheck errors out on empty input. This is usually the
right thing to do, but makes testing things like "this command does
not emit some error message" hard to test. This usually leads to
people using "command 2>&1 | count 0" instead, and then the bots that
use guard malloc fail a few hours later.

By adding a flag to FileCheck that allows empty inputs, we can make
tests that consist entirely of "CHECK-NOT" lines feasible.

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

10 years agoIndent
Joerg Sonnenberger [Thu, 7 Aug 2014 18:05:32 +0000 (18:05 +0000)]
Indent

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

10 years ago[AVX512] Generate masking instruction variants with tablegen
Adam Nemet [Thu, 7 Aug 2014 17:53:55 +0000 (17:53 +0000)]
[AVX512] Generate masking instruction variants with tablegen

After adding the masking variants to several instructions, I have decided to
experiment with generating these from the non-masking/unconditional
variant. This will hopefully reduce the amount repetition that we currently
have in order to define an instruction with all its variants (for a reg/mem
instruction this would be 6 instruction defs and 2 Pat<> for the intrinsic).

The patch is the first cut that is currently only applied to valignd/q to make
the patch small.

A few notes on the approach:

  * In order to stitch together the dag for both the conditional and the
  unconditional patterns I pass the RHS of the set rather than the full
  pattern (set dest, RHS).
  * Rather than subclassing each instruction base class (e.g. AVX512AIi8),
  with a masking variant which wouldn't scale, I derived the masking
  instructions from a new base class AVX512 (this is just I<> with
  Requires<HasAVX512>).  The instructions derive from this now, plus a new set
  of classes that add the format bits and everything else that instruction
  base class provided (i.e. AVX512AIi8 vs. AVX512AIi8Base).

I hope we can go incrementally from here.  I expect that:

  * We will need different variants of the masking class.  One example is
  instructions requiring three vector sources.  In this case we tie one of the
  source operands to dest rather than a new implicit source operand ($src0)
  * Add the zero-masking variant
  * Add more AVX512*Base classes as new uses are added

I've looked at X86.td.expanded before and after to make sure that nothing got
lost for valignd/q.

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

10 years agollvm/test/tools/llvm-objdump: Reorganize target-dependent some tests.
NAKAMURA Takumi [Thu, 7 Aug 2014 17:17:19 +0000 (17:17 +0000)]
llvm/test/tools/llvm-objdump: Reorganize target-dependent some tests.

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

10 years agoFix the ocaml bindings.
Rafael Espindola [Thu, 7 Aug 2014 14:48:13 +0000 (14:48 +0000)]
Fix the ocaml bindings.

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

10 years agofix configure+make build
Rafael Espindola [Thu, 7 Aug 2014 14:38:49 +0000 (14:38 +0000)]
fix configure+make build

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

10 years agoRemove empty directories.
Rafael Espindola [Thu, 7 Aug 2014 14:25:55 +0000 (14:25 +0000)]
Remove empty directories.

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

10 years agoNuke the old JIT.
Rafael Espindola [Thu, 7 Aug 2014 14:21:18 +0000 (14:21 +0000)]
Nuke the old JIT.

I am sure we will be finding bits and pieces of dead code for years to
come, but this is a good start.

Thanks to Lang Hames for making MCJIT a good replacement!

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

10 years agoAdd mfasr and mtasr
Joerg Sonnenberger [Thu, 7 Aug 2014 13:35:34 +0000 (13:35 +0000)]
Add mfasr and mtasr

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

10 years agoAdd mfrtcu and mfrtcl instructions
Joerg Sonnenberger [Thu, 7 Aug 2014 13:16:58 +0000 (13:16 +0000)]
Add mfrtcu and mfrtcl instructions

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

10 years agoSupport mttbl and mttbu mnemonic
Joerg Sonnenberger [Thu, 7 Aug 2014 13:06:23 +0000 (13:06 +0000)]
Support mttbl and mttbu mnemonic

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

10 years agoAdd RFID instruction.
Joerg Sonnenberger [Thu, 7 Aug 2014 12:39:59 +0000 (12:39 +0000)]
Add RFID instruction.

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

10 years agoFix Itineray class of rfi
Joerg Sonnenberger [Thu, 7 Aug 2014 12:35:16 +0000 (12:35 +0000)]
Fix Itineray class of rfi

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

10 years agoSpell e500 feature in lower case.
Joerg Sonnenberger [Thu, 7 Aug 2014 12:31:28 +0000 (12:31 +0000)]
Spell e500 feature in lower case.

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

10 years agoAdd first bunch of SPE instructions. As they overlap with Altivec, mark
Joerg Sonnenberger [Thu, 7 Aug 2014 12:18:21 +0000 (12:18 +0000)]
Add first bunch of SPE instructions. As they overlap with Altivec, mark
them as parser-only until the disassembler is extended to handle
predicates properly.

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

10 years agoInsert parens to avoid a warning:
Alexander Kornienko [Thu, 7 Aug 2014 12:09:34 +0000 (12:09 +0000)]
Insert parens to avoid a warning:
  suggest parentheses around arithmetic in operand of '^' [-Wparentheses]

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

10 years agoSilencing an MSVC C4334 warning ('<<' : result of 32-bit shift implicitly converted...
Aaron Ballman [Thu, 7 Aug 2014 12:07:33 +0000 (12:07 +0000)]
Silencing an MSVC C4334 warning ('<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)). No functional changes intended.

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

10 years ago[mips] Add assembler support for .set msa/nomsa directive.
Daniel Sanders [Thu, 7 Aug 2014 12:03:36 +0000 (12:03 +0000)]
[mips] Add assembler support for .set msa/nomsa directive.

Summary:
These directives are used to toggle whether the assembler accepts MSA-specific instructions or not.

Patch by Matheus Almeida and Toma Tabacu.

Reviewers: dsanders

Reviewed By: dsanders

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

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

10 years agoFix lld-x86_64-win7 Build #11969
Pavel Chupin [Thu, 7 Aug 2014 11:09:59 +0000 (11:09 +0000)]
Fix lld-x86_64-win7 Build #11969

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

10 years ago[x86] Fix another miscompile found through fuzz testing the new vector
Chandler Carruth [Thu, 7 Aug 2014 10:37:35 +0000 (10:37 +0000)]
[x86] Fix another miscompile found through fuzz testing the new vector
shuffle lowering.

This is closely related to the previous one. Here we failed to use the
source offset when swapping in the other case -- where we end up
swapping the *final* shuffle. The cause of this bug is a bit different:
I simply wasn't thinking about the fact that this mask is actually
a slice of a wide mask and thus has numbers that need SourceOffset
applied. Simple fix. Would be even more simple with an algorithm-y thing
to use here, but correctness first. =]

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

10 years ago[x86] Fix another miscompile in the new vector shuffle lowering found
Chandler Carruth [Thu, 7 Aug 2014 10:14:27 +0000 (10:14 +0000)]
[x86] Fix another miscompile in the new vector shuffle lowering found
via the fuzz tester.

Here I missed an offset when round-tripping a value through a shuffle
mask. I got it right 2 lines below. See a problem? I do. ;] I'll
probably be adding a little "swap" algorithm which accepts a range and
two values and swaps those values where they occur in the range. Don't
really have a name for it, let me know if you do.

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

10 years ago[x86] Fix another miscompile in the new vector shuffle lowering found
Chandler Carruth [Thu, 7 Aug 2014 09:45:02 +0000 (09:45 +0000)]
[x86] Fix another miscompile in the new vector shuffle lowering found
through the new fuzzer.

This one is great: bad operator precedence led the modulus to happen at
the wrong point. All the asserts didn't fire because there were usually
the right values past the end of the 4 element region we were looking
at. Probably could have gotten a crash here with ASan + fuzzing, but the
correctness tests pinpointed this really nicely.

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

10 years ago[x32] Use ebp/esp as frame and stack pointer
Pavel Chupin [Thu, 7 Aug 2014 09:41:19 +0000 (09:41 +0000)]
[x32] Use ebp/esp as frame and stack pointer

Summary:
Since pointers are 32-bit on x32 we can use ebp and esp as frame and stack
pointer. Some operations like PUSH/POP and CFI_INSTRUCTION still
require 64-bit register, so using 64-bit MachineFramePtr where required.

X86_64 NaCl uses 64-bit frame/stack pointers, however it's been found that
both isTarget64BitLP64 and isTarget64BitILP32 are true for NaCl. Addressing
this issue here as well by making isTarget64BitLP64 false.

Also mark hasReservedSpillSlot unreachable on X86. See inlined comments.

Test Plan: Add one new simple test and upgrade 2 existing with x32 target case.

Reviewers: nadav, dschuff

Subscribers: llvm-commits, zinovy.nis

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

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

10 years ago[x86] Fix a miscompile in the new shuffle lowering found through the new
Chandler Carruth [Thu, 7 Aug 2014 08:11:31 +0000 (08:11 +0000)]
[x86] Fix a miscompile in the new shuffle lowering found through the new
fuzz testing.

The function which tested for adjacency did what it said on the tin, but
when I called it, I wanted it to do something more thorough: I wanted to
know if the *pairs* of shuffle elements were adjacent and started at
0 mod 2. In one place I had the decency to try to test for this, but in
the other it was completely skipped, miscompiling this test case. Fix
this by making the helper actually do what I wanted it to do everywhere
I called it (and removing the now redundant code in one place).

I *really* dislike the name "canWidenShuffleElements" for this
predicate. If anyone can come up with a better name, please let me know.
The other name I thought about was "canWidenShuffleMask" but is it
really widening the mask to reduce the number of lanes shuffled? I don't
know. Naming things is hard.

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

10 years agoUpdate Tablegen documents given that binary literals are now sized
Pete Cooper [Thu, 7 Aug 2014 05:47:13 +0000 (05:47 +0000)]
Update Tablegen documents given that binary literals are now sized

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

10 years agoUpdate BitRecTy::convertValue to allow if expressions with bit values on both sides...
Pete Cooper [Thu, 7 Aug 2014 05:47:10 +0000 (05:47 +0000)]
Update BitRecTy::convertValue to allow if expressions with bit values on both sides of the if

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

10 years agoChange the { } expression in tablegen to accept sized binary literals which are not...
Pete Cooper [Thu, 7 Aug 2014 05:47:07 +0000 (05:47 +0000)]
Change the { } expression in tablegen to accept sized binary literals which are not just 0 and 1.

It also allows nested { } expressions, as now that they are sized, we can merge pull bits from the nested value.

In the current behaviour, everything in { } must have been convertible to a single bit.
However, now that binary literals are sized, its useful to be able to initialize a range of bits.

So, for example, its now possible to do

bits<8> x = { 0, 1, { 0b1001 }, 0, 0b0 }

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

10 years agoChange BitsInit to inherit from TypedInit.
Pete Cooper [Thu, 7 Aug 2014 05:47:04 +0000 (05:47 +0000)]
Change BitsInit to inherit from TypedInit.

This is useful in a later patch where binary literals such as 0b000 will become BitsInit values instead of IntInit values.

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

10 years agoChange TableGen so that binary literals such as 0b001 are now sized.
Pete Cooper [Thu, 7 Aug 2014 05:47:00 +0000 (05:47 +0000)]
Change TableGen so that binary literals such as 0b001 are now sized.

Instead of these becoming an integer literal internally, they now become bits<n> values.

Prior to this change, 0b001 was 1 bit long.  This is confusing as clearly the user gave 3 bits.
This new type holds both the literal value and the size, and so can ensure sizes match on initializers.

For example, this used to be legal

bits<1> x = 0b00;

but now it must be written as

bits<2> x = 0b00;

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

10 years agoTableGen: Change { } to only accept bits<n> entries when n == 1.
Pete Cooper [Thu, 7 Aug 2014 05:46:57 +0000 (05:46 +0000)]
TableGen: Change { } to only accept bits<n> entries when n == 1.

Prior to this change, it was legal to do something like

  bits<2> opc = { 0, 1 };
  bits<2> opc2 = { 1, 0 };
  bits<2> a = { opc, opc2 };

This involved silently dropping bits from opc and opc2 which is very hard to debug.

Now the above test would be an error.  Having tested with an assert, none of LLVM/clang was relying on this behaviour.

Thanks to Adam Nemet for the above test.

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

10 years agoFix a whole bunch of binary literals which were the wrong size. All were being silen...
Pete Cooper [Thu, 7 Aug 2014 05:46:54 +0000 (05:46 +0000)]
Fix a whole bunch of binary literals which were the wrong size.  All were being silently zero extended to the correct width.

The commit after this changes { } and 0bxx literals to be of type bits<n> and not int.  This means we need to write exactly the right number of bits, and not rely on the values being silently zero extended for us.

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