LLVM backend for 6502
Go to file
Ulrich Weigand d999062f31 Handle tied sub-operands in AsmMatcherEmitter
The problem this patch addresses is the handling of register tie
constraints in AsmMatcherEmitter, where one operand is tied to a
sub-operand of another operand.  The typical scenario for this to
happen is the tie between the "write-back" register of a pre-inc
instruction, and the base register sub-operand of the memory address
operand of that instruction.

The current AsmMatcherEmitter code attempts to handle tied
operands by emitting the operand as usual first, and emitting
a CVT_Tied node when handling the second (tied) operand.  However,
this really only works correctly if the tied operand does not
have sub-operands (and isn't a sub-operand itself).  Under those
circumstances, a wrong MC operand list is generated.

In discussions with Jim Grosbach, it turned out that the MC operand
list really ought not to contain tied operands in the first place;
instead, it ought to consist of exactly those operands that are
named in the AsmString.  However, getting there requires significant
rework of (some) targets.

This patch fixes the immediate problem, and at the same time makes
one (small) step in the direction of the long-term solution, by
implementing two changes:

1. Restricts the AsmMatcherEmitter handling of tied operands to
   apply solely to simple operands (not complex operands or
   sub-operand of such).

This means that at least we don't get silently corrupt MC operand
lists as output.  However, if we do have tied sub-operands, they
would now no longer be handled at all, except for:

2. If we have an operand that does not occur in the AsmString,
   and also isn't handled as tied operand, simply emit a dummy
   MC operand (constant 0).

This works as long as target code never attempts to access
MC operands that do no not occur in the AsmString (and are
not tied simple operands), which happens to be the case for
all targets where this situation can occur (ARM and PowerPC).

[ Note that this change means that many of the ARM custom
  converters are now superfluous, since the implement the
  same "hack" now performed already by common code. ]

Longer term, we ought to fix targets to never access *any*
MC operand that does not occur in the AsmString (including
tied simple operands), and then finally completely remove
all such operands from the MC operand list.

Patch approved by Jim Grosbach.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180677 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27 18:48:23 +00:00
autoconf Add basic zlib support to LLVM. This would allow to use compression/uncompression in selected LLVM tools. 2013-04-23 08:28:39 +00:00
bindings Fixing OCAML bindings for MCJIT 2013-04-25 00:03:58 +00:00
cmake Use zlib to uncompress debug sections in DWARF parser. 2013-04-23 10:17:34 +00:00
docs Documentation: end option description with a period 2013-04-27 16:34:24 +00:00
examples The exception demo needs its symbols exported. 2013-04-26 19:07:40 +00:00
include Generalize the MachineTraceMetrics public API. 2013-04-27 03:54:20 +00:00
lib Fix a XOR reassociation bug. 2013-04-27 18:02:12 +00:00
projects remove cbe backend from sample configure 2013-04-24 02:17:19 +00:00
runtime Remove GCDAProfiling.c. This copy is old, the copy in compiler-rt is newer and 2013-03-07 02:03:08 +00:00
test Fix a XOR reassociation bug. 2013-04-27 18:02:12 +00:00
tools Use llvm/Object/MachO.h in macho-dumper. Drop the old macho parser. 2013-04-26 20:07:33 +00:00
unittests Re-enabling MCJIT object caching with memory leak fixed 2013-04-25 21:02:36 +00:00
utils Handle tied sub-operands in AsmMatcherEmitter 2013-04-27 18:48:23 +00:00
.arcconfig Add .arcconfig to the repository. Useful if someone wants to use phabricator's command line tool. 2012-12-01 12:07:58 +00:00
.gitignore Add extra vim swap file pattern 2012-10-09 23:48:34 +00:00
CMakeLists.txt Add basic zlib support to LLVM. This would allow to use compression/uncompression in selected LLVM tools. 2013-04-23 08:28:39 +00:00
CODE_OWNERS.TXT Fix random typo. 2013-04-17 03:18:49 +00:00
configure Add basic zlib support to LLVM. This would allow to use compression/uncompression in selected LLVM tools. 2013-04-23 08:28:39 +00:00
CREDITS.TXT Add myself in the CREDITS.TXT 2013-04-11 13:15:39 +00:00
LICENSE.TXT Add LICENSE.TXT covering contributions made by ARM. 2013-01-07 10:04:49 +00:00
llvm.spec.in Tidy up. s/Low Level Virtual Machine/LLVM/. 2012-01-25 22:00:23 +00:00
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile Improved svn repo searching for 'make update' 2013-01-28 03:19:57 +00:00
Makefile.common Makefile.common: Update a description, s/Source/SOURCES/ , according to MakefileGuide.html#control-variables . 2012-12-07 01:43:23 +00:00
Makefile.config.in Add basic zlib support to LLVM. This would allow to use compression/uncompression in selected LLVM tools. 2013-04-23 08:28:39 +00:00
Makefile.rules Allow users to choose identity used to sign tools. 2013-04-25 01:17:54 +00:00
README.txt test 2013-04-17 05:34:03 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you're writing a package for LLVM, see docs/Packaging.rst for our
suggestions.