From f132387454f076b3406a3bdb6aecb007de0e61d0 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Thu, 11 Jul 2019 13:12:08 +0000 Subject: [PATCH] OpaquePtr: use load instruction directly for type. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365768 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LICM.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index 3c5e773f793..d9dda4cef2d 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -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(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 -- 2.40.0