[PATCH] D34576: [ConstantHoisting] Avoid hoisting constants in GEPs that index into a struct type.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 15:41:57 PDT 2017


efriedma added a comment.

> However, we'd also end up iterating the GEP once for each operand.

Oh, didn't think of that.

> I couldn't find any limit on the number of indices in a GEP

No, there isn't a limit (although we probably have other algorithms that would explode with deeply nested types).

If we need to, we could special-case GEPs, and use canReplaceOperandWithVariable for other instructions.


https://reviews.llvm.org/D34576





More information about the llvm-commits mailing list