[llvm] [AMDGPU] Update PromoteAlloca to handle GEPs with variable offset. (PR #122342)

Sumanth Gundapaneni via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 13:20:21 PST 2025


================
@@ -385,13 +385,42 @@ static bool isSupportedMemset(MemSetInst *I, AllocaInst *AI,
          match(I->getOperand(2), m_SpecificInt(Size)) && !I->isVolatile();
 }
 
+static bool hasVariableOffset(GetElementPtrInst *GEP) {
----------------
sgundapa wrote:

WeakVH might not be useful here as the Value still exists in the code. We can do a DCE but I am not sure if it guaranteed if the Value has no uses in the code. 

https://github.com/llvm/llvm-project/pull/122342


More information about the llvm-commits mailing list