We were previously only searching a single preheader for call instructions when reverting WhileLoopStarts to DoLoopStarts. This extends that to multiple blocks that can come up when, for example a loop is expanded from a memcpy. It also expends the instructions from just Call's to also include other LoopStarts, to catch other low overhead loops in the preheader.
Details
Diff Detail
Unit Tests
Time | Test | |
---|---|---|
950 ms | x64 windows > Clang.Index::complete-macros.c |
Event Timeline
llvm/lib/Target/ARM/MVETPAndVPTOptimisationsPass.cpp | ||
---|---|---|
269 | Bikeshedding names: CheckForLRUseInPreheader. I thought the clue was that we not only search the Preheader. So perhaps this should be something like CheckForLRUseInPredecessors? | |
282 | Nit, instead of the big if, an early exit/continue? if (!IsInvalidTPInstruction(MI)) continue; | |
llvm/test/CodeGen/Thumb2/LowOverheadLoops/memcall.ll | ||
279 | would it be good to have a MIR test for this too? |
llvm/lib/Target/ARM/MVETPAndVPTOptimisationsPass.cpp | ||
---|---|---|
269 | Since the function name has changed, this (and also in the function declaration) parameter name | |
281 | Uhm, just trying to understand the original logic ... but why does a call (in the Preheader) result in reversion of t2WhileLoopStartLR to t2DoLoopStart ? | |
llvm/test/CodeGen/Thumb2/LowOverheadLoops/wls-search-pred.mir | ||
38–40 | do we need llvm.memcpy and llvm.memmove declarations here ? |
llvm/lib/Target/ARM/MVETPAndVPTOptimisationsPass.cpp | ||
---|---|---|
281 | What I meant was wouldn't a call (in the preheader/predecessor) be placed before the t2WhileLoopStartLR (since it's a terminator) ... and hence it should not matter if LR get's overwritten by the call ? |
llvm/lib/Target/ARM/MVETPAndVPTOptimisationsPass.cpp | ||
---|---|---|
269 | No, it's a preheader. Though the naming gets a bit fuzzy. There was a preheader that is split into multiple blocks, which this has to search through. They together will make up the predecessors. And eventually reach the block with the WhileLoopStart (which in other contexts is also called the predecessor.) | |
281 | This is after the WhileLoopStart, but before the actual loop. There can be other instructions/blocks in that preheader before the loop, including calls and whatnot. The block that contains the WhileLoopStart isn't the same as the block that we put the DoLoopStart in. |
clang-tidy: warning: invalid case style for function 'CheckForLRUseInPredecessors' [readability-identifier-naming]
not useful