Closed dkolsen-pgi closed 2 days ago
I resolved the code review requests, except for VecCreateOp::fold
. Would you like me to do that now, or separately?
I resolved the code review requests, except for
VecCreateOp::fold
. Would you like me to do that now, or separately?
That can come next! Good to go after resolving conflicts.
I rebased my branch (with manual work to avoid the deprecated isa
/cast
/dyn_cast
functions). It should now be free of conflicts.
Implement vector constants in ClangIR.
Resolves issue #498 - Add a
cir.const_vec
, simlar tocir.const_array
andcir.const_struct
Create a new kind of attribute,
cir::ConstVectorAttr
in the code or#cir.const_vector
in the assembly, which represents a compile-time value of acir::VectorType
. The values for the elements within the vector are stored as attributes within anmlir::ArrayAttr
.When doing CodeGen for a prvalue of vector type, try to represent it as
cir.const #cir.const_vector
first. If that fails, most likely because some of the elements are not compile-time values, fall back to the existing code that uses acir.vec.create
operation.When lowering directly to LLVM IR, lower
cir.const #cir.const_vector
asllvm.mlir.constant(dense<[...]> : _type_) : _type_
.When lowering through other MLIR dialects, lower
cir.const #cir.const_vector
asarith.constant dense<[...]> : _type_
.No new tests were added, but the expected results of the existing tests that use vector constants were updated.