[llvm-dev] RFC: Add guard intrinsics to LLVM

Sanjoy Das via llvm-dev llvm-dev at lists.llvm.org
Mon Feb 22 22:31:50 PST 2016


I noticed this after sending, but the examples have some potential for
confusion -- the X in the deopt state has nothing specifically to do
with the X in the condition.

>
>      define i32 @f() {
>        if (X) return side_exit() [ "deopt"(X) ];
>        return i32 20;
>      }
>
>      define i64 @g() {
>        if (Y) {
>          r = f() [ "deopt"(Y) ];
>          print(r);
>      }
>
>    We get
>
>      define i64 @g() {
>        if (Y) {
>          if (X) return side_exit() [ "deopt"(Y, X) ];
>          print(20);
>        }
>      }
>
>    and not
>
>      define i64 @g() {
>        if (Y) {
>          r = X ? (side_exit() [ "deopt"(Y, X) ]) : 20;
>          print(r);
>      }

-- Sanjoy


More information about the llvm-dev mailing list