oota-llvm.git
12 years agoRename createCodeEmitter to createMCCodeEmitter; createObjectStreamer to createMCObje...
Evan Cheng [Tue, 26 Jul 2011 00:42:34 +0000 (00:42 +0000)]
Rename createCodeEmitter to createMCCodeEmitter; createObjectStreamer to createMCObjectStreamer.

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

12 years agoRemove a file from CMakeLists.txt that Evan removed in r136027.
Chandler Carruth [Tue, 26 Jul 2011 00:30:33 +0000 (00:30 +0000)]
Remove a file from CMakeLists.txt that Evan removed in r136027.

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

12 years agoRename TargetAsmParser to MCTargetAsmParser and TargetAsmLexer to MCTargetAsmLexer...
Evan Cheng [Tue, 26 Jul 2011 00:24:13 +0000 (00:24 +0000)]
Rename TargetAsmParser to MCTargetAsmParser and TargetAsmLexer to MCTargetAsmLexer; rename createAsmLexer to createMCAsmLexer and createAsmParser to createMCAsmParser.

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

12 years agoStill more library dependency updates. This reflects the ever decreasing
Chandler Carruth [Tue, 26 Jul 2011 00:09:11 +0000 (00:09 +0000)]
Still more library dependency updates. This reflects the ever decreasing
dependence on CodeGen layers and backends from the MC layers.

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

12 years agoClean up a pile of hacks in our CMake build relating to TableGen.
Chandler Carruth [Tue, 26 Jul 2011 00:09:08 +0000 (00:09 +0000)]
Clean up a pile of hacks in our CMake build relating to TableGen.

The first problem to fix is to stop creating synthetic *Table_gen
targets next to all of the LLVM libraries. These had no real effect as
CMake specifies that add_custom_command(OUTPUT ...) directives (what the
'tablegen(...)' stuff expands to) are implicitly added as dependencies
to all the rules in that CMakeLists.txt.

These synthetic rules started to cause problems as we started more and
more heavily using tablegen files from *subdirectories* of the one where
they were generated. Within those directories, the set of tablegen
outputs was still available and so these synthetic rules added them as
dependencies of those subdirectories. However, they were no longer
properly associated with the custom command to generate them. Most of
the time this "just worked" because something would get to the parent
directory first, and run tablegen there. Once run, the files existed and
the build proceeded happily. However, as more and more subdirectories
have started using this, the probability of this failing to happen has
increased. Recently with the MC refactorings, it became quite common for
me when touching a large enough number of targets.

To add insult to injury, several of the backends *tried* to fix this by
adding explicit dependencies back to the parent directory's tablegen
rules, but those dependencies didn't work as expected -- they weren't
forming a linear chain, they were adding another thread in the race.

This patch removes these synthetic rules completely, and adds a much
simpler function to declare explicitly that a collection of tablegen'ed
files are referenced by other libraries. From that, we can add explicit
dependencies from the smaller libraries (such as every architectures
Desc library) on this and correctly form a linear sequence. All of the
backends are updated to use it, sometimes replacing the existing attempt
at adding a dependency, sometimes adding a previously missing dependency
edge.

Please let me know if this causes any problems, but it fixes a rather
persistent and problematic source of build flakiness on our end.

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

12 years agoARM assembly parsing and encoding for SSAX, SSUB16 and SSUB8.
Jim Grosbach [Mon, 25 Jul 2011 23:32:14 +0000 (23:32 +0000)]
ARM assembly parsing and encoding for SSAX, SSUB16 and SSUB8.

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

12 years agoTargetAsmBackend has been renamed to MCAsmBackend.
Evan Cheng [Mon, 25 Jul 2011 23:28:36 +0000 (23:28 +0000)]
TargetAsmBackend has been renamed to MCAsmBackend.

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

12 years agoRename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to createMCAsmBackend.
Evan Cheng [Mon, 25 Jul 2011 23:24:55 +0000 (23:24 +0000)]
Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to createMCAsmBackend.

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

12 years agoInitial implementation of 'fence' instruction, the new C++0x-style replacement for...
Eli Friedman [Mon, 25 Jul 2011 23:16:38 +0000 (23:16 +0000)]
Initial implementation of 'fence' instruction, the new C++0x-style replacement for llvm.memory.barrier.

This is just a LangRef entry and reading/writing/memory representation; optimizer+codegen support coming soon.

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

