[llvm] r365768 - OpaquePtr: use load instruction directly for type. NFC.

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 06:12:09 PDT 2019


Author: tnorthover
Date: Thu Jul 11 06:12:08 2019
New Revision: 365768

URL: http://llvm.org/viewvc/llvm-project?rev=365768&view=rev
Log:
OpaquePtr: use load instruction directly for type. NFC.

Modified:
    llvm/trunk/lib/Transforms/Scalar/LICM.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=365768&r1=365767&r2=365768&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Thu Jul 11 06:12:08 2019
@@ -975,8 +975,7 @@ static bool isLoadInvariantInLoop(LoadIn
                                   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




More information about the llvm-commits mailing list