更新IR,.g4修改

This commit is contained in:
rain2133
2025-06-21 18:06:29 +08:00
parent 3ed1c7fecd
commit 0a04c816cf
4 changed files with 446 additions and 21 deletions

View File

@@ -1575,6 +1575,7 @@ class ConstantVariable : public User, public LVal {
Value* getByIndex(unsigned index) const { return initValues.getValue(index); } ///< 通过一维位置index获取值
Value* getByIndices(const std::vector<Value *> &indices) const {
int index = 0;
// 计算偏移量
for (size_t i = 0; i < indices.size(); i++) {
index = dynamic_cast<ConstantValue *>(getDim(i))->getInt() * index +
dynamic_cast<ConstantValue *>(indices[i])->getInt();