Skip to content

Commit 8f2a40d

Browse files
author
Shimin Cui
committed
Use SE.getWiderType&getNoopOrZeroExtend per Florian's suggestion
1 parent 8894074 commit 8f2a40d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

llvm/lib/Analysis/DependenceAnalysis.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,13 +1132,9 @@ bool DependenceInfo::haveSameSD(const Loop *SrcLoop,
11321132
DstUP = SE->getBackedgeTakenCount(DstLoop);
11331133

11341134
if (SrcUB != nullptr && DstUP != nullptr) {
1135-
unsigned SrcBitWidth = SE->getTypeSizeInBits(SrcUB->getType());
1136-
unsigned DstBitWidth = SE->getTypeSizeInBits(DstUP->getType());
1137-
if (SrcBitWidth < DstBitWidth) {
1138-
SrcUB = SE->getZeroExtendExpr(SrcUB, DstUP->getType());
1139-
} else if (SrcBitWidth > DstBitWidth) {
1140-
DstUP = SE->getZeroExtendExpr(DstUP, SrcUB->getType());
1141-
}
1135+
Type *WiderType = SE->getWiderType(SrcUB->getType(), DstUP->getType());
1136+
SrcUB = SE->getNoopOrZeroExtend(SrcUB, WiderType);
1137+
DstUP = SE->getNoopOrZeroExtend(DstUP, WiderType);
11421138

11431139
if (SE->isKnownPredicate(ICmpInst::ICMP_EQ, SrcUB, DstUP))
11441140
return true;

0 commit comments

Comments
 (0)