12 years agoFinish adding support for lifetime intrinsics to SROA. Fixes PR10121!
Nick Lewycky [Mon, 25 Jul 2011 23:14:22 +0000 (23:14 +0000)]
Finish adding support for lifetime intrinsics to SROA. Fixes PR10121!

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

12 years agoI will save before I commit.
Benjamin Kramer [Mon, 25 Jul 2011 23:10:23 +0000 (23:10 +0000)]
I will save before I commit.
I will save before I commit.
I will save before I commit.
I will save before I commit.

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

12 years agoARM assembly parsing and encoding for SSAT16 instruction.
Jim Grosbach [Mon, 25 Jul 2011 23:09:14 +0000 (23:09 +0000)]
ARM assembly parsing and encoding for SSAT16 instruction.

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

12 years agoCodegen allonesvector better while using AVX: vpcmpeqd + vinsertf128
Bruno Cardoso Lopes [Mon, 25 Jul 2011 23:05:32 +0000 (23:05 +0000)]
Codegen allonesvector better while using AVX: vpcmpeqd + vinsertf128
This also fixes PR10452

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

12 years agoAdd remaining 256-bit vector bitcasts. This also fixes PR10451
Bruno Cardoso Lopes [Mon, 25 Jul 2011 23:05:28 +0000 (23:05 +0000)]
Add remaining 256-bit vector bitcasts. This also fixes PR10451

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

12 years ago- Handle special scalar_to_vector case: splats. Using a native 128-bit
Bruno Cardoso Lopes [Mon, 25 Jul 2011 23:05:25 +0000 (23:05 +0000)]
- Handle special scalar_to_vector case: splats. Using a native 128-bit
shuffle before inserting on a 256-bit vector.
- Add AVX versions of movd/movq instructions
- Introduce a few COPY patterns to match insert_subvector instructions.
This turns a trivial insert_subvector instruction into a register copy,
coalescing the xmm into a ymm and avoid emiting on more instruction.

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

12 years agoReintroduce r135730, this is indeed the right approach, there is no
Bruno Cardoso Lopes [Mon, 25 Jul 2011 23:05:16 +0000 (23:05 +0000)]
Reintroduce r135730, this is indeed the right approach, there is no
native 256-bit vector instruction to do scalar_to_vector.

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

12 years agollvm-objdump: Ignore unreachable blocks when printing the CFG.
Benjamin Kramer [Mon, 25 Jul 2011 23:04:36 +0000 (23:04 +0000)]
llvm-objdump: Ignore unreachable blocks when printing the CFG.

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

12 years agoFix include guards.
Evan Cheng [Mon, 25 Jul 2011 22:52:04 +0000 (22:52 +0000)]
Fix include guards.

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

12 years agoAdd a note about efficient codegen for binary log.
Benjamin Kramer [Mon, 25 Jul 2011 22:30:00 +0000 (22:30 +0000)]
Add a note about efficient codegen for binary log.

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

12 years agoAttempt to fix test failure reported on llvm-commits.
Eli Friedman [Mon, 25 Jul 2011 22:28:51 +0000 (22:28 +0000)]
Attempt to fix test failure reported on llvm-commits.

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

12 years agoBranchProbability::print returns void now.
Jakub Staszak [Mon, 25 Jul 2011 22:27:42 +0000 (22:27 +0000)]
BranchProbability::print returns void now.

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

12 years agoMake sure this DAGCombine actually returns an UNDEF of the correct type; PR10476.
Eli Friedman [Mon, 25 Jul 2011 22:25:42 +0000 (22:25 +0000)]
Make sure this DAGCombine actually returns an UNDEF of the correct type; PR10476.

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

12 years agoAdd BlockFrequency class.
Jakub Staszak [Mon, 25 Jul 2011 22:24:51 +0000 (22:24 +0000)]
Add BlockFrequency class.

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

12 years agoARM assembly parsing and encoding for SSAT instruction.
Jim Grosbach [Mon, 25 Jul 2011 22:20:28 +0000 (22:20 +0000)]
ARM assembly parsing and encoding for SSAT instruction.

Fix the Rn register encoding for both SSAT and USAT. Update the parsing of the
shift operand to correctly handle the allowed shift types and immediate ranges
and issue meaningful diagnostics when an illegal value or shift type is
specified. Add aliases to parse an ommitted shift operand (default value of
'lsl #0').

