[llvm] [SeparateConstOffsetFromGEP] Reorder trivial GEP chains to separate constants (PR #73056)

Jeffrey Byrnes via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 10:04:25 PST 2023


jrbyrnes wrote:

> What exactly is special about this particular case?

When analyzing the GEP operands for constants, this pass only supports certain Value classes: {ConstantInt, BinaryOperator, TruncInst, SExtInst, ZExtInst}. In this case, the operand is a GetElementPtrInst, so the pass does not attempt to reorganize the GEP in such a way that the constant is the outtermost index.

I think it is feasible to extend the set of supported Value classes to include GEPs (primarily since we can assume nested GEPs will already have their constants extracted), but that requires a more significant rework. This feature can bridge the gap until then. 



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


More information about the llvm-commits mailing list