Better check

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43897 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index c8d03be..efcd8e3 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -7582,7 +7582,7 @@
                                            unsigned PrefAlign = 0) {
   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
     unsigned Align = GV->getAlignment();
-    if (Align == 0 && TD && !isa<OpaqueType>(GV->getType()->getElementType())) 
+    if (Align == 0 && TD && GV->getType()->getElementType()->isSized()) 
       Align = TD->getPrefTypeAlignment(GV->getType()->getElementType());
 
     // If there is a large requested alignment and we can, bump up the alignment