@@ -420,10 +420,7 @@ namespace IGC
420
420
421
421
bool CodeGenPatternMatch::supportsLSCImmediateGlobalBaseOffset ()
422
422
{
423
- bool res = IGC_GET_FLAG_VALUE (LscImmOffsMatch) > 1 ||
424
- (m_Platform.matchImmOffsetsLSC () &&
425
- (m_ctx->m_DriverInfo .supportsLSCImmediateGlobalBaseOffsetForA64 () ||
426
- m_ctx->m_DriverInfo .supportsLSCImmediateGlobalBaseOffsetForA32 ()));
423
+ bool res = IGC_GET_FLAG_VALUE (LscImmOffsMatch) > 1 || m_Platform.matchImmOffsetsLSC ();
427
424
return res;
428
425
}
429
426
@@ -2764,14 +2761,6 @@ namespace IGC
2764
2761
bool isA64AddressingModel = addInstType->isPointerTy () &&
2765
2762
IGC::isA64Ptr (cast<PointerType>(addInstType), m_ctx);
2766
2763
2767
- bool isSupportedCase =
2768
- (isA64AddressingModel && m_ctx->m_DriverInfo .supportsLSCImmediateGlobalBaseOffsetForA64 ()) ||
2769
- (!isA64AddressingModel && m_ctx->m_DriverInfo .supportsLSCImmediateGlobalBaseOffsetForA32 ()) ||
2770
- IGC_GET_FLAG_VALUE (LscImmOffsMatch) > 1 ;
2771
- if (!isSupportedCase)
2772
- {
2773
- return false ;
2774
- }
2775
2764
llvm::Instruction* intToPtrInst = nullptr ;
2776
2765
if (addSubInst->getOpcode () == llvm::Instruction::IntToPtr) {
2777
2766
intToPtrInst = addSubInst;
@@ -2804,8 +2793,13 @@ namespace IGC
2804
2793
// HW does an early bounds check on varOffset for A32 messages. Thus, if varOffset
2805
2794
// is negative, then the bounds check fails early even though the immediate offset
2806
2795
// would bring the final calculation to a positive number.
2807
- if (!isA64AddressingModel && !UsedWithoutImmInMemInst (varOffset) && !valueIsPositive (varOffset, m_DL) && IGC_GET_FLAG_VALUE (LscImmOffsMatch) < 3 )
2808
- return false ;
2796
+ bool disableA32ImmediateGlobalBaseOffset =
2797
+ !isA64AddressingModel &&
2798
+ !UsedWithoutImmInMemInst (varOffset) &&
2799
+ !valueIsPositive (varOffset, m_DL) &&
2800
+ IGC_GET_FLAG_VALUE (LscImmOffsMatch) < 3 ;
2801
+
2802
+ if (disableA32ImmediateGlobalBaseOffset) return false ;
2809
2803
2810
2804
MarkAsSource (varOffset, IsSourceOfSample (&I));
2811
2805
0 commit comments