File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -637,12 +637,16 @@ std::vector<Chain> Vectorizer::splitChainByContiguity(Chain &C) {
637637 " collectEquivalenceClass" );
638638
639639 // Add this instruction to the end of the current chain, or start a new one.
640+ uint64_t SzBytes = SzBits / 8 ;
641+ assert (SzBytes % ElemBytes == 0 );
640642 APInt ReadEnd = It->OffsetFromLeader + SzBits / 8 ;
641- // Alllow redundancy: partial or full overlaping counts as contiguous.
642- int ExtraBytes =
643- PrevReadEnd.sle (ReadEnd) ? (ReadEnd - PrevReadEnd).getSExtValue () : 0 ;
644- bool AreContiguous = It->OffsetFromLeader .sle (PrevReadEnd) &&
645- SzBits % ElemBytes == 0 && ExtraBytes % ElemBytes == 0 ;
643+ // Allow redundancy: partial or full overlap counts as contiguous.
644+ bool AreContiguous = false ;
645+ if (It->OffsetFromLeader .sle (PrevReadEnd)) {
646+ uint64_t Overlap = (PrevReadEnd - It->OffsetFromLeader ).getZExtValue ();
647+ if (Overlap % ElemBytes == 0 )
648+ AreContiguous = true ;
649+ }
646650
647651 LLVM_DEBUG (dbgs () << " LSV: Instruction is "
648652 << (AreContiguous ? " contiguous" : " chain-breaker" )
You can’t perform that action at this time.
0 commit comments