[llvm] [InstCombine] fold `gepi _, (srem x, y)` to `gepi _, (urem x, y)` if `y` is power-of-2 (PR #180148)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 6 03:15:47 PST 2026
================
@@ -3347,6 +3348,40 @@ Instruction *InstCombinerImpl::visitGetElementPtrInst(GetElementPtrInst &GEP) {
}
}
+ // srem -> (and/urem) for inbounds+nuw byte GEP ---
+ if (GEPEltType->isIntegerTy(8) && Indices.size() == 1 && GEP.isInBounds() &&
----------------
imkiva wrote:
Thank you and fixed accordingly
https://github.com/llvm/llvm-project/pull/180148
More information about the llvm-commits
mailing list