]> granicus.if.org Git - llvm/commitdiff
OpaquePtr: use load instruction directly for type. NFC.
authorTim Northover <tnorthover@apple.com>
Thu, 11 Jul 2019 13:12:08 +0000 (13:12 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 11 Jul 2019 13:12:08 +0000 (13:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365768 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LICM.cpp

index 3c5e773f7938c7ff70735e4f67d9b6e81cda9387..d9dda4cef2d25484295020c917efadaf7884312e 100644 (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