llvm-6502/lib
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
..
Analysis Check whether a pointer is non-null (isKnownNonNull) in isKnownNonZero. 2013-03-18 21:23:25 +00:00
Archive Fix auto_ptr is deprecated warnings 2013-02-26 21:20:35 +00:00
AsmParser Unify clang/llvm attributes for asan/tsan/msan (LLVM part) 2013-02-26 06:58:09 +00:00
Bitcode Simplify code. No functionality change. 2013-02-19 09:48:30 +00:00
CodeGen Move #include of BitVector from .h to .cpp file. 2013-03-18 23:45:45 +00:00
DebugInfo Code cleanup: pass Offset by pointer to parseInstruction to more explicitly 2013-02-22 00:50:48 +00:00
ExecutionEngine Formatting, grammar 2013-02-20 18:24:34 +00:00
IR The testing to ensure a vector of zeros of type floating point isn't misclassified as negative zero can be simplified, as pointed out by Duncan Sands. 2013-03-19 10:16:40 +00:00
Linker The Linker interface has some dead code after the cleanup in r172749 2013-03-19 15:26:24 +00:00
MC [ms-inline asm] Move the size directive asm rewrite into the target specific 2013-03-19 17:32:17 +00:00
Object Move an assert earlier in a file and check that the result of 2013-02-28 20:26:17 +00:00
Option Resort the #include lines in include/... and lib/... with the 2013-01-02 10:22:59 +00:00
Support [Support][Path][Windows] Fix dangling else. Don't call CloseHandle when CloseFD is false. 2013-03-15 19:25:47 +00:00
TableGen [TableGen] Fix ICE on MSVC 2012 Release builds. 2013-02-26 21:29:47 +00:00
Target Remove an invalid and unnecessary Pat pattern from the X86 backend: 2013-03-19 19:49:52 +00:00
Transforms Revert "Cleanup some SCEV logic a bit." 2013-03-19 05:10:27 +00:00
CMakeLists.txt Rename VMCore directory to IR. 2013-01-02 09:10:48 +00:00
LLVMBuild.txt Rename VMCore directory to IR. 2013-01-02 09:10:48 +00:00
Makefile Rename VMCore directory to IR. 2013-01-02 09:10:48 +00:00