On Wed, 21 Jul 2004, Chris Lattner wrote:>
> Yes, this makes a tremendous amount of sense. Do you think you could
> prepare some patches to make this happen? If you have any questions, feel
> free to ask :)
Ok, a patch[1] is attached. I didn't care to coerce the offset, since I
assume that it is an uint, but maybe I should? Hopefully I've understood
the llvm source correctly.
, Tobias
[1] I'm kind of newbie of cvs, but I did:
"cvs -z3 -d :pserver:anon at llvm-cvs.cs.uiuc.edu:/var/cvs/llvm diff llvm
> gcpatch"
-------------- next part --------------
? llvm/l
? llvm/lib/BytecodeLibs
? llvm/lib/Debug
? llvm/lib/Analysis/Debug
? llvm/lib/Analysis/Depend
? llvm/lib/Analysis/DataStructure/Debug
? llvm/lib/Analysis/DataStructure/Depend
? llvm/lib/Analysis/IPA/Debug
? llvm/lib/Analysis/IPA/Depend
? llvm/lib/AsmParser/Debug
? llvm/lib/AsmParser/Depend
? llvm/lib/Bytecode/Reader/Debug
? llvm/lib/Bytecode/Reader/Depend
? llvm/lib/Bytecode/Writer/Debug
? llvm/lib/Bytecode/Writer/Depend
? llvm/lib/CodeGen/Debug
? llvm/lib/CodeGen/Depend
? llvm/lib/CodeGen/InstrSched/Debug
? llvm/lib/CodeGen/InstrSched/Depend
? llvm/lib/CodeGen/SelectionDAG/Debug
? llvm/lib/CodeGen/SelectionDAG/Depend
? llvm/lib/Debugger/Debug
? llvm/lib/Debugger/Depend
? llvm/lib/ExecutionEngine/Debug
? llvm/lib/ExecutionEngine/Depend
? llvm/lib/ExecutionEngine/Interpreter/Debug
? llvm/lib/ExecutionEngine/Interpreter/Depend
? llvm/lib/ExecutionEngine/JIT/Debug
? llvm/lib/ExecutionEngine/JIT/Depend
? llvm/lib/Support/Debug
? llvm/lib/Support/Depend
? llvm/lib/Target/Debug
? llvm/lib/Target/Depend
? llvm/lib/Target/CBackend/Debug
? llvm/lib/Target/CBackend/Depend
? llvm/lib/Target/Skeleton/Debug
? llvm/lib/Target/Skeleton/Depend
? llvm/lib/Target/Skeleton/SkeletonGenInstrInfo.inc
? llvm/lib/Target/Skeleton/SkeletonGenInstrNames.inc
? llvm/lib/Target/Skeleton/SkeletonGenRegisterInfo.h.inc
? llvm/lib/Target/Skeleton/SkeletonGenRegisterInfo.inc
? llvm/lib/Target/Skeleton/SkeletonGenRegisterNames.inc
? llvm/lib/Target/SparcV9/Debug
? llvm/lib/Target/SparcV9/Depend
? llvm/lib/Target/SparcV9/SparcV9.burg.in1
? llvm/lib/Target/SparcV9/SparcV9.burm
? llvm/lib/Target/SparcV9/SparcV9.burm.cpp
? llvm/lib/Target/SparcV9/InstrSelection/Debug
? llvm/lib/Target/SparcV9/InstrSelection/Depend
? llvm/lib/Target/SparcV9/LiveVar/Debug
? llvm/lib/Target/SparcV9/LiveVar/Depend
? llvm/lib/Target/SparcV9/RegAlloc/Debug
? llvm/lib/Target/SparcV9/RegAlloc/Depend
? llvm/lib/Target/X86/Debug
? llvm/lib/Target/X86/Depend
? llvm/lib/Transforms/Debug
? llvm/lib/Transforms/Depend
? llvm/lib/Transforms/IPO/Debug
? llvm/lib/Transforms/IPO/Depend
? llvm/lib/Transforms/Instrumentation/Debug
? llvm/lib/Transforms/Instrumentation/Depend
? llvm/lib/Transforms/Instrumentation/ProfilePaths/Debug
? llvm/lib/Transforms/Instrumentation/ProfilePaths/Depend
? llvm/lib/Transforms/Scalar/Debug
? llvm/lib/Transforms/Scalar/Depend
? llvm/lib/Transforms/Utils/Debug
? llvm/lib/Transforms/Utils/Depend
? llvm/lib/VMCore/Debug
? llvm/lib/VMCore/Depend
? llvm/projects/ModuleMaker/Makefile.common
? llvm/projects/ModuleMaker/config.log
? llvm/projects/ModuleMaker/config.status
? llvm/projects/ModuleMaker/tools/Debug
? llvm/projects/ModuleMaker/tools/ModuleMaker/Debug
? llvm/projects/ModuleMaker/tools/ModuleMaker/Depend
? llvm/projects/Stacker/lib/compiler/Debug
? llvm/projects/Stacker/lib/compiler/Depend
? llvm/projects/Stacker/lib/compiler/Lexer.cpp
? llvm/projects/Stacker/lib/compiler/StackerParser.cpp
? llvm/projects/Stacker/lib/compiler/StackerParser.h
? llvm/projects/Stacker/lib/compiler/StackerParser.output
? llvm/projects/Stacker/lib/runtime/Debug
? llvm/projects/Stacker/lib/runtime/Depend
? llvm/projects/Stacker/tools/stkrc/Debug
? llvm/projects/Stacker/tools/stkrc/Depend
? llvm/projects/sample/Makefile.common
? llvm/projects/sample/config.log
? llvm/projects/sample/config.status
? llvm/projects/sample/lib/Debug
? llvm/projects/sample/lib/sample/Debug
? llvm/projects/sample/lib/sample/Depend
? llvm/projects/sample/tools/Debug
? llvm/projects/sample/tools/sample/Debug
? llvm/projects/sample/tools/sample/Depend
? llvm/runtime/GC/SemiSpace/BytecodeObj
? llvm/runtime/GC/SemiSpace/Debug
? llvm/runtime/GC/SemiSpace/Depend
? llvm/runtime/GCCLibraries/crtend/BytecodeObj
? llvm/runtime/GCCLibraries/crtend/Depend
? llvm/runtime/GCCLibraries/libc/BytecodeObj
? llvm/runtime/GCCLibraries/libc/Depend
? llvm/runtime/GCCLibraries/libcurses/BytecodeObj
? llvm/runtime/GCCLibraries/libcurses/Depend
? llvm/runtime/GCCLibraries/libg/BytecodeObj
? llvm/runtime/GCCLibraries/libg/Depend
? llvm/runtime/GCCLibraries/libgcc/BytecodeObj
? llvm/runtime/GCCLibraries/libgcc/Depend
? llvm/runtime/GCCLibraries/libgdbm/BytecodeObj
? llvm/runtime/GCCLibraries/libgdbm/Depend
? llvm/runtime/GCCLibraries/libm/BytecodeObj
? llvm/runtime/GCCLibraries/libm/Depend
? llvm/runtime/GCCLibraries/libmalloc/BytecodeObj
? llvm/runtime/GCCLibraries/libmalloc/Depend
? llvm/runtime/GCCLibraries/libtermcap/BytecodeObj
? llvm/runtime/GCCLibraries/libtermcap/Depend
? llvm/runtime/GCCLibraries/libucb/BytecodeObj
? llvm/runtime/GCCLibraries/libucb/Depend
? llvm/runtime/GCCLibraries/libutempter/BytecodeObj
? llvm/runtime/GCCLibraries/libutempter/Depend
? llvm/runtime/GCCLibraries/libutil/BytecodeObj
? llvm/runtime/GCCLibraries/libutil/Depend
? llvm/runtime/libdummy/BytecodeObj
? llvm/runtime/libdummy/Depend
? llvm/runtime/libprofile/BytecodeObj
? llvm/runtime/libprofile/Debug
? llvm/runtime/libprofile/Depend
? llvm/runtime/libtrace/BytecodeObj
? llvm/runtime/libtrace/Debug
? llvm/runtime/libtrace/Depend
? llvm/tools/Debug
? llvm/tools/analyze/Debug
? llvm/tools/analyze/Depend
? llvm/tools/bugpoint/Debug
? llvm/tools/bugpoint/Depend
? llvm/tools/extract/Debug
? llvm/tools/extract/Depend
? llvm/tools/gccas/Debug
? llvm/tools/gccas/Depend
? llvm/tools/gccld/Debug
? llvm/tools/gccld/Depend
? llvm/tools/llc/Debug
? llvm/tools/llc/Depend
? llvm/tools/lli/Debug
? llvm/tools/lli/Depend
? llvm/tools/llvm-ar/Debug
? llvm/tools/llvm-ar/Depend
? llvm/tools/llvm-as/Debug
? llvm/tools/llvm-as/Depend
? llvm/tools/llvm-bcanalyzer/Debug
? llvm/tools/llvm-bcanalyzer/Depend
? llvm/tools/llvm-db/Debug
? llvm/tools/llvm-db/Depend
? llvm/tools/llvm-dis/Debug
? llvm/tools/llvm-dis/Depend
? llvm/tools/llvm-link/Debug
? llvm/tools/llvm-link/Depend
? llvm/tools/llvm-nm/Debug
? llvm/tools/llvm-nm/Depend
? llvm/tools/llvm-prof/Debug
? llvm/tools/llvm-prof/Depend
? llvm/tools/llvm-stub/Debug
? llvm/tools/llvm-stub/Depend
? llvm/tools/opt/Debug
? llvm/tools/opt/Depend
? llvm/utils/Burg/Debug
? llvm/utils/Burg/Depend
? llvm/utils/Burg/gram.tab.c
? llvm/utils/Burg/gram.tab.h
? llvm/utils/TableGen/Debug
? llvm/utils/TableGen/Depend
? llvm/utils/TableGen/FileLexer.cpp
? llvm/utils/TableGen/FileParser.cpp
? llvm/utils/TableGen/FileParser.h
? llvm/utils/TableGen/FileParser.output
? llvm/utils/fpcmp/Debug
? llvm/utils/fpcmp/Depend
Index: llvm/lib/Transforms/Scalar/LowerGC.cpp
==================================================================RCS file:
/var/cvs/llvm/llvm/lib/Transforms/Scalar/LowerGC.cpp,v
retrieving revision 1.4
diff -r1.4 LowerGC.cpp
112c112
< GCRead = M.getOrInsertFunction("llvm_gc_read", VoidPtr,
VoidPtrPtr, 0);
---> GCRead = M.getOrInsertFunction("llvm_gc_read", VoidPtr,
VoidPtrPtr, Type::UIntTy, 0);
115c115
< VoidPtr, VoidPtrPtr, 0);
---> VoidPtr, VoidPtrPtr, Type::UIntTy, 0);
192c192
< CallInst *NC = new CallInst(GCRead, CI->getOperand(1),
---> CallInst *NC = new CallInst(GCRead, CI->getOperand(1),
CI->getOperand(2),
Index: llvm/lib/VMCore/Verifier.cpp
==================================================================RCS file:
/var/cvs/llvm/llvm/lib/VMCore/Verifier.cpp,v
retrieving revision 1.115
diff -r1.115 Verifier.cpp
714,715c714,715
< case Intrinsic::gcread: NumArgs = 1; break;
< case Intrinsic::gcwrite: NumArgs = 2; break;
---> case Intrinsic::gcread: NumArgs = 2; break;
> case Intrinsic::gcwrite: NumArgs = 3; break;
Index: llvm/runtime/GC/GCInterface.h
==================================================================RCS file:
/var/cvs/llvm/llvm/runtime/GC/GCInterface.h,v
retrieving revision 1.2
diff -r1.2 GCInterface.h
41c41
< void *llvm_gc_read(void **P);
---> void *llvm_gc_read(void **P, unsigned Offset);
46c46
< void llvm_gc_write(void *V, void **P);
---> void llvm_gc_write(void *V, void **P, unsigned Offset);
Index: llvm/runtime/GC/SemiSpace/semispace.c
==================================================================RCS file:
/var/cvs/llvm/llvm/runtime/GC/SemiSpace/semispace.c,v
retrieving revision 1.4
diff -r1.4 semispace.c
92,93c92,93
< void *llvm_gc_read(void **P) { return *P; }
< void llvm_gc_write(void *V, void **P) { *P = V; }
---> void *llvm_gc_read(void **P, unsigned Offset) { return P[Offset]; }
> void llvm_gc_write(void *V, void **P, unsigned Offset) { P[Offset] = V; }
Index: llvm/test/Regression/CodeGen/Generic/GC/alloc_loop.ll
==================================================================RCS file:
/var/cvs/llvm/llvm/test/Regression/CodeGen/Generic/GC/alloc_loop.ll,v
retrieving revision 1.2
diff -r1.2 alloc_loop.ll
7c7
< declare void %llvm.gcwrite(sbyte*, sbyte**)
---> declare void %llvm.gcwrite(sbyte*, sbyte**, uint)
35c35
< call void %llvm.gcwrite(sbyte* %A.1, sbyte** %B.1)
---> call void %llvm.gcwrite(sbyte* %A.1, sbyte** %B.1, uint 0)