Hello, We are now facing a bug caused by the GVN pass, only part of the code was optimized. I have found that the problem is cause by an Limit in lib/Analysis/MemoryDependenceAnalysis.cpp 00055 static cl::opt<unsigned> BlockScanLimit( 00056 "memdep-block-scan-limit", cl::Hidden, cl::init(100), 00057 cl::desc("The number of instructions to scan in a block in memory " 00058 "dependency analysis (default = 100)")); The args can be changed using opt, but we are using libclang and libllvm and running pass with llvm passmangers. I know that -mllvm can pass llvm args, but the llvm::cl::ParseCommandLineOptions has some issues with mutlethread and I have reported a bug in https://llvm.org/bugs/show_bug.cgi?id=25735, and we could not use this for now. So if there is another way to pass this memdep-block-scan-limit into the pass manager or context? Or how could I set this memdep-block-scan-limit right with libclang and libllvm? Thanks Xiuli -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160418/be15066f/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: test.ll Type: application/octet-stream Size: 10686 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160418/be15066f/attachment.obj>
On Mon, Apr 18, 2016 at 05:17:04PM +0800, xiuli pan via llvm-dev wrote:> So if there is another way to pass this memdep-block-scan-limit into the > pass manager or context? Or how could I set this memdep-block-scan-limit > right with libclang and libllvm?Can't you call llvm::cl::ParseCommandLineOptions once at startup of your program? The internal flags are sticky, they are not a per-compilation property. Joerg
Cases like this illustrate why we should avoid arbitrary cutoffs in analysis passes if at all possible. Philip On 04/18/2016 03:08 AM, Joerg Sonnenberger via llvm-dev wrote:> On Mon, Apr 18, 2016 at 05:17:04PM +0800, xiuli pan via llvm-dev wrote: >> So if there is another way to pass this memdep-block-scan-limit into the >> pass manager or context? Or how could I set this memdep-block-scan-limit >> right with libclang and libllvm? > Can't you call llvm::cl::ParseCommandLineOptions once at startup of your > program? The internal flags are sticky, they are not a per-compilation > property. > > Joerg > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Hi Joerg, This workaround seems work. Thanks Xiuli -----Original Message----- From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Joerg Sonnenberger via llvm-dev Sent: Monday, April 18, 2016 6:08 PM To: llvm-dev at lists.llvm.org Subject: Re: [llvm-dev] GVN pass limitation. On Mon, Apr 18, 2016 at 05:17:04PM +0800, xiuli pan via llvm-dev wrote:> So if there is another way to pass this memdep-block-scan-limit into > the pass manager or context? Or how could I set this > memdep-block-scan-limit right with libclang and libllvm?Can't you call llvm::cl::ParseCommandLineOptions once at startup of your program? The internal flags are sticky, they are not a per-compilation property. Joerg _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev