llvm-project/llvm/test
Roman Lebedev 9f35d2b564 [SimplifyCFG] FoldTwoEntryPHINode(): don't bailout on i1 PHI's if we can 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
2019-08-29 12:47:34 +00:00
..
Analysis [CostModel] Model all `extractvalue`s as free. 2019-08-29 11:50:30 +00:00
Assembler Debug Info: Support for DW_AT_export_symbols for anonymous structs 2019-08-23 17:19:21 +00:00
Bindings Revert "Expose TailCallKind via the LLVM C API" 2019-08-15 03:49:51 +00:00
Bitcode [BitcodeReader] Check if we can create a null constant for type. 2019-08-21 18:20:11 +00:00
BugPoint
CodeGen [DebugInfo] LiveDebugValues: correctly discriminate kinds of variable locations 2019-08-29 11:20:54 +00:00
DebugInfo [DebugInfo] LiveDebugValues: correctly discriminate kinds of variable locations 2019-08-29 11:20:54 +00:00
Demangle
Examples
ExecutionEngine [JITLink] Don't under-align zero-fill sections. 2019-08-27 15:22:23 +00:00
Feature [FPEnv] Add fptosi and fptoui constrained intrinsics. 2019-08-28 16:33:36 +00:00
FileCheck [FileCheck] Move -dump-input diagnostic to first line 2019-08-14 02:56:09 +00:00
Instrumentation [ASan] Make insertion of version mismatch guard configurable 2019-08-28 20:40:55 +00:00
Integer
JitListener
LTO Revert r370105 - Update two x86 datalayouts for r370083, looks like racing commits 2019-08-28 01:55:06 +00:00
Linker IR: print value numbers for unnamed function arguments 2019-08-03 14:28:34 +00:00
MC [WebAssembly] Add atomic.fence instruction 2019-08-28 23:13:43 +00:00
MachineVerifier Remove unnecessary REQUIRES from a test. 2019-08-24 02:39:51 +00:00
Object [llvm-readobj/llvm-readelf] - Report a proper warning when dumping a broken dynamic relocation. 2019-08-29 10:55:57 +00:00
ObjectYAML [ObjectYAML] Fix lifetime issue in dumpDebugLines 2019-08-29 02:36:48 +00:00
Other [SlotIndexes] Add print-slotindexes to disable printing slotindexes 2019-08-22 13:44:47 +00:00
Reduce [Bugpoint redesign] Added Pass to Remove Global Variables 2019-08-15 22:54:09 +00:00
SafepointIRVerifier
Support
SymbolRewriter
TableGen GlobalISel/TableGen: Handle setcc patterns 2019-08-29 01:13:41 +00:00
ThinLTO/X86 Revert r370105 - Update two x86 datalayouts for r370083, looks like racing commits 2019-08-28 01:55:06 +00:00
Transforms [SimplifyCFG] FoldTwoEntryPHINode(): don't bailout on i1 PHI's if we can hoist a 'not' from incoming values 2019-08-29 12:47:34 +00:00
Unit
Verifier [IntrinsicEmitter] Support scalable vectors in intrinsics 2019-08-27 12:57:09 +00:00
YAMLParser
tools [yaml2obj] - Allow placing local symbols after globals. 2019-08-29 10:58:47 +00:00
.clang-format
CMakeLists.txt Added Delta IR Reduction Tool 2019-08-08 22:16:33 +00:00
TestRunner.sh
lit.cfg.py
lit.site.cfg.py.in