Improve handling of datalayout for generic targets.
Flag 32-bit vector types as only requiring 32-bit alignment (preemptive bug fix for 32xi1 vectors). Force module datalayouts to be the same before linking them to silence an LLVM warning. Finishes issue #309.
This commit is contained in:
@@ -241,9 +241,11 @@ Module::Module(const char *fn) {
|
||||
module->setTargetTriple(g->target.GetTripleString());
|
||||
|
||||
if (g->target.isa == Target::GENERIC) {
|
||||
// <16 x i1> vectors only need 16 bit / 2 byte alignment
|
||||
std::string datalayout = module->getDataLayout();
|
||||
datalayout += "v16:16:16";
|
||||
// <16 x i1> vectors only need 16 bit / 2 byte alignment, so add
|
||||
// that to the regular datalayout string for IA..
|
||||
std::string datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-"
|
||||
"i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-"
|
||||
"f80:128:128-n8:16:32:64-S128-v16:16:16-v32:32:32";
|
||||
module->setDataLayout(datalayout);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user