[LLVMdev] convert switch stmts to If statements
georgebaah at gmail.com
Mon May 6 13:28:49 PDT 2013
On Mon, May 6, 2013 at 4:27 PM, Nadav Rotem <nrotem at apple.com> wrote:
> There is also the LowerSwitch pass that converts switch instructions to a
> sequence of branches.
> On May 6, 2013, at 1:24 PM, George Baah <georgebaah at gmail.com> wrote:
> I mean an llvm Pass that transforms switch statements into if statements.
> For example, if I have code with switch statements then running the pass
> will convert all switches to ifs in the bytecode.
> On Mon, May 6, 2013 at 4:20 PM, Hal Finkel <hfinkel at anl.gov> wrote:
>> ----- Original Message -----
>> > From: "George Baah" <georgebaah at gmail.com>
>> > To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
>> > Sent: Monday, May 6, 2013 3:09:33 PM
>> > Subject: [LLVMdev] convert switch stmts to If statements
>> > Hi All, Is there a pass in llvm that converts switch statements to if
>> > statements?
>> What do you mean by convert? SelectionDAGBuilder::visitSwitch in
>> lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp converts the switch
>> statements for code generation either into indirect jump tables or into
>> binary-search trees (which I suppose you could call if statements).
>> > George
>> > _______________________________________________
>> > LLVM Developers mailing list
>> > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev