arsenm added inline comments. ================ Comment at: lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp:139-140 + + const unsigned PtrIdx = 0; + const unsigned ValIdx = 1; + ---------------- You can use I.getPointerOperand/getValOperand https://reviews.llvm.org/D51969