[PATCH] [DOC] LangRef: Clarify when index of temporaries begin at 0
silvas at purdue.edu
Tue Nov 26 19:11:55 PST 2013
On Tue, Nov 26, 2013 at 10:01 PM, Mikael Lyngvig <mikael at lyngvig.org> wrote:
> You're absolutely right (from the LR, I just searched):
> For example, if a function entry block does not have an explicit label,
> it will be assigned label “%0”, then the first unnamed temporary in that
> block will be “%1”, etc.
> This is under Functions. I guess anybody should get that far, but I
> personally feel that the clarification I've submitted doesn't harm.
> Your current patch is inaccurate. If you want to duplicate what is
mentioned elsewhere about the numbering to make it more likely that someone
will see it, that would be OK.
-- Sean Silva
> -- Mikael
> 2013/11/27 Sean Silva <silvas at purdue.edu>
>> It is correct as written. Unnamed BB's are "unnamed temporaries" from a
>> counting perspective. If the first BB is unlabeled, then it becomes %0. The
>> first instruction then becomes %1, etc.
>> I swear we mention that somewhere in LangRef (I seem to recall reviewing
>> a patch mentioning that), but if not, a patch mentioning that would be fine.
>> -- Sean Silva
>> On Tue, Nov 26, 2013 at 8:50 PM, Mikael Lyngvig <mikael at lyngvig.org>wrote:
>>> This patch adds the following sentence to the LR after it states that
>>> temporaries begin at index 0:
>>> If you do not specify a label for the entry block, the temporaries
>>> start at index 1 as index
>>> 0 is then used for an implicit label generated by LLVM.
>>> This because LLC complains when you use %0 as a temporary and there is
>>> no entry point label in the function. Then you get an error message, which
>>> can be quite difficult to figure out why.
>>> If this patch is rejected, somebody should probably phrase the above
>>> appropriately and submit a new patch.
>>> -- Mikael
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits