================
@@ -536,6 +536,18 @@ DeletionKind LLVM::BitcastOp::removeBlockingUses(
   return DeletionKind::Delete;
 }
 
+void LLVM::BitcastOp::getPromotableSlotAliases(
+    OpOperand &aliasedSlotPointerOperand, const MemorySlot &parentSlot,
+    SmallVectorImpl<MemorySlot> &newMemorySlots) {
+  // Only pointer-to-pointer bitcasts alias a memory slot. With opaque
+  // pointers, the alias slot keeps the parent's element type since the
+  // pointer type itself does not carry it.
+  if (!isa<LLVM::LLVMPointerType>(getResult().getType()) ||
+      !isa<LLVM::LLVMPointerType>(getArg().getType()))
+    return;
----------------
gysit wrote:

I wonder if we should add this given that such a bitcast should fold and 
probably not be created in the first place (due to opaque pointers)?

https://github.com/llvm/llvm-project/pull/199226
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to