Add tests for diagnostics and proper encoding.

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

12 years agoAdd clarifying comments for the new arguments to UnrollLoop.
Andrew Trick [Mon, 25 Jul 2011 22:17:47 +0000 (22:17 +0000)]
Add clarifying comments for the new arguments to UnrollLoop.

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

12 years agoRefactoring fail.
Evan Cheng [Mon, 25 Jul 2011 22:16:37 +0000 (22:16 +0000)]
Refactoring fail.

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

12 years agoMove CBackend and CppBackend MC initialization to TargetInfo.
Evan Cheng [Mon, 25 Jul 2011 21:44:12 +0000 (21:44 +0000)]
Move CBackend and CppBackend MC initialization to TargetInfo.

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

12 years agoGet rid of an incorrect optimization for shuffles with PALIGNR and simplify isPALIGNR...
Eli Friedman [Mon, 25 Jul 2011 21:36:45 +0000 (21:36 +0000)]
Get rid of an incorrect optimization for shuffles with PALIGNR and simplify isPALIGNRMask.

Addresses PR10466, although the crash from that PR only triggers in cases where DAGCombine misses optimizing a shuffle.

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

12 years agoFix more MC layering violations.
Evan Cheng [Mon, 25 Jul 2011 21:32:49 +0000 (21:32 +0000)]
Fix more MC layering violations.

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

12 years agoMore MC layering violations.
Evan Cheng [Mon, 25 Jul 2011 21:29:26 +0000 (21:29 +0000)]
More MC layering violations.

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

12 years agoCheck in updated CMake dependencies after Evan's latest round of
Chandler Carruth [Mon, 25 Jul 2011 21:25:07 +0000 (21:25 +0000)]
Check in updated CMake dependencies after Evan's latest round of
refactorings. Several places that shouldn't have dependend on Target no
longer do. Also almost all of the CodeGen dependencies have gone away
for the MCDisassembler. Others add reasonable dependencies within the
target-specific layers.

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

12 years agoAdd a missing enumerator to this switch. Currently its in the
Chandler Carruth [Mon, 25 Jul 2011 21:21:08 +0000 (21:21 +0000)]
Add a missing enumerator to this switch. Currently its in the
assert-path code, as previously we would have fallen off the end of the
function, but please review and let me know if this should go somewhere
else.

This fixes a Clang warning:
lib/MC/MCMachOStreamer.cpp:201:11: error: enumeration value 'MCSA_IndirectSymbol' not handled in switch [-Werror,-Wswitch-enum]
  switch (Attribute) {
          ^
1 error generated.

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

12 years agoAdd LLVMAddTargetLibraryInfo to the C API.
Rafael Espindola [Mon, 25 Jul 2011 21:20:54 +0000 (21:20 +0000)]
Add LLVMAddTargetLibraryInfo to the C API.

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

12 years agoSeparate MCInstPrinter registration from AsmPrinter registration.
Evan Cheng [Mon, 25 Jul 2011 21:20:24 +0000 (21:20 +0000)]
Separate MCInstPrinter registration from AsmPrinter registration.

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

12 years agoAdd missing space (this line is no longer pushing the 80-column limit).
Nick Lewycky [Mon, 25 Jul 2011 21:16:04 +0000 (21:16 +0000)]
Add missing space (this line is no longer pushing the 80-column limit).

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

12 years ago80 columns.
Nick Lewycky [Mon, 25 Jul 2011 21:13:23 +0000 (21:13 +0000)]
80 columns.

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

12 years agoFix typo.
Nick Lewycky [Mon, 25 Jul 2011 21:12:44 +0000 (21:12 +0000)]
Fix typo.

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

12 years agoSimply ARM so_reg MIOperandInfo definitions.
Jim Grosbach [Mon, 25 Jul 2011 21:04:58 +0000 (21:04 +0000)]
Simply ARM so_reg MIOperandInfo definitions.

The shift immediate encoding, printing, etc. is handled directly by the
enclosing operand definition, so it should be a vanilla immediate, not a
nested complex operand (shift_imm).

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

12 years agoAdd LLVMAddLowerExpectIntrinsicPass to the C API.
Rafael Espindola [Mon, 25 Jul 2011 20:57:59 +0000 (20:57 +0000)]
Add LLVMAddLowerExpectIntrinsicPass to the C API.

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

12 years agoFix last bits of MC layer issues. llvm-mc doesn't need to initialize TargetMachine...
Evan Cheng [Mon, 25 Jul 2011 20:53:02 +0000 (20:53 +0000)]
Fix last bits of MC layer issues. llvm-mc doesn't need to initialize TargetMachine's anymore.

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

12 years agoARM asm operand renaming. Make things a bit more explicit.
Jim Grosbach [Mon, 25 Jul 2011 20:49:51 +0000 (20:49 +0000)]
ARM asm operand renaming. Make things a bit more explicit.

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

12 years agoMore simple cleanup of ARM asm operand definitions.
Jim Grosbach [Mon, 25 Jul 2011 20:38:18 +0000 (20:38 +0000)]
More simple cleanup of ARM asm operand definitions.

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

12 years agoFix some typos.
Bill Wendling [Mon, 25 Jul 2011 20:25:03 +0000 (20:25 +0000)]
Fix some typos.

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

12 years agoAn initial description of the compact unwind encoding.
Bill Wendling [Mon, 25 Jul 2011 20:19:48 +0000 (20:19 +0000)]
An initial description of the compact unwind encoding.

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

12 years agoCode clean up.
Evan Cheng [Mon, 25 Jul 2011 20:18:48 +0000 (20:18 +0000)]
Code clean up.

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

12 years agoRefactor MBlaze target to separate MC routines from Target routines.
Evan Cheng [Mon, 25 Jul 2011 20:18:18 +0000 (20:18 +0000)]
Refactor MBlaze target to separate MC routines from Target routines.

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

12 years agoWhile building a LLVM target, put the current source directory on the
Oscar Fuentes [Mon, 25 Jul 2011 20:17:01 +0000 (20:17 +0000)]
While building a LLVM target, put the current source directory on the
header search path.

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

12 years agoUpdate the comment. This feature is available only on Darwin at the moment. Though...
Bill Wendling [Mon, 25 Jul 2011 20:15:15 +0000 (20:15 +0000)]
Update the comment. This feature is available only on Darwin at the moment. Though it's not Darwin-specific.

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

12 years agoMake assembly parser method names more consistent.
Jim Grosbach [Mon, 25 Jul 2011 20:14:50 +0000 (20:14 +0000)]
Make assembly parser method names more consistent.

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

12 years agoUnbreak the build.
Oscar Fuentes [Mon, 25 Jul 2011 20:13:36 +0000 (20:13 +0000)]
Unbreak the build.

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

12 years agoFix class description.
Jakub Staszak [Mon, 25 Jul 2011 20:08:58 +0000 (20:08 +0000)]
Fix class description.

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

12 years agoFix #include guard directive.
Jakub Staszak [Mon, 25 Jul 2011 20:08:00 +0000 (20:08 +0000)]
Fix #include guard directive.

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

12 years agoTidy up formatting.
Jim Grosbach [Mon, 25 Jul 2011 20:06:30 +0000 (20:06 +0000)]
Tidy up formatting.

Remove some inititalizers that are the same as the default, move defs next to
their (singular) uses and generally simplify some formatting of asm operand
definitions.

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

12 years agoTidy up a bit.
Jim Grosbach [Mon, 25 Jul 2011 20:00:32 +0000 (20:00 +0000)]
Tidy up a bit.

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

12 years agoMissed a file.
Evan Cheng [Mon, 25 Jul 2011 19:55:33 +0000 (19:55 +0000)]
Missed a file.

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

12 years agoRefactor PPC target to separate MC routines from Target routines.
Evan Cheng [Mon, 25 Jul 2011 19:53:23 +0000 (19:53 +0000)]
Refactor PPC target to separate MC routines from Target routines.

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

12 years agoMore refactoring.
Evan Cheng [Mon, 25 Jul 2011 19:33:48 +0000 (19:33 +0000)]
More refactoring.

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

12 years agoRename BlockFrequency to BlockFrequencyInfo and MachineBlockFrequency to
Jakub Staszak [Mon, 25 Jul 2011 19:25:40 +0000 (19:25 +0000)]
Rename BlockFrequency to BlockFrequencyInfo and MachineBlockFrequency to
MachineBlockFrequencyInfo.

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

12 years agoRefactor X86 target to separate MC code from Target code.
Evan Cheng [Mon, 25 Jul 2011 18:43:53 +0000 (18:43 +0000)]
Refactor X86 target to separate MC code from Target code.

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

12 years agoChanged disabled code into a flag.
Bill Wendling [Mon, 25 Jul 2011 18:04:49 +0000 (18:04 +0000)]
Changed disabled code into a flag.

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

12 years agoRemove dead variable.
Bill Wendling [Mon, 25 Jul 2011 18:01:27 +0000 (18:01 +0000)]
Remove dead variable.

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

12 years agoAfter we've modified the prolog to save volatile registers, generate the compact
Bill Wendling [Mon, 25 Jul 2011 18:00:28 +0000 (18:00 +0000)]
After we've modified the prolog to save volatile registers, generate the compact
unwind encoding for that function. This simply crawls through the prolog looking
for machine instrs marked as "frame setup". It can calculate from these what the
compact unwind should look like.

This is currently disabled because of needed linker support. But initial tests
look good.

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

12 years agoMove some ELF directives into ELF asm parser.
Jim Grosbach [Mon, 25 Jul 2011 17:55:35 +0000 (17:55 +0000)]
Move some ELF directives into ELF asm parser.

The .local, .hidden, .internal, and .protected are not legal for all supported
file formats (in particular, they're invalid for MachO). Move the parsing for
them into the ELF assembly parser since that's the format they're for.
Similarly, .weak is used by COFF and ELF, but not MachO, so move the parsing
to the COFF and ELF asm parsers. Previously, using any of these directives
on Darwin would result in an assertion failure in the parser; now we get
a diagnostic as we should.

rdar://9827089

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

12 years agoBuilds llvmc and its examples with CMake.
Oscar Fuentes [Mon, 25 Jul 2011 17:25:10 +0000 (17:25 +0000)]
Builds llvmc and its examples with CMake.

Patch by arrowdodger!

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

12 years agoFixes VS support for llvmc mcc16 llvmc example.
Oscar Fuentes [Mon, 25 Jul 2011 17:24:54 +0000 (17:24 +0000)]
Fixes VS support for llvmc mcc16 llvmc example.

Patch by arrowdodger!

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

12 years agoTidy up. 80 columns.
Jim Grosbach [Mon, 25 Jul 2011 17:11:29 +0000 (17:11 +0000)]
Tidy up. 80 columns.

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

12 years agoAdd uwtable to the langref.
Rafael Espindola [Mon, 25 Jul 2011 15:27:59 +0000 (15:27 +0000)]
Add uwtable to the langref.

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

12 years agoAdd an RS_Split2 stage used for loop prevention.
Jakob Stoklund Olesen [Mon, 25 Jul 2011 15:25:43 +0000 (15:25 +0000)]
Add an RS_Split2 stage used for loop prevention.

This mechanism already exists, but the RS_Split2 stage makes it clearer.

When live range splitting creates ranges that may not be making
progress, they are marked RS_Split2 instead of RS_New. These ranges may
be split again, but only in a way that can be proven to make progress.

For local ranges, that means they must be split into ranges used by
strictly fewer instructions.

For global ranges, region splitting is bypassed and the RS_Split2
ranges go straight to per-block splitting.

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

12 years agoRename live range stages to better reflect how they are used.
Jakob Stoklund Olesen [Mon, 25 Jul 2011 15:25:41 +0000 (15:25 +0000)]
Rename live range stages to better reflect how they are used.

The stage is used to control where a live range is going, not where it
is coming from. Live ranges created by splitting will usually be marked
RS_New, but some are marked RS_Spill to avoid wasting time trying to
split them again.

The old RS_Global and RS_Local stages are merged - they are really the
same thing for local and global live ranges.

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

12 years agoShorten some expressions by using ArrayRef::slice().
Frits van Bommel [Mon, 25 Jul 2011 15:13:01 +0000 (15:13 +0000)]
Shorten some expressions by using ArrayRef::slice().

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

12 years agoCMake: generalize the system that creates custom targets for
Oscar Fuentes [Mon, 25 Jul 2011 14:11:55 +0000 (14:11 +0000)]
CMake: generalize the system that creates custom targets for
tablegenning to all libraries and executables.

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

12 years agoRemove uses of std::vector from TypeBuilder.
Jay Foad [Mon, 25 Jul 2011 10:32:27 +0000 (10:32 +0000)]
Remove uses of std::vector from TypeBuilder.

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

12 years agoUse ArrayRef in the (protected) constructors of ConstantArray, ConstantStruct and...
Jay Foad [Mon, 25 Jul 2011 10:14:44 +0000 (10:14 +0000)]
Use ArrayRef in the (protected) constructors of ConstantArray, ConstantStruct and ConstantVector.

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

12 years agoConvert GetElementPtrInst to use ArrayRef.
Jay Foad [Mon, 25 Jul 2011 09:48:08 +0000 (09:48 +0000)]
Convert GetElementPtrInst to use ArrayRef.

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

12 years agoswitch Triple to take twines instead of stringrefs.
Chris Lattner [Sun, 24 Jul 2011 20:45:08 +0000 (20:45 +0000)]
switch Triple to take twines instead of stringrefs.

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

12 years agoAdd Twine support for characters, and switch twine to use a union internally
Chris Lattner [Sun, 24 Jul 2011 20:44:30 +0000 (20:44 +0000)]
Add Twine support for characters, and switch twine to use a union internally
to eliminate some casting.

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

12 years agoNever extend live ranges for <undef> uses.
Jakob Stoklund Olesen [Sun, 24 Jul 2011 20:33:23 +0000 (20:33 +0000)]
Never extend live ranges for <undef> uses.

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

12 years agoCorrectly handle <undef> tied uses when rewriting after a split.
Jakob Stoklund Olesen [Sun, 24 Jul 2011 20:23:50 +0000 (20:23 +0000)]
Correctly handle <undef> tied uses when rewriting after a split.

This fixes PR10463. A two-address instruction with an <undef> use
operand was incorrectly rewritten so the def and use no longer used the
same register, violating the tie constraint.

Fix this by always rewriting <undef> operands with the register a def
operand would use.

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

12 years agoOmit explicit length here, now that I've had a chance to test this with gcc.
Frits van Bommel [Sun, 24 Jul 2011 09:53:46 +0000 (09:53 +0000)]
Omit explicit length here, now that I've had a chance to test this with gcc.

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

12 years agoSet PPCII::MO_DARWIN_STUB only on MacOSX < 10.5.
Roman Divacky [Sun, 24 Jul 2011 08:22:56 +0000 (08:22 +0000)]
Set PPCII::MO_DARWIN_STUB only on MacOSX < 10.5.

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

12 years agoclarify that opaque is actually a struct type, PR10430
Chris Lattner [Sat, 23 Jul 2011 19:59:08 +0000 (19:59 +0000)]
clarify that opaque is actually a struct type, PR10430

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

12 years agohow about that, StringRef doesn't allow any mutation, thanks to
Chris Lattner [Sat, 23 Jul 2011 17:18:57 +0000 (17:18 +0000)]
how about that, StringRef doesn't allow any mutation, thanks to
Frits for straightening me out.

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

12 years agoAdd RAGreedy::calcCompactRegion.
Jakob Stoklund Olesen [Sat, 23 Jul 2011 03:41:57 +0000 (03:41 +0000)]
Add RAGreedy::calcCompactRegion.

This method computes the edge bundles that should be live when splitting
around a compact region. This is independent of interference.

The function returns false if the live range was already a compact
region, or the compact region doesn't have any live bundles - it would
be the same as splitting around basic blocks.

Compact regions are computed using the normal spill placement code. We
pretend there is interference in all live-through blocks that don't use
the live range. This removes all edges from the Hopfield network used
for spill placement, so it converges instantly.

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

12 years agoFix bug in SplitEditor::splitLiveThroughBlock when switching registers.
Jakob Stoklund Olesen [Sat, 23 Jul 2011 03:32:26 +0000 (03:32 +0000)]
Fix bug in SplitEditor::splitLiveThroughBlock when switching registers.

If there is no interference and no last split point, we cannot
enterIntvBefore(Stop) - that function needs a real instruction.

Use enterIntvAtEnd instead for that very easy case.

This code doesn't currently run, it is needed by multi-way splitting.

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

12 years agoPrepare RAGreedy::growRegion for compact regions.
Jakob Stoklund Olesen [Sat, 23 Jul 2011 03:22:33 +0000 (03:22 +0000)]
Prepare RAGreedy::growRegion for compact regions.

A split candidate can have a null PhysReg which means that it doesn't
map to a real interference pattern. Instead, pretend that all through
blocks have interference.

This makes it possible to generate compact regions where the live range
doesn't go through blocks that don't use it. The live range will still
be live between directly connected blocks with uses.

Splitting around a compact region tends to produce a live range with a
high spill weight, so it may evict a less dense live range.

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

12 years agoAdd a simple method for marking blocks with interference in and out.
Jakob Stoklund Olesen [Sat, 23 Jul 2011 03:10:19 +0000 (03:10 +0000)]
Add a simple method for marking blocks with interference in and out.

This method matches addLinks - All the listed blocks are considered to
have interference, so they add a negative bias to their bundles.

This could also be done by addConstraints, but that requires building a
separate BlockConstraint array.

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

12 years agoAllow null interference cursors to be queried.
Jakob Stoklund Olesen [Sat, 23 Jul 2011 03:10:17 +0000 (03:10 +0000)]
Allow null interference cursors to be queried.

They always report 'no interference'.

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

12 years agoFix a silly off by one.
Benjamin Kramer [Sat, 23 Jul 2011 03:04:46 +0000 (03:04 +0000)]
Fix a silly off by one.

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

12 years agoWe always bounds check the bit set, there is no need to emit zero bytes at the end.
Benjamin Kramer [Sat, 23 Jul 2011 02:49:37 +0000 (02:49 +0000)]
We always bounds check the bit set, there is no need to emit zero bytes at the end.

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

12 years agoAdd more constness.
Benjamin Kramer [Sat, 23 Jul 2011 01:40:15 +0000 (01:40 +0000)]
Add more constness.

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

12 years agoARMMCTargetDesc.h: Fixup to add DataTypes.h, or uint32_t would be unavailable.
NAKAMURA Takumi [Sat, 23 Jul 2011 01:16:22 +0000 (01:16 +0000)]
ARMMCTargetDesc.h: Fixup to add DataTypes.h, or uint32_t would be unavailable.

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

12 years agoTurn the DenseSet in MCRegisterClass into a tblgenerated bit field. This should be...
Benjamin Kramer [Sat, 23 Jul 2011 00:47:49 +0000 (00:47 +0000)]
Turn the DenseSet in MCRegisterClass into a tblgenerated bit field. This should be faster and smaller.

Goodbye static ctors and dtors!

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

12 years agoGive TargetRegisterClass a pointer to the MCRegisterClass and use it to access its...
Benjamin Kramer [Sat, 23 Jul 2011 00:47:46 +0000 (00:47 +0000)]
Give TargetRegisterClass a pointer to the MCRegisterClass and use it to access its data.

This makes TargetRegisterClass slightly slower. Next step will be making contains faster.
Eventually TargetRegisterClass will be killed entirely.

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

12 years agoMove TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where they belong.
Evan Cheng [Sat, 23 Jul 2011 00:45:41 +0000 (00:45 +0000)]
Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where they belong.

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

12 years agoCMake: Fix LLVM_NATIVE_TARGETMC in config.h.cmake.
NAKAMURA Takumi [Sat, 23 Jul 2011 00:45:23 +0000 (00:45 +0000)]
CMake: Fix LLVM_NATIVE_TARGETMC in config.h.cmake.

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

12 years agoconfig.h.cmake: Reorder along config.h.in.
NAKAMURA Takumi [Sat, 23 Jul 2011 00:45:16 +0000 (00:45 +0000)]
config.h.cmake: Reorder along config.h.in.

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

12 years agoMove trip count discovery outside of the generic LoopUnroll helper. This
Andrew Trick [Sat, 23 Jul 2011 00:33:05 +0000 (00:33 +0000)]
Move trip count discovery outside of the generic LoopUnroll helper. This
removes its dependence on canonical induction variables.

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

12 years agowhitespace
Andrew Trick [Sat, 23 Jul 2011 00:29:16 +0000 (00:29 +0000)]
whitespace

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

12 years agocreateXXXMCCodeGenInfo should be static.
Evan Cheng [Sat, 23 Jul 2011 00:01:04 +0000 (00:01 +0000)]
createXXXMCCodeGenInfo should be static.

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

12 years agoSink ARM mc routines into MCTargetDesc.
Evan Cheng [Sat, 23 Jul 2011 00:00:19 +0000 (00:00 +0000)]
Sink ARM mc routines into MCTargetDesc.

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