File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -108,26 +108,27 @@ enum AddressSpace {
108108 UniformConstant =
109109 storageClassToAddressSpace (SPIRV::StorageClass::UniformConstant),
110110 Workgroup = storageClassToAddressSpace (SPIRV::StorageClass::Workgroup),
111- Generic = storageClassToAddressSpace (SPIRV::StorageClass::Generic)
111+ Generic = storageClassToAddressSpace (SPIRV::StorageClass::Generic),
112+ Invalid = UINT32_MAX
112113};
113114
114115unsigned SPIRVTargetMachine::getAssumedAddrSpace (const Value *V) const {
115116 // TODO: we only enable this for AMDGCN flavoured SPIR-V, where we know it to
116117 // be correct; this might be relaxed in the future.
117118 if (getTargetTriple ().getVendor () != Triple::VendorType::AMD)
118- return UINT32_MAX ;
119+ return Invalid ;
119120
120121 const auto *LD = dyn_cast<LoadInst>(V);
121122 if (!LD)
122- return UINT32_MAX ;
123+ return Invalid ;
123124
124125 // It must be a load from a pointer to Generic.
125126 assert (V->getType ()->isPointerTy () &&
126127 V->getType ()->getPointerAddressSpace () == AddressSpace::Generic);
127128
128129 const auto *Ptr = LD->getPointerOperand ();
129130 if (Ptr->getType ()->getPointerAddressSpace () != AddressSpace::UniformConstant)
130- return UINT32_MAX ;
131+ return Invalid ;
131132 // For a load from a pointer to UniformConstant, we can infer CrossWorkgroup
132133 // storage, as this could only have been legally initialised with a
133134 // CrossWorkgroup (aka device) constant pointer.
You can’t perform that action at this time.
0 commit comments