MCPcopy Create free account
hub / github.com/AdaptiveCpp/AdaptiveCpp / descendInstructionUseTree

Function descendInstructionUseTree

src/compiler/stdpar/SyncElision.cpp:33–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32template <class Handler>
33bool descendInstructionUseTree(llvm::Instruction *I, Handler &&H,
34 llvm::Instruction *Parent = nullptr) {
35 if(H(I, Parent)) {
36 for(auto* U : I->users()) {
37 if(auto* UI = llvm::dyn_cast<llvm::Instruction>(U)) {
38 if(!descendInstructionUseTree(UI, H, I))
39 return false;
40 } else {
41 return false;
42 }
43 }
44 return true;
45 } else {
46 return false;
47 }
48}
49
50using InstToInstListMapT =
51 llvm::SmallDenseMap<llvm::Instruction *, llvm::SmallVector<llvm::Instruction *, 16>>;

Calls

no outgoing calls

Tested by

no test coverage detected