[PATCH] D11861: [IR] Add token types

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


majnemer added a comment.

In http://reviews.llvm.org/D11861#220835, @sanjoy wrote:

> Couple of questions
>
> - [obsolete -- I see you disallow the `token*` type] 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) ```
>
>   ?


I don't think such a transformation would be canonical because the call is now indirect.  Nevertheless, this wouldn't have an effect on my use case.  Which would you prefer?


================
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;
----------------
sanjoy wrote:
> 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.
Correct.


http://reviews.llvm.org/D11861





More information about the llvm-commits mailing list