-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Currently, if you have BitCode that does not specify a target, it gets a default architecture. This is especially odd if you are doing llvm-ld -native but it first applies optimizations for a target other than what it is currently compiling for. Ideally, target-specific optimizations wouldn't be applied until a target was given. This would allow simple programs to be target-agnostic. (And therefore more likely to work for newcomers.) Why is there a default target? Why can't those optimizations just be skipped until there is one? (To be clear: I am assuming there is a reason for this. I am asking what it is.) Especially in the case of llvm-ld -native, why doesn't it set the target to the platform it is compiling for? Failing that, it could use the platform it is currently running on as the target. - -- main(){char s[]="+~{Y$-:>2vp5z^",c=244,i;int j=44404; for(;j>0;j--)for(i=0;i<14;i++)c+=s[i]-=c;puts(s);} -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkuBy3gACgkQxzVgPqtIcftJ1wCfUen0P0Hqe+I/4gzqQvh0lLO8 HAAAn2BInGLdEUmX5Px2+3KRgAVEGtBS =Es2n -----END PGP SIGNATURE-----
Hi S3,> Currently, if you have BitCode that does not > specify a target, it gets a default architecture. > This is especially odd if you are doing > llvm-ld -native > but it first applies optimizations for > a target other than what it is currently compiling for.there has been some work on this, especially for "opt", but I don't know the status. Ciao, Duncan.
On Feb 21, 2010, at 4:10 PM, S3 wrote:> > Why is there a default target? > Why can't those optimizations just be skipped until there is one? > (To be clear: I am assuming there is a reason for this. > I am asking what it is.)This has recently been fixed on trunk. The opt tool no longer adds a default target if a Module has no target attributes, and the optimizers now know how to be conservative when there's no target information.> Especially in the case of llvm-ld -native, > why doesn't it set the target to the platform > it is compiling for?This sounds like it could be called a bug. Please file a bugzilla report. Dan
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1>> Why is there a default target? >> Why can't those optimizations just be skipped until there is one? >> (To be clear: I am assuming there is a reason for this. >> I am asking what it is.)> This has recently been fixed on trunk. The opt tool no longer adds a > default target if a Module has no target attributes, and the optimizers > now know how to be conservative when there's no target information.Great. That should make everything a lot easier.>> Especially in the case of llvm-ld -native, >> why doesn't it set the target to the platform >> it is compiling for?> This sounds like it could be called a bug. Please file a bugzilla report.Filed: http://llvm.org/bugs/show_bug.cgi?id=6401 - -- ++++++++++++[->+++++++>+++++++++<<]>-.>[->+>+>+>+>+ <<<<<]>++++++++.>-------.<--.>>.---.>++.>-----.>+++ +++++[->++++<]>.<<<<<<<<.>>++.>.>.>.>>++++++++++. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkuDhSIACgkQxzVgPqtIcfupCwCfRs9HlLHu4fXjr5tRRORIkI2R YcAAn2VYga4ykTbx2+9zlJwgv0+PgNPD =00oU -----END PGP SIGNATURE-----