[PATCH] D11861: [IR] Add token types

Joseph Tremoulet via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 10:08:50 PDT 2015


JosephTremoulet added inline comments.

================
Comment at: test/Assembler/token.ll:6
@@ +5,3 @@
+; CHECK: define void @sh16(token
+define void @sh16(token %A) {
+entry:
----------------
majnemer wrote:
> majnemer wrote:
> > JosephTremoulet wrote:
> > > Seems odd to allow token parameters but not token returns; I'd have expected each kind of cross-function transfer to cause roughly the same amount of trouble.
> > Right, I'll preclude this possibility.
> Actually, it should be OK for a function to accept token parameters so long as it cannot return a token.  If it returned a token, it would be ambiguous which token would be returned.
The use case for return tokens that I can see is in the caller, to track a value back unobscurably to a callsite (which would require the call to be rewritten before/at lowering, so seems more likely with intrinsics than real functions).

The use case for parameter tokens I don't really understand.  I think you're suggesting that it would be to introduce unobscurable interprocedural dataflow?  Allowing that with multiple callers seems tantamount to allowing token PHIs.

At any rate, all of this is a thought experiment for possible future uses as far as I'm concerned, so I have no issue with the code going in as-is.


http://reviews.llvm.org/D11861





More information about the llvm-commits mailing list