[PATCH] D11861: [IR] Add token types

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 09:22:11 PDT 2015


majnemer 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:
> 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.

================
Comment at: test/Verifier/token1.ll:8
@@ +7,3 @@
+bb:
+  %phi = phi token [ %A, %bb ], [ %B, %entry]
+; CHECK: PHI nodes cannot have token type!
----------------
majnemer wrote:
> rnk wrote:
> > I think you can combine these tests into one token-invalid.ll file. You get one verifier failure per function, so if you keep them split up like this, it'll work.
> Sure, will do.
I tried this and it didn't seem to work.

Running llvm-as over the following gave me a single error:
```
define void @test1(token %A, token %B) {
entry:
  br label %bb

bb:
  %phi = phi token [ %A, %bb ], [ %B, %entry]
; CHECK: PHI nodes cannot have token type!
  br label %bb
}

define void @test2(token %A, token %B) {
entry:
  br label %bb

bb:
  %sel = select i1 undef, token %A, token %B
; CHECK: select values cannot have token type
  br label %bb
}

define void @test3(token %A, token %B) {
entry: 
  alloca token 
; CHECK: invalid type for alloca 
  ret void 
}
@GV = external global token
; CHECK: invalid type for global variable
```


http://reviews.llvm.org/D11861





More information about the llvm-commits mailing list