In LLVM IR, the GEP indices that correspond to structures are required to be
i32 constants. MLIR models constants as just values defined by special
operations, and there is no verification that it is the case for structure
indices in GEP. Furthermore, some common transformations such as control flow
simplification may lead to the operands becoming non-constant. Make it possible
to directly supply constant values to LLVM GEPOp to guarantee they remain
constant until the translation to LLVM IR. This is not yet a requirement and
the verifier is not modified, this will be introduced separately.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/test/Target/LLVMIR/llvmir.mlir | ||
---|---|---|
982 | Can you add a test where the constant's aren't always at the end. E.g. struct { [10 x i64], [10 x f32] } can have a gep of constant 0, nonconstant %i |
Can you add a test where the constant's aren't always at the end. E.g. struct { [10 x i64], [10 x f32] } can have a gep of constant 0, nonconstant %i