LLVM backend for 6502
Go to file
Ulrich Weigand 58ebc04078 Remove an invalid and unnecessary Pat pattern from the X86 backend:
def : Pat<(load (i64 (X86Wrapper tglobaltlsaddr :$dst))),
            (MOV64rm tglobaltlsaddr :$dst)>;

This pattern is invalid because the MOV64rm instruction expects a
source operand of type "i64mem", which is a subclass of X86MemOperand
and thus actually consists of five MI operands, but the Pat provides
only a single MI operand ("tglobaltlsaddr" matches an SDnode of
type ISD::TargetGlobalTLSAddress and provides a single output).

Thus, if the pattern were ever matched, subsequent uses of the MOV64rm
instruction pattern would access uninitialized memory.  In addition,
with the TableGen patch I'm about to check in, this would actually be
reported as a build-time error.

Fortunately, the pattern does in fact never match, for at least two
independent reasons.

First, the code generator actually never generates a pattern of the
form (load (X86Wrapper (tglobaltlsaddr))).  For most combinations of
TLS and code models, (tglobaltlsaddr) represents just an offset that
needs to be added to some base register, so it is never directly
dereferenced.  The only exception is the initial-exec model, where
(tglobaltlsaddr) refers to the (pc-relative) address of a GOT slot,
which *is* in fact directly dereferenced: but in that case, the
X86WrapperRIP node is used, not X86Wrapper, so the Pat doesn't match.

Second, even if some patterns along those lines *were* ever generated,
we should not need an extra Pat pattern to match it.  Instead, the
original MOV64rm instruction pattern ought to match directly, since
it uses an "addr" operand, which is implemented via the SelectAddr
C++ routine; this routine is supposed to accept the full range of
input DAGs that may be implemented by a single mov instruction,
including those cases involving ISD::TargetGlobalTLSAddress (and
actually does so e.g. in the initial-exec case as above).

To avoid build breaks (due to the above-mentioned error) after the
TableGen patch is checked in, I'm removing this Pat here.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177426 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 19:49:52 +00:00
autoconf Turn anonymous type in anonymous union warning back on after cleaning up 2013-03-15 00:43:00 +00:00
bindings
cmake Enable -Wnon-virtual-dtor build warning 2013-03-19 10:10:03 +00:00
docs Update documentation of llvm-link to reflect recent cleanups. 2013-03-19 16:04:19 +00:00
examples
include [ms-inline asm] Move the size directive asm rewrite into the target specific 2013-03-19 17:32:17 +00:00
lib Remove an invalid and unnecessary Pat pattern from the X86 backend: 2013-03-19 19:49:52 +00:00
projects
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 Prepare to make r0 an allocatable register on PPC 2013-03-19 18:51:05 +00:00
tools Remove stale comment 2013-03-19 16:04:02 +00:00
unittests Test case for graceful handling of long file names on Windows. Patch thanks to Paul Robinson! 2013-03-16 15:00:51 +00:00
utils TableGen fix for the new machine model. 2013-03-18 20:42:25 +00:00
.arcconfig
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT Update 2013-03-18 17:47:33 +00:00
configure Turn anonymous type in anonymous union warning back on after cleaning up 2013-03-15 00:43:00 +00:00
CREDITS.TXT Update 2013-03-18 17:47:33 +00:00
LICENSE.TXT
llvm.spec.in
LLVMBuild.txt
Makefile
Makefile.common
Makefile.config.in Turn anonymous type in anonymous union warning back on after cleaning up 2013-03-15 00:43:00 +00:00
Makefile.rules Turn anonymous type in anonymous union warning back on after cleaning up 2013-03-15 00:43:00 +00:00
README.txt

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.