Shawn Landden via llvm-dev
2019-May-23 14:29 UTC
[llvm-dev] Different internal representation of SwitchInst
SwitchInst is currently represented as paired operands, which is internally a linked-list. This is not ideal, as these types are fixed (APInt and BasicBlock), and there is also code of dubious quality that doesn't really get that this is a linked list, like from SwitchInst:removeCase: OL[NumOps-2].set(nullptr); OL[NumOps-2+1].set(nullptr); I've already done quite a bit of work on the SwitchInst, and have much more planned. I think the cases would be better represented by a SmallArray<std::pair<APInt, BasicBlock*>, 4>. Before I get time to jump in implement this, assuming I can probably keep most of the interfaces, is there any reason this wouldn't work? -Shawn Landden
Chris Lattner via llvm-dev
2019-May-25 06:01 UTC
[llvm-dev] Different internal representation of SwitchInst
This sounds like a great improvement to me Shawn! -Chris> On May 23, 2019, at 7:29 AM, Shawn Landden via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > SwitchInst is currently represented as paired operands, which is > internally a linked-list. This is not ideal, as these types are fixed > (APInt and BasicBlock), and there is also code of dubious quality that > doesn't really get that this is a linked list, like from > SwitchInst:removeCase: > > OL[NumOps-2].set(nullptr); > OL[NumOps-2+1].set(nullptr); > > I've already done quite a bit of work on the SwitchInst, and have much > more planned. I think the cases would be better represented by a > SmallArray<std::pair<APInt, BasicBlock*>, 4>. > > Before I get time to jump in implement this, assuming I can probably > keep most of the interfaces, is there any reason this wouldn't work? > > -Shawn Landden > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev