1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/unittests/Transforms/Utils
Sidharth Baveja de093310b0 [SplitEdge] Update SplitCriticalEdge to return a nullptr only when the edge is not critical
Summary:
The function SplitCriticalEdge (called by SplitEdge) can return a nullptr in
cases where the edge is a critical. SplitEdge uses SplitCriticalEdge assuming it
can always split all critical edges, which is an incorrect assumption.

The three cases where the function SplitCriticalEdge will return a nullptr is:
1. DestBB is an exception block
2. Options.IgnoreUnreachableDests is set to true and
isa(DestBB->getFirstNonPHIOrDbgOrLifetime()) is not equal to a nullptr
3. LoopSimplify form must be preserved (Options.PreserveLoopSimplify is true)
and it cannot be maintained for a loop due to indirect branches

For each of these situations they are handled in the following way:
1. Modified the function ehAwareSplitEdge originally from
llvm/lib/Transforms/Coroutines/CoroFrame.cpp to handle the cases when the DestBB
is an exception block. This function is called directly in SplitEdge.
SplitEdge does not call SplitCriticalEdge in this case
2. Options.IgnoreUnreachableDests is set to false by default, so this situation
does not apply.
3. Return a nullptr in this situation since the SplitCriticalEdge also returned
nullptr. Nothing we can do in this case.

Reviewed By: asbirlea

Differential Revision:https://reviews.llvm.org/D94619
2021-04-06 21:24:40 +00:00
..
ASanStackFrameLayoutTest.cpp
BasicBlockUtilsTest.cpp [SplitEdge] Update SplitCriticalEdge to return a nullptr only when the edge is not critical 2021-04-06 21:24:40 +00:00
CallPromotionUtilsTest.cpp
CloningTest.cpp Reapply "OpaquePtr: Turn inalloca into a type attribute" 2021-03-29 08:55:30 -04:00
CMakeLists.txt Reland "[Debugify] Make the debugify aware of the original (-g) Debug Info" 2021-02-18 23:29:22 -08:00
CodeExtractorTest.cpp
CodeMoverUtilsTest.cpp
DebugifyTest.cpp Reland "[Debugify] Make the debugify aware of the original (-g) Debug Info" 2021-02-18 23:29:22 -08:00
FunctionComparatorTest.cpp
IntegerDivisionTest.cpp
LocalTest.cpp Fix 2: [DebugInfo] Support DIArgList in DbgVariableIntrinsic 2021-03-08 15:43:39 +00:00
LoopRotationUtilsTest.cpp
LoopUtilsTest.cpp
ScalarEvolutionExpanderTest.cpp Reland [SCEV] Improve modelling for (null) pointer constants 2021-03-13 16:05:34 +03:00
SizeOptsTest.cpp
SSAUpdaterBulkTest.cpp
UnrollLoopTest.cpp
ValueMapperTest.cpp ValueMapper: Rename RF_MoveDistinctMDs => RF_ReuseAndMutateDistinctMDs, NFC 2021-02-10 16:53:21 -08:00
VFABIUtils.cpp