Displaying 1 result from an estimated 1 matches for "islooplatch".
2018 Jul 06
2
Verify that we only get loop metadata on latches
...data(LLVMContext::MD_loop)) {
// FIXME: Is SwitchInst also allowed?
Assert(isa<BranchInst>(I), "llvm.loop only expected on branches", &I);
LoopInfo LI;
LI.analyze(DT);
Loop* L = LI.getLoopFor(BB);
Assert(L, "llvm.loop not in a loop", &I);
Assert(L->isLoopLatch(BB), "llvm.loop not in a latch", &I);
}
```
Note that the above just was a simple test. For example, we do not want to reinitialize LoopInfo for each found occurence of !llvm.loop if doing this properly.
Also note that the above only checks that the branch is in a latch block, not th...