On 22/10/12 21:12, Rafael Espíndola wrote:
On 22 October 2012 14:53, Chandler Carruth <[email protected]> wrote:
So, I'm not really sure if this is the right approach. I'd like some
folks from the LLVM side of things to chime in.
In general, I'm not certain we want to continue growing our dependence
on the signext and zeroext attributes on return types, or whether we
want to do the extension in the frontend instead.
Most of the targets in Clang currently eagerly zext or sext the return
value to make it conform to the ABI. You can look at some of the other
classify*Type methods in Clang for how.
As far as I know the difference is enabling optimization. If we see a
declare i8 zeroext @foo()
the caller knows that the top bits of the return are 0. There was some
discussion about just using the range metadata, but that is not
available for arguments/returns at the moment.
Chris wrote some notes about this:
http://www.nondot.org/sabre/LLVMNotes/ExtendedIntegerResults.txt
The plan seems sensible to me, but was blocked by not having a good
way of attaching the information to parameters and return values.
Hopefully Bill's attribute work means it is now possible.
Ciao, Duncan.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits