summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SimplifyCFG/unsigned-multiplication-will-overflow.ll
Commit message (Collapse)AuthorAgeFilesLines
* [SimplifyCFG] FoldTwoEntryPHINode(): don't bailout on i1 PHI's if we can ↵Roman Lebedev2019-08-291-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hoist a 'not' from incoming values Summary: As it can be seen in the tests in D65143/D65144, even though we have formed an '@llvm.umul.with.overflow' and got rid of potential for division-by-zero, the control flow remains, we still have that branch. We have this condition: ``` // Don't fold i1 branches on PHIs which contain binary operators // These can often be turned into switches and other things. if (PN->getType()->isIntegerTy(1) && (isa<BinaryOperator>(PN->getIncomingValue(0)) || isa<BinaryOperator>(PN->getIncomingValue(1)) || isa<BinaryOperator>(IfCond))) return false; ``` which was added back in rL121764 to help with `select` formation i think? That check prevents us to flatten the CFG here, even though we know we no longer need that guard and will be able to drop everything but the '@llvm.umul.with.overflow' + `not`. As it can be seen from tests, we end here because the `not` is being sinked into the PHI's incoming values by InstCombine, so we can't workaround this by hoisting it to after PHI. Thus i suggest that we relax that check to not bailout if we'd get to hoist the `not`. Reviewers: craig.topper, spatel, fhahn, nikic Reviewed By: spatel Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65147 llvm-svn: 370349
* [NFC][PhaseOredering][SimplifyCFG] Add more runlines to umul.with.overflow testsRoman Lebedev2019-07-231-13/+15
| | | | | | | | This way it will be more obvious that the problem is both in cost threshold and in hardcoded benefit check, plus will show how the instsimplify cleans this all in the end. llvm-svn: 366800
* [SimplifyCFG][NFC] Test that we fail to flatten CFG after forming ↵Roman Lebedev2019-07-221-0/+38
@llvm.umul.with.overflow Even if we formed @llvm.umul.with.overflow, we are still stuck with that guard against div-by-zero, which is no longer needed, because we didn't flatten the CFG. llvm-svn: 366749
OpenPOWER on IntegriCloud