[llvm-commits] [llvm] r48999 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
Evan Cheng
evan.cheng at apple.com
Tue Apr 1 00:05:45 PDT 2008
It looks right to me:
// If the starting point was specifiy, use it
if (start) {
QI = start;
blockBegin = start->getParent()->begin();
// If the starting point wasn't specified, but the block was, use it
} else if (!start && block) {
QI = block->end();
blockBegin = block->begin();
}
// Walk backwards through the block, looking for dependencies
while (QI != blockBegin) {
--QI;
QI is the iterator. Seems to me blockBegin really should point to the
start of the block.
Evan
On Mar 31, 2008, at 11:12 PM, Owen Anderson wrote:
> Dan,
>
> I don't think this is right. MemDep walks backwards through the
> block to find dependencies, so it needs to start at the end of the
> block.
>
> --Owen
>
> On Mar 31, 2008, at 5:08 PM, Dan Gohman wrote:
>
>> Author: djg
>> Date: Mon Mar 31 17:08:00 2008
>> New Revision: 48999
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=48999&view=rev
>> Log:
>> Set blockBegin to point to the beginning of the block,
>> not the end.
>>
>> Modified:
>> llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
>>
>> Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=48999&r1=48998&r2=48999&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
>> +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Mon Mar 31
>> 17:08:00 2008
>> @@ -99,11 +99,11 @@
>> // If the starting point was specifiy, use it
>> if (start) {
>> QI = start;
>> - blockBegin = start->getParent()->end();
>> + blockBegin = start->getParent()->begin();
>> // If the starting point wasn't specified, but the block was, use it
>> } else if (!start && block) {
>> QI = block->end();
>> - blockBegin = block->end();
>> + blockBegin = block->begin();
>> }
>>
>> // Walk backwards through the block, looking for dependencies
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list