[PATCH] D143107: [SPIR-V] Emit spv_undef intrinsic for aggregate undef operands

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 08:39:45 PST 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp:155
 
+void SPIRVEmitIntrinsics::preprocessUndefs() {
+  std::queue<Instruction *> Worklist;
----------------
I don't really understand why you need to handle this in an IR pass, undoes could easily appear at any time


================
Comment at: llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp:166
+      if (isa<UndefValue>(Op) && Op->getType()->isAggregateType()) {
+        auto *AggrUndef = dyn_cast<UndefValue>(Op);
+        IRB->SetInsertPoint(I);
----------------
You're using isa and dyn_cast, just use dyn_cast once


================
Comment at: llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp:1352
+    return MIB.constrainAllUses(TII, TRI, RBI);
+  } break;
   case Intrinsic::spv_const_composite: {
----------------
dead break


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

https://reviews.llvm.org/D143107



More information about the llvm-commits mailing list