Here's the implementation of ConstantUnion::replaceUsesOfWithOnConstant(). No tests yet :( Two questions: -- Any suggestions as to an existing test I could use as a model for testing this? -- I could also use some advice on what part of the code to work on next (in terms of finishing up union support). -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100216/1e90e74c/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: replunion.patch Type: application/octet-stream Size: 2139 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100216/1e90e74c/attachment.obj>
Chris Lattner
2010-Feb-17 20:05 UTC
[LLVMdev] [PATCH] - Union types, replaceUsesOfWithOnConstant
On Feb 16, 2010, at 12:38 PM, Talin wrote:> Here's the implementation of ConstantUnion::replaceUsesOfWithOnConstant(). No tests yet :(Seems basically ok, please commit.> > Two questions: > > -- Any suggestions as to an existing test I could use as a model for testing this?IS this what is causing this to be broken? $ cat t.ll @union1 = constant union { i32*, i8 } { i32* @G } @G = global i32 4 $ llvm-as <t.ll | llvm-dis ; ModuleID = '<stdin>' @union1 = constant union { i32*, i8 } undef ; <union { i32*, i8 }*> [#uses=0] @G = global i32 4> -- I could also use some advice on what part of the code to work on next (in terms of finishing up union support).What is missing? -Chris
On Wed, Feb 17, 2010 at 12:05 PM, Chris Lattner <clattner at apple.com> wrote:> > On Feb 16, 2010, at 12:38 PM, Talin wrote: > > > Here's the implementation of > ConstantUnion::replaceUsesOfWithOnConstant(). No tests yet :( > > Seems basically ok, please commit. > > I suppose that means that I'll have to send in the info to get commitaccess then :( >> > Two questions: > > > > -- Any suggestions as to an existing test I could use as a model for > testing this? > > IS this what is causing this to be broken? >No no, nothing's broken. I just wanted to write some tests for the replaceAllUsesOf case, and wondered if there was an existing test to use as a model.> > $ cat t.ll > @union1 = constant union { i32*, i8 } { i32* @G } > @G = global i32 4 > $ llvm-as <t.ll | llvm-dis > ; ModuleID = '<stdin>' > > @union1 = constant union { i32*, i8 } undef ; <union { i32*, i8 }*> > [#uses=0] > @G = global i32 4 > > > -- I could also use some advice on what part of the code to work on next > (in terms of finishing up union support). > > What is missing? > > Almost everything :) At this point, the only parts of the code that areaware of unions are: - Derived type definitions (Type.cpp and so on) - BitReader and BitWriter. - LLParser. - Constants. There's no code that calculates the offsets of the union fields for example. None of the code generators know about unions yet. That's why I was wondering what area to work on next - I'm unfamiliar with the code and could use a few hints :) -- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100217/c27aba42/attachment.html>
Reasonably Related Threads
- [LLVMdev] [PATCH] - Union types, replaceUsesOfWithOnConstant
- [LLVMdev] [PATCH] - Union types, replaceUsesOfWithOnConstant
- [LLVMdev] [patch] Union Types - work in progress
- [LLVMdev] [patch] Union Types - work in progress
- [LLVMdev] [patch] Union Types - work in progress