Are there some built-in LLVM transformation pass, or written library code that transforms LLVM::SwitchInst into if-condition statements (LLVM:: BranchInst)?
The purpose of the transformation is that we have a legacy program analyzer that includes an LLVM pass manipulating if-condition statements. Statements of LLVM::SwithchInst should have been handled in the same manner but was not done. Thus to transform these SwitchInst to if-condition looks a viable alternative for us.
To illustrate, I give a simple C snippet with ‘switch’ and the expected transformation.