[PATCH] D11861: [IR] Add token types

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 11:35:47 PDT 2015


sanjoy added a comment.

Couple of questions

- Can we load / store through a pointer of type `token`, allocated on the heap, or created via `inttoptr`?
- Can we do this transform:

  if (cond) {
    %t0 = call token @p()
    call @consume(token %t0)
  } else {
    %t1 = call token @p()
    call @consume(token %t1)
  }

TO

  %t = call token (cond ? @p : @q)()
  call @consume(token %t)

?


================
Comment at: lib/Analysis/LoopInfo.cpp:211
@@ -210,1 +210,3 @@
   for (Loop::block_iterator I = block_begin(), E = block_end(); I != E; ++I) {
+    if ((*I)->getType()->isTokenTy())
+      return false;
----------------
Just to be clear -- this is only conservatively correct, right?  IIUC, we should be able to clone token producing instructions as long as we do not introduce phis / selects.


http://reviews.llvm.org/D11861





More information about the llvm-commits mailing list