mirror of
				https://github.com/intel/intel-graphics-compiler.git
				synced 2025-10-30 08:18:26 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			47 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| /*========================== begin_copyright_notice ============================
 | |
| 
 | |
| Copyright (C) 2025 Intel Corporation
 | |
| 
 | |
| SPDX-License-Identifier: MIT
 | |
| 
 | |
| ============================= end_copyright_notice ===========================*/
 | |
| 
 | |
| The reason for removal of below condition was that it took a very strict
 | |
| approach to the Convergent attribute, which caused missed optimization
 | |
| opportunities in cases where it was safe to do so.
 | |
| The decision is based on the discussion in LLVM RFC
 | |
| https://reviews.llvm.org/D90361?id=303195
 | |
| This patch should be considered obsolete if LICM introduces a more
 | |
| advanced approach to the Convergent attribute in the future version of
 | |
| LLVM.
 | |
| ---
 | |
| diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
 | |
| index 2865dece8..f879176b3 100644
 | |
| --- a/llvm/lib/Transforms/Scalar/LICM.cpp
 | |
| +++ b/llvm/lib/Transforms/Scalar/LICM.cpp
 | |
| @@ -1202,8 +1202,18 @@ bool llvm::canSinkOrHoistInst(Instruction &I, AAResults *AA, DominatorTree *DT,
 | |
|      // inter-thread communication which results are implicitly affected by the
 | |
|      // enclosing control flows. It is not safe to hoist or sink such operations
 | |
|      // across control flow.
 | |
| -    if (CI->isConvergent())
 | |
| -      return false;
 | |
| +
 | |
| +    // The reason for removal of below condition was that it took a very strict
 | |
| +    // approach to the Convergent attribute, which caused missed optimization
 | |
| +    // opportunities in cases where it was safe to do so.
 | |
| +    // The decision is based on the discussion in LLVM RFC
 | |
| +    // https://reviews.llvm.org/D90361?id=303195
 | |
| +    // This patch should be considered obsolete if LICM introduces a more
 | |
| +    // advanced approach to the Convergent attribute in the future version of
 | |
| +    // LLVM.
 | |
| +
 | |
| +    //if (CI->isConvergent())
 | |
| +    //  return false;
 | |
|  
 | |
|      using namespace PatternMatch;
 | |
|      if (match(CI, m_Intrinsic<Intrinsic::assume>()))
 | |
| --
 | |
| 2.43.0
 | |
| 
 | |
| 
 | 
