Displaying 2 results from an estimated 2 matches for "disablebranchopt".
Did you mean:
disablebranchopts
2018 Jun 29
2
Cleaning up ‘br i1 false’ cases in CodeGenPrepare
...tantFoldTerminator (which
handles the br i1 false condition) is called only once and if after
the transformation of code by ConstantFoldTerminator() and
DeleteDeadBlock() we end up with code like "br i1 false", there is no
further opportunity to clean them up. So calling this code under
(!DisableBranchOpts) in a loop until no more transformations are made
fixes this issue. Is this reasonable ?
My simple fix (without any indentation changes) is:
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -316,7 +316,9 @@ bool CodeGenPrepare::runOnFunction(Function &F...
2018 Jun 29
2
Cleaning up ‘br i1 false’ cases in CodeGenPrepare
...i1 false condition) is called only once and if after
> > the transformation of code by ConstantFoldTerminator() and
> > DeleteDeadBlock() we end up with code like "br i1 false", there is no
> > further opportunity to clean them up. So calling this code under
> > (!DisableBranchOpts) in a loop until no more transformations are made
> > fixes this issue. Is this reasonable ?
>
> I would expect the precise case you're running into is rare: the second
> iteration of the loop does nothing useful unless the IR specifically has
> an i1 phi node in a block whos...