diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 19051fa2e15..9bfd66afb29 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -5053,8 +5053,8 @@ Instruction *InstCombiner::PromoteCastOfAllocation(CastInst &CI, const Type *CastElTy = PTy->getElementType(); if (!AllocElTy->isSized() || !CastElTy->isSized()) return 0; - unsigned AllocElTyAlign = TD->getTypeSize(AllocElTy); - unsigned CastElTyAlign = TD->getTypeSize(CastElTy); + unsigned AllocElTyAlign = TD->getTypeAlignment(AllocElTy); + unsigned CastElTyAlign = TD->getTypeAlignment(CastElTy); if (CastElTyAlign < AllocElTyAlign) return 0; // If the allocation has multiple uses, only promote it if we are strictly |

