Teach TargetData to handle 'preferred' alignment for each target, and use
these alignment amounts to align scalars when we can. Patch by Scott Michel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33409 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp
index 7fd62cc..c88e393 100644
--- a/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/lib/ExecutionEngine/JIT/JIT.cpp
@@ -338,7 +338,7 @@
// compilation.
const Type *GlobalType = GV->getType()->getElementType();
size_t S = getTargetData()->getTypeSize(GlobalType);
- size_t A = getTargetData()->getTypeAlignment(GlobalType);
+ size_t A = getTargetData()->getTypeAlignmentPref(GlobalType);
if (A <= 8) {
Ptr = malloc(S);
} else {