Hello everyone,<br><br>I intend to build a pass to profile some benchmarks for loop carried dependencies. At first I tried looking at LoopDependenceAnalysis.{h,cpp} but the files were removed for some reason. So I continued with the DependenceAnalysis pass. But the flow, anti dependence, etc methods are only reporting sequential and not loop carried dependencies. Does LLVM support loop carried dependency analysis?<br>
<br>In addition, the distance and direction for dependent instructions always have invalid values; Dependence::getDirection() returns DVEntry::ALL which is the default value and Dependence::getDistance always returns null. <br>
<br>E.g, for this input loop:<br>for (int i = 1; i < 100; i++)<br>{<br> arr[i] = arr[i-1];<br>}<br><br>This dependence is reported:<br>%1 = load i32* %arrayidx.i, align 4 ---> store i32 %1, i32* %arrayidx2.i, align 4<br>
<br>And the following is the code to output distance and directions. nestingLevel is the innermost loop depth, 1 in this case.<br><br>Dependence* dependence = dependenceAnalysis->depends(instructions[src], instructions[dst], true);<br>
if (dependence)<br>{<br> unsigned direction = dependence->getDirection(nestingLevel); // Returns DVEntry::ALL<br> if (const SCEV* scev = dependence->getDistance(nestingLevel)) // Returns null<br> {...}<br>
}<br><br>void ExtractFeatures::getAnalysisUsage(AnalysisUsage &analysisUsage) const<br>{<br> analysisUsage.addRequired<LoopInfo>();<br> analysisUsage.addPreserved<LoopInfo>();<br> analysisUsage.addRequired<ScalarEvolution>();<br>
analysisUsage.addPreserved<ScalarEvolution>();<br> analysisUsage.addRequired<AliasAnalysis>();<br> analysisUsage.addPreserved<AliasAnalysis>();<br> analysisUsage.addRequired<MemoryDependenceAnalysis>();<br>
analysisUsage.addPreserved<MemoryDependenceAnalysis>();<br> analysisUsage.addRequired<DependenceAnalysis>();<br> analysisUsage.addPreserved<DependenceAnalysis>();<br>}<br><br>