Skip to content

Commit

Permalink
The compiler produce invalid spirv with enabled PhysicalPointerArgsPass.
Browse files Browse the repository at this point in the history
The tool spirv-val return errors for some spirv binaries.
  • Loading branch information
AlexDemydenko committed Nov 14, 2024
1 parent c24e77d commit 75101bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ReplacePointerBitcastPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ void ComputeStore(IRBuilder<> &Builder, StoreInst *ST, Value *OrgGEPIdx,
unsigned DstEleTyBitWidth = SizeInBits(Builder, DstEleTy);

Type *OrigSrcTy = SrcTy;
if (dyn_cast<IntToPtrInst>(Src)) {
DenseMap<Value *, Type *> TypeCache;
Type *arg_type = clspv::InferType(Src, Builder.getContext(), &TypeCache);
OrigSrcTy = arg_type ? arg_type : OrigSrcTy;
}
SmallVector<Value *, 4> AddrIdxs;
ReduceType(Builder, IsGEPUser, OrgGEPIdx, SrcTy, DstTyBitWidth, NewAddrIdxs,
AddrIdxs, ToBeDeleted);
Expand Down

0 comments on commit 75101bd

Please sign in to comment.