llvm-project/llvm/unittests/Transforms/Utils
Whitney Tsang 2a814cd9e1 Ensure SplitEdge to return the new block between the two given blocks
This PR implements the function splitBasicBlockBefore to address an
issue
that occurred during SplitEdge(BB, Succ, ...), inside splitBlockBefore.
The issue occurs in SplitEdge when the Succ has a single predecessor
and the edge between the BB and Succ is not critical. This produces
the result ‘BB->Succ->New’. The new function splitBasicBlockBefore
was added to splitBlockBefore to handle the issue and now produces
the correct result ‘BB->New->Succ’.

Below is an example of splitting the block bb1 at its first instruction.

/// Original IR
bb0:
	br bb1
bb1:
        %0 = mul i32 1, 2
	br bb2
bb2:
/// IR after splitEdge(bb0, bb1) using splitBasicBlock
bb0:
	br bb1
bb1:
	br bb1.split
bb1.split:
        %0 = mul i32 1, 2
	br bb2
bb2:
/// IR after splitEdge(bb0, bb1) using splitBasicBlockBefore
bb0:
	br bb1.split
bb1.split
	br bb1
bb1:
        %0 = mul i32 1, 2
	br bb2
bb2:

Differential Revision: https://reviews.llvm.org/D92200
2020-12-18 17:37:17 +00:00
..
ASanStackFrameLayoutTest.cpp
BasicBlockUtilsTest.cpp Ensure SplitEdge to return the new block between the two given blocks 2020-12-18 17:37:17 +00:00
CMakeLists.txt [SCEV] Move ScalarEvolutionExpander.cpp to Transforms/Utils (NFC). 2020-05-20 10:53:40 +01:00
CallPromotionUtilsTest.cpp [llvm][NFC] Refactor uses of CallSite to CallBase - call promotion 2020-04-12 08:27:29 -07:00
CloningTest.cpp [docs][unittest][Go][StackProtector] Migrate deprecated DebugInfo::get to DILocation::get 2020-12-15 14:17:04 -08:00
CodeExtractorTest.cpp [CodeExtractor] Replace uses of extracted bitcasts in out-of-region lifetime markers 2020-11-05 17:01:08 -08:00
CodeMoverUtilsTest.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00
FunctionComparatorTest.cpp
IntegerDivisionTest.cpp
LocalTest.cpp [SimplifyCFG] MergeBlockIntoPredecessor() already knows how to preserve DomTree 2020-12-17 01:03:49 +03:00
LoopRotationUtilsTest.cpp [LoopRotate] add ability to repeat loop rotation until non-deoptimizing exit is found 2020-01-23 15:56:24 +03:00
LoopUtilsTest.cpp LoopUtils.h - reduce AliasAnalysis.h include to forward declarations. NFC. 2020-06-24 17:58:38 +01:00
SSAUpdaterBulkTest.cpp
ScalarEvolutionExpanderTest.cpp [SCEVExpander] Support expanding nonintegral pointers with constant base. 2020-09-19 17:19:53 +01:00
SizeOptsTest.cpp
UnrollLoopTest.cpp [NFC][SCEV] Piping to pass TTI into SCEVExpander::isHighCostExpansionHelper() 2020-02-25 23:05:56 +03:00
VFABIUtils.cpp
ValueMapperTest.cpp