I added your suggestion and am using this now llvm::legacy::FunctionPassManager *functionPassManager = new llvm::legacy::FunctionPassManager(Mod); llvm::PassRegistry ®istry = *llvm::PassRegistry::getPassRegistry(); initializeScalarOpts(registry); functionPassManager->add( new llvm::TargetLibraryInfoWrapperPass(llvm::TargetLibraryInfoImpl(targetMachine->getTargetTriple())) ); still, LV: The Widest register is: 32 bits. so, unfortunately no change. If I dump the Module, it starts with: ; ModuleID = 'module' target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" Does this datalayout look good for x86-64 AVX ? Frank On 02/19/2016 03:14 PM, Mehdi Amini wrote:> Do you have the TTI in your pass manager? > > Something like: > > // Add the TTI (required to inform the vectorizer about register size for > // instance) > PM.add(createTargetTransformInfoWrapperPass(TM->getTargetIRAnalysis())); > > Also, are you populating the pass manager using the passmanagerbuilder? You still need the TLI: > > // Populate the PassManager > PassManagerBuilder PMB; > PMB.LibraryInfo = new TargetLibraryInfoImpl(TM->getTargetTriple()); > .... > > > Or without the PassManagerBuild, something like: > > PM.add(new TargetLibraryInfoWrapperPass(TargetLibraryInfoImpl(TM->getTargetTriple()))); > >
Have you added the TTI as I showed? It is not clear from you excerpt below. -- Mehdi> On Feb 19, 2016, at 12:24 PM, Frank Winter <fwinter at jlab.org> wrote: > > I added your suggestion and am using this now > > llvm::legacy::FunctionPassManager *functionPassManager = new llvm::legacy::FunctionPassManager(Mod); > > llvm::PassRegistry ®istry = *llvm::PassRegistry::getPassRegistry(); > initializeScalarOpts(registry); > > functionPassManager->add( new llvm::TargetLibraryInfoWrapperPass(llvm::TargetLibraryInfoImpl(targetMachine->getTargetTriple())) ); > > > still, > > LV: The Widest register is: 32 bits. > > > so, unfortunately no change. > > If I dump the Module, it starts with: > > ; ModuleID = 'module' > target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" > > > Does this datalayout look good for x86-64 AVX ? > > > Frank > > > > On 02/19/2016 03:14 PM, Mehdi Amini wrote: >> Do you have the TTI in your pass manager? >> >> Something like: >> >> // Add the TTI (required to inform the vectorizer about register size for >> // instance) >> PM.add(createTargetTransformInfoWrapperPass(TM->getTargetIRAnalysis())); >> >> Also, are you populating the pass manager using the passmanagerbuilder? You still need the TLI: >> >> // Populate the PassManager >> PassManagerBuilder PMB; >> PMB.LibraryInfo = new TargetLibraryInfoImpl(TM->getTargetTriple()); >> .... >> >> >> Or without the PassManagerBuild, something like: >> >> PM.add(new TargetLibraryInfoWrapperPass(TargetLibraryInfoImpl(TM->getTargetTriple()))); >> >> > >
You also need to actually set the target cpu. -Hal ----- Original Message -----> From: "Mehdi Amini via llvm-dev" <llvm-dev at lists.llvm.org> > To: "Frank Winter" <fwinter at jlab.org> > Cc: "LLVM Dev" <llvm-dev at lists.llvm.org> > Sent: Friday, February 19, 2016 2:28:11 PM > Subject: Re: [llvm-dev] target triple in 3.8 > > Have you added the TTI as I showed? It is not clear from you excerpt > below. > > -- > Mehdi > > > > > On Feb 19, 2016, at 12:24 PM, Frank Winter <fwinter at jlab.org> > > wrote: > > > > I added your suggestion and am using this now > > > > llvm::legacy::FunctionPassManager *functionPassManager = new > > llvm::legacy::FunctionPassManager(Mod); > > > > llvm::PassRegistry ®istry > > *llvm::PassRegistry::getPassRegistry(); > > initializeScalarOpts(registry); > > > > functionPassManager->add( new > > llvm::TargetLibraryInfoWrapperPass(llvm::TargetLibraryInfoImpl(targetMachine->getTargetTriple())) > > ); > > > > > > still, > > > > LV: The Widest register is: 32 bits. > > > > > > so, unfortunately no change. > > > > If I dump the Module, it starts with: > > > > ; ModuleID = 'module' > > target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" > > > > > > Does this datalayout look good for x86-64 AVX ? > > > > > > Frank > > > > > > > > On 02/19/2016 03:14 PM, Mehdi Amini wrote: > >> Do you have the TTI in your pass manager? > >> > >> Something like: > >> > >> // Add the TTI (required to inform the vectorizer about > >> register size for > >> // instance) > >> PM.add(createTargetTransformInfoWrapperPass(TM->getTargetIRAnalysis())); > >> > >> Also, are you populating the pass manager using the > >> passmanagerbuilder? You still need the TLI: > >> > >> // Populate the PassManager > >> PassManagerBuilder PMB; > >> PMB.LibraryInfo = new > >> TargetLibraryInfoImpl(TM->getTargetTriple()); > >> .... > >> > >> > >> Or without the PassManagerBuild, something like: > >> > >> PM.add(new > >> TargetLibraryInfoWrapperPass(TargetLibraryInfoImpl(TM->getTargetTriple()))); > >> > >> > > > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Hal Finkel Assistant Computational Scientist Leadership Computing Facility Argonne National Laboratory