[llvm] Adjust bit cast instruction filter for DXIL Prepare pass (PR #142678)

Deric C. via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 4 12:25:03 PDT 2025


================
@@ -148,9 +148,47 @@ class DXILPrepareModule : public ModulePass {
                                      Type *Ty) {
     // Omit bitcasts if the incoming value matches the instruction type.
     auto It = PointerTypes.find(Operand);
-    if (It != PointerTypes.end())
-      if (cast<TypedPointerType>(It->second)->getElementType() == Ty)
+    if (It != PointerTypes.end()) {
+      auto OpTy = cast<TypedPointerType>(It->second)->getElementType();
----------------
Icohedron wrote:

```suggestion
      auto *OpTy = cast<TypedPointerType>(It->second)->getElementType();
```
Shouldn't this be a pointer?

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


More information about the llvm-commits mailing list