<div dir="ltr"><div style>Thanks!</div><div style><br></div><div>George</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 6, 2013 at 4:27 PM, Nadav Rotem <span dir="ltr"><<a href="mailto:nrotem@apple.com" target="_blank">nrotem@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>There is also the LowerSwitch pass that converts switch instructions to a sequence of branches. </div>
<div><div class="h5"><br><div><div>On May 6, 2013, at 1:24 PM, George Baah <<a href="mailto:georgebaah@gmail.com" target="_blank">georgebaah@gmail.com</a>> wrote:</div><br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div dir="ltr">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.<div><br></div>
<div>George</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 6, 2013 at 4:20 PM, Hal Finkel<span> </span><span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span><span> </span>wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>----- Original Message -----<br>> From: "George Baah" <<a href="mailto:georgebaah@gmail.com" target="_blank">georgebaah@gmail.com</a>><br>
> To: "LLVM Developers Mailing List" <<a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a>><br>> Sent: Monday, May 6, 2013 3:09:33 PM<br>> Subject: [LLVMdev] convert switch stmts to If statements<br>
><br>><br>><br>><br>> Hi All, Is there a pass in llvm that converts switch statements to if<br>> statements?<br>><br><br></div></div>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).<br>
<br> -Hal<br><br>><br>> George<br>> _______________________________________________<br>> LLVM Developers mailing list<br>><span> </span><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a><span> </span> <span> </span><a href="http://llvm.cs.uiuc.edu/" target="_blank">http://llvm.cs.uiuc.edu</a><br>
><span> </span><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>><br></blockquote></div><br></div>_______________________________________________<br>
LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></div>
</blockquote></div><br></div></div></div></blockquote></div><br></div>