LLVM backend for 6502
Go to file
Sanjiv Gupta 059aa8c604 >> What if my global variable was into a different address space than stack?
>>     
>
> It doesn't matter in terms of semantics: because AnalyzeGlobal
> returned false, we're guaranteed the address of the global is never
> taken.  I wouldn't be surprised if we end up generating invalid IR in
> some cases, though, because of the semantics of replaceAllUsesWith.
> Do you have a testcase that breaks?
>
>   
The problem is replaceAllUsesWith asserts for type mismatch here. Try attached .bc with llvm-ld.

assert(New->getType() == getType() &&
        "replaceAllUses of value with new value of different type!");

Since stack is always on address space zero, I don't think that type of GV in a different address space is ever going to match.
The other way is to allow replaceAllUsesWith to ignore address spaces while comparing types. (do we have  a way to do that ?).
But then such an optimization may fail the entire idea of user wanting to place a variable into different memory space. The original idea of user might be to save on the stack space (data memory) and hence he asked the variable to be placed into different memory space (program memory). So the best bet here is to deny this optimization by checking

GV->getType()->getAddressSpace() == 0. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73605 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17 06:47:15 +00:00
autoconf Define LLVM_NATIVE_ARCH in llvm/Config/config.h to be the LLVM back end that corresponds to the native executable, but only when that LLVM back end is being built 2009-06-17 00:42:33 +00:00
bindings Give embedded metadata its own type instead of relying on EmptyStructTy. 2009-05-30 05:06:04 +00:00
cmake CMake: New variable LLVM_LIBDIR_SUFFIX. 2009-06-12 02:49:53 +00:00
docs Formatting fix. 2009-06-17 03:09:39 +00:00
examples silence a warning. 2009-04-15 00:16:05 +00:00
include make CreateFMul forward to CreateFMul, not CreateMul. 2009-06-17 06:31:02 +00:00
lib >> What if my global variable was into a different address space than stack? 2009-06-17 06:47:15 +00:00
projects Revert r67655 and r67656, as they are breaking the build. I'm 2009-03-25 00:52:11 +00:00
runtime Drop toy GC runtime. 2009-03-02 03:46:48 +00:00
test Correct an accidental duplication of the test (patch doesn't handle 2009-06-17 03:05:00 +00:00
tools Another small documentation update. 2009-06-17 02:56:08 +00:00
unittests Reversed order of args in EXPECT_EQ() macros to be in the correct order: 2009-06-09 21:48:57 +00:00
utils Fix grammaro, and bad indentation. 2009-06-17 04:23:52 +00:00
website Prepare for "core" website. 2007-08-03 05:43:35 +00:00
win32 Add a new codegen pass that normalizes dwarf exception handling 2009-05-22 20:36:31 +00:00
Xcode Remove Stacker.html from Xcode project. 2008-10-14 23:23:59 +00:00
build-for-llvm-top.sh Patch to build llvm with srcdir != objdir from 2009-01-23 08:42:38 +00:00
CMakeLists.txt CMake: Only include LLVM example executables in the build if requested by the user 2009-06-16 22:25:45 +00:00
configure Update auto-generated configuration files 2009-06-17 00:43:20 +00:00
CREDITS.TXT Add myself, test commit 2009-06-14 02:03:17 +00:00
LICENSE.TXT Now that we have atomics support properly detected by configure, 2009-05-19 00:08:29 +00:00
llvm.spec.in * llvm.spec.in: update blurb 2007-07-13 09:48:29 +00:00
Makefile Introduce new headers whose inclusion forces linking and 2009-06-16 20:12:29 +00:00
Makefile.common Removed trailing whitespace from Makefiles. 2009-01-09 16:44:42 +00:00
Makefile.config.in Add a --enable-profiling option to configure to build Debug+Profile and 2009-04-17 14:49:22 +00:00
Makefile.rules Remove support for building LLVM libraries into "relinked" 2009-06-16 23:00:42 +00:00
ModuleInfo.txt Patch to build llvm with srcdir != objdir from 2009-01-23 08:42:38 +00:00
README.txt README.txt: test commit w/blank line appended 2009-03-23 21:00:45 +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 HTML documentation provided in docs/index.html for further
assistance with LLVM.