mirror of
				https://github.com/intel/intel-graphics-compiler.git
				synced 2025-10-30 08:18:26 +08:00 
			
		
		
		
	Fix OCL atomic benchmark regression
More investigation is needed. Currently, we don't apply atomic_iadd to atomic_inc/dec optimization to OCL cases.
This commit is contained in:
		| @ -68,6 +68,7 @@ public: | ||||
|  | ||||
|   bool EnableShaderDebugHashCodeInKernel() const override { return true; } | ||||
|  | ||||
|   bool supportsAtomicIaddToIncDec() const override { return false; } | ||||
| }; | ||||
|  | ||||
| // In case some cpas are specific to NEO | ||||
|  | ||||
| @ -400,6 +400,7 @@ public: | ||||
|     return (IGC_GET_FLAG_VALUE(UseNewInlineRaytracing) & | ||||
|             static_cast<uint32_t>(NewInlineRaytracingMask::NonRTShaders)) != 0; | ||||
|   } | ||||
|   virtual bool supportsAtomicIaddToIncDec() const { return true; } | ||||
|  | ||||
| protected: | ||||
|   bool autoGRFSelection = false; | ||||
|  | ||||
| @ -523,7 +523,7 @@ void CustomSafeOptPass::visitIntAtomicIAddToIncOrDec(CallInst *I) { | ||||
| // or | ||||
| // %13 = call i32 @llvm.genx.GenISA.intatomicrawA64.i32.p3i32.p3i32(i32 addrspace(3)* %12, i32 addrspace(3)* %12, i32 poison, i32 2) | ||||
| // %14 = call i32 @llvm.genx.GenISA.intatomicrawA64.i32.p3i32.p3i32(i32 addrspace(3)* %12, i32 addrspace(3)* %12, i32 poison, i32 3) | ||||
|   // clang-format on | ||||
| // clang-format on | ||||
|   if (id == GenISAIntrinsic::GenISA_intatomicraw || id == GenISAIntrinsic::GenISA_intatomicrawA64) { | ||||
|     if (instr->getOperand(0)->getType()->getPointerAddressSpace() == ADDRESS_SPACE_LOCAL) | ||||
|       return; | ||||
| @ -916,7 +916,9 @@ void CustomSafeOptPass::visitCallInst(CallInst &C) { | ||||
|     case GenISAIntrinsic::GenISA_intatomictyped: | ||||
|     case GenISAIntrinsic::GenISA_intatomicraw: | ||||
|     case GenISAIntrinsic::GenISA_intatomicrawA64: { | ||||
|       visitIntAtomicIAddToIncOrDec(inst); | ||||
|       if (pContext->m_DriverInfo.supportsAtomicIaddToIncDec()) { | ||||
|         visitIntAtomicIAddToIncOrDec(inst); | ||||
|       } | ||||
|       break; | ||||
|     } | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Chen, Kai
					Chen, Kai