[llvm] [DirectX] Implement typedBufferLoad_checkbit (PR #108087)

S. Bharadwaj Yadavalli via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 11 08:19:42 PDT 2024


================
@@ -265,16 +265,50 @@ class OpLowerer {
 
   /// Replace uses of \c Intrin with the values in the `dx.ResRet` of \c Op.
   /// Since we expect to be post-scalarization, make an effort to avoid vectors.
-  Error replaceResRetUses(CallInst *Intrin, CallInst *Op) {
+  Error replaceResRetUses(CallInst *Intrin, CallInst *Op, bool HasCheckBit) {
     IRBuilder<> &IRB = OpBuilder.getIRB();
 
+    Instruction *OldResult = Intrin;
     Type *OldTy = Intrin->getType();
 
+    if (HasCheckBit) {
+      auto *ST = cast<StructType>(OldTy);
----------------
bharadwajy wrote:

Does the success of cast need to be ensured by checking `ST != nullptr`, here and similarly on line 299?

https://github.com/llvm/llvm-project/pull/108087


More information about the llvm-commits mailing list