When I use -Os with a clang that implicitly calls llc, I get much different code than when call clang first with -Os and then call llc. How do I get these two paths to generate the same code? Tia. Reed
check that the same passes are running and check that you are getting the same inline threshold. On 23 July 2013 07:34, reed kotler <rkotler at mips.com> wrote:> When I use -Os with a clang that implicitly calls llc, I get much different > code than when call clang first with -Os and then call llc. > > How do I get these two paths to generate the same code? > > Tia. > > Reed > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
23.07.2013, 16:05, "reed kotler" <rkotler at mips.com>:> When I use -Os with a clang that implicitly calls llc, I get much > different code than when call clang first with -Os and then call llc.clang does NOT call llc internally.> How do I get these two paths to generate the same code?Call llc with -Os? -- Regards, Konstantin
On 07/23/2013 05:19 AM, Konstantin Tokarev wrote:> > 23.07.2013, 16:05, "reed kotler" <rkotler at mips.com>: >> When I use -Os with a clang that implicitly calls llc, I get much >> different code than when call clang first with -Os and then call llc. > clang does NOT call llc internally.I understand. It's invoking that functionality is what I meant to say but not technically running that command.> >> How do I get these two paths to generate the same code? > Call llc with -Os?You can't pass -Os to llc. -Os is a clang only option. It's reflected in the IR used by llc in the function attributes.
On 23 July 2013 12:34, reed kotler <rkotler at mips.com> wrote:> How do I get these two paths to generate the same code? >Hi Reed, First, make sure that it's really -Os that is generating the difference by calling clang -v -Os, and explicitly calling all flags apart from -Os and then compare the results. Try to mimic as many parameters in llc as possible, with llc specific flags. I've seen this happen when lowering to specific ARM cores and if I didn't use the same relevant flags on both sides, the final code would be broken. --renato -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130723/30d25be0/attachment.html>