Add a getPointerOperandType() helper to LoadInst and StoreInst; NFC

I will use this in a later change.

llvm-svn: 300613
This commit is contained in:
Sanjoy Das
2017-04-18 22:00:54 +00:00
parent 630d0c0f44
commit f09c1e346e
5 changed files with 11 additions and 12 deletions

View File

@@ -925,9 +925,8 @@ static AliasResult aliasSameBasePointerGEPs(const GEPOperator *GEP1,
const DataLayout &DL) {
assert(GEP1->getPointerOperand()->stripPointerCasts() ==
GEP2->getPointerOperand()->stripPointerCasts() &&
GEP1->getPointerOperand()->getType() ==
GEP2->getPointerOperand()->getType() &&
GEP2->getPointerOperand()->stripPointerCasts() &&
GEP1->getPointerOperandType() == GEP2->getPointerOperandType() &&
"Expected GEPs with the same pointer operand");
// Try to determine whether GEP1 and GEP2 index through arrays, into structs,
@@ -1186,9 +1185,8 @@ AliasResult BasicAAResult::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size,
// just the same underlying object), see if that tells us anything about
// the resulting pointers.
if (GEP1->getPointerOperand()->stripPointerCasts() ==
GEP2->getPointerOperand()->stripPointerCasts() &&
GEP1->getPointerOperand()->getType() ==
GEP2->getPointerOperand()->getType()) {
GEP2->getPointerOperand()->stripPointerCasts() &&
GEP1->getPointerOperandType() == GEP2->getPointerOperandType()) {
AliasResult R = aliasSameBasePointerGEPs(GEP1, V1Size, GEP2, V2Size, DL);
// If we couldn't find anything interesting, don't abandon just yet.
if (R != MayAlias)