[PATCH] D123693: Transform illegal intrinsics to V_ILLEGAL

Brendon Cahoon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 15:33:50 PDT 2022


bcahoon added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h:540
+  ILLEGAL,
+
   LAST_AMDGPU_ISD_NUMBER
----------------
Will ILLEGAL be removed?


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:6636
+        return makeV_ILLEGAL(Op, DAG);
+      }
     }
----------------
No need for braces


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:8399
+
+  // Add the V_ILLEGAL node to the root chain to prevent its removal.
+  auto Chains = SmallVector<SDValue, 2u>();
----------------
The v_illegal should have an operand for the chain operand in the original instruction, if one exists.
  
t0 EntryToken
res,ch = intrinsic t0, <other opernads>
->
res = undef
ch = v_illegal t0

Also, if there is a use of the chain definition in the original instruction, then there is no need to add the code below.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123693/new/

https://reviews.llvm.org/D123693



More information about the llvm-commits mailing list