[PATCH] D32483: [EarlyCSE] Make branches unconditional if the condition is known

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 10:54:21 PDT 2017


efriedma added a comment.

EarlyCSE is supposed to preserve the CFG (calls setPreservesCFG, depends on DomTree/MemorySSA etc.), so you can't replace a conditional branch with an unconditional branch.  Replacing the value of the condition with "true" or "false" is fine, though.

Why do we want to do this specifically for branches, as opposed to doing it for any instruction where we can prove an operand is constant?


https://reviews.llvm.org/D32483





More information about the llvm-commits mailing list