Hello All
I am looking for an LLVM pass that is able to detect branches whose condition is known if they are reached. To illustrate what I mean, I attached a screenshot showing a partial CFG of a function. The branch in basic block for.cond.cleanup3 tests the same condition as the branch in the entry block, and has the same target BB if the condition is false. Also, if you inspect the graph carefully, the basic block for.cond.cleanup3 cannot be reached unless the first branch condition was true. This means that the condition of the branch in for.cond.cleanup3 will always be true. As such, it is possible to eliminate this branch, making it unconditional. Is there an LLVM pass that is able to perform such transformation?
Thanks
-Adel