[PATCH] D143518: [DirectX backend] add pass to collect Resource information from dxil metadata.

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 10:56:39 PST 2023


beanz added a comment.

I don't think this PR is correct. It seems like we should be able to ensure that the analysis result remains preserved after the metadata is generated allowing us to re-use the analysis result that was used to generate the metadata.



================
Comment at: llvm/lib/Target/DirectX/DXILResource.cpp:45
+    const MDTuple *ResMD =
+        dyn_cast_or_null<MDTuple>(Tuple->getOperand(i).get());
+    assert(ResMD != nullptr && "");
----------------
If the tuple _must_ have the operand (as demonstrated by the asserts below), this can just be a `dyn_cast`.

`dyn_cast_or_null` has been replaced by `dyn_cast_if_present`, and should only be used when `null` is a valid input and output.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143518



More information about the llvm-commits mailing list