Skip to content

Commit a5c3cbf

Browse files
committed
[Loads] Drop dead Offset argument (NFC)
The argument is always zero now.
1 parent 09583de commit a5c3cbf

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

llvm/lib/Analysis/Loads.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@
2525

2626
using namespace llvm;
2727

28-
static bool isAligned(const Value *Base, const APInt &Offset, Align Alignment,
28+
static bool isAligned(const Value *Base, Align Alignment,
2929
const DataLayout &DL) {
30-
Align BA = Base->getPointerAlignment(DL);
31-
return BA >= Alignment && Offset.isAligned(BA);
30+
return Base->getPointerAlignment(DL) >= Alignment;
3231
}
3332

3433
/// Test if V is always a pointer to allocated and suitably aligned memory for
@@ -118,8 +117,7 @@ static bool isDereferenceableAndAlignedPointer(
118117
// As we recursed through GEPs to get here, we've incrementally checked
119118
// that each step advanced by a multiple of the alignment. If our base is
120119
// properly aligned, then the original offset accessed must also be.
121-
APInt Offset(DL.getTypeStoreSizeInBits(V->getType()), 0);
122-
return isAligned(V, Offset, Alignment, DL);
120+
return isAligned(V, Alignment, DL);
123121
}
124122

125123
/// TODO refactor this function to be able to search independently for
@@ -154,8 +152,7 @@ static bool isDereferenceableAndAlignedPointer(
154152
// checked that each step advanced by a multiple of the alignment. If
155153
// our base is properly aligned, then the original offset accessed
156154
// must also be.
157-
APInt Offset(DL.getTypeStoreSizeInBits(V->getType()), 0);
158-
return isAligned(V, Offset, Alignment, DL);
155+
return isAligned(V, Alignment, DL);
159156
}
160157
}
161158
}

0 commit comments

Comments
 (0)