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

Leo Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 17:07:09 PDT 2017


aoli added a comment.

> For your insertvalue example, I don't see any problem with that transform; the important part is that we can't transform the indexes (see http://llvm.org/docs/LangRef.html#insertvalue-instruction)

It may be a bug in  canReplaceOperandWithVariable:

  case Instruction::ExtractValue:
  case Instruction::InsertValue:
    // All operands apart from the first are constant.
    return OpIdx == 0;

Only first operand is allowed to be set to a non-constant value.


https://reviews.llvm.org/D34576





More information about the llvm-commits mailing list