[llvm] [IRBuilder] Handle byte types in CreateBitPreservingCastChain (PR #209557)

Anshil Gandhi via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 20:21:03 PDT 2026


================
@@ -149,7 +149,9 @@ Value *IRBuilderBase::CreateBitPreservingCastChain(const DataLayout &DL,
   }
 
   // See if we need ptrtoint for this type pair. May require additional bitcast.
-  if (OldTy->isPtrOrPtrVectorTy() && NewTy->isIntOrIntVectorTy()) {
+  bool NewIsIntLike =
+      NewTy->isIntOrIntVectorTy() || NewTy->isByteOrByteVectorTy();
----------------
gandhi56 wrote:

Implemented. Does `isCastableThroughIntOrPtr` sound okay, @vporpo ?

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


More information about the llvm-commits mailing list