Skip to content

Commit b5df0e7

Browse files
klensyklensy
and
klensy
authored
[SelectionDAG] late init DeferredNodes (#123461)
No need to init `SmallVector` (even stack allocated) if we can exit literally on next line. Co-authored-by: klensy <[email protected]>
1 parent 0cb2fe5 commit b5df0e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/CodeGen/SelectionDAGNodes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -916,10 +916,10 @@ END_TWO_BYTE_PACK()
916916
SmallVectorImpl<const SDNode *> &Worklist,
917917
unsigned int MaxSteps = 0,
918918
bool TopologicalPrune = false) {
919-
SmallVector<const SDNode *, 8> DeferredNodes;
920919
if (Visited.count(N))
921920
return true;
922921

922+
SmallVector<const SDNode *, 8> DeferredNodes;
923923
// Node Id's are assigned in three places: As a topological
924924
// ordering (> 0), during legalization (results in values set to
925925
// 0), new nodes (set to -1). If N has a topolgical id then we

0 commit comments

Comments
 (0)