This fixes a problem with the current behavior when assertions are enabled.
A loop that exits to a catchswitch instruction is skipped for the counter
promotion, however this check was being done after the PGOCounterPromoter
tried to collect an insertion point for the exit block. A call to
getFirstInsertionPt() on a block that begins with a catchswitch instruction
triggers an assertion. This change performs a check whether the counter
promotion is possible prior to collecting the ExitBlocks and InsertPts.
Details
Details
Diff Detail
Diff Detail
Event Timeline
llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp | ||
---|---|---|
362 | Why this change (changing ExitingBlocks to ExitBlocks)? |
llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp | ||
---|---|---|
362 | Sorry, that was a mistake on my part. Thanks for catching that. I misread that one was setting 'exiting' vs' exit' in the call. will update patch. |
llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp | ||
---|---|---|
328 | You can pass LoopExitBlocks reference as a parameter to this function so that the call to getExitBlocks can be shared with the caller of it. |
llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp | ||
---|---|---|
328 | ok. will do. |
You can pass LoopExitBlocks reference as a parameter to this function so that the call to getExitBlocks can be shared with the caller of it.