take gep 0 as pass through for statistic purposes
MODIFY
ir/instr.cpp
ir/instr.cpp
@@ -2894,9 +2894,11 @@ const ConversionOp *isCast(ConversionOp::Op op, const Value &v) {
Value* isNoOp(const Value &v) {
if (isCast(ConversionOp::BitCast, v))
- return &dynamic_cast<const ConversionOp *>(&v)->getValue();
+ return &static_cast<const ConversionOp*>(&v)->getValue();
+
+ if (auto gep = dynamic_cast<const GEP*>(&v))
+ return gep->getMaxGEPOffset() == 0 ? &gep->getPtr() : nullptr;
- // TODO: gep ptr, 0
return nullptr;
}
}

take gep 0 as pass through for statistic purposes