OpaquePtr: use load instruction directly for type. NFC.

llvm-svn: 365768
This commit is contained in:
Tim Northover 2019-07-11 13:12:08 +00:00
parent 030bb3d363
commit 27658ed512
1 changed files with 1 additions and 2 deletions

View File

@ -975,8 +975,7 @@ static bool isLoadInvariantInLoop(LoadInst *LI, DominatorTree *DT,
Loop *CurLoop) {
Value *Addr = LI->getOperand(0);
const DataLayout &DL = LI->getModule()->getDataLayout();
const uint32_t LocSizeInBits = DL.getTypeSizeInBits(
cast<PointerType>(Addr->getType())->getElementType());
const uint32_t LocSizeInBits = DL.getTypeSizeInBits(LI->getType());
// if the type is i8 addrspace(x)*, we know this is the type of
// llvm.invariant.start operand