[PATCH] D123693: Transform illegal intrinsics to V_ILLEGAL

Leon Clark via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 13 21:23:32 PDT 2022


Leonc added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp:327
+        if (VT.isFloatingPoint()) {
+          return CurDAG->getConstantFP(0.0, DL, VT);
+        }
----------------
arsenm wrote:
> Just replace with undef regardless of the type. You also should have just done this when the node was initially created, no need to use the DAG preprocess
I did try doing this in `TargetLowering` originally, but any `SDValue` returned from a lowering function must have the same type(s) as the node it's replacing. I think this was the same for undef but I'll try it again just to be sure.


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