llvm / clangir

A new (MLIR based) high-level IR for clang.
https://clangir.org
Other
312 stars 86 forks source link

[CIR][ThroughMLIR] Support lowering ptrStrideOp with loadOp or storeOp to memref #585

Closed ShivaChen closed 2 months ago

ShivaChen commented 2 months ago

This commit introduce CIRPtrStrideOpLowering to lower the following pattern to memref load or store.

Rewrite %0 = cir.cast(array_to_ptrdecay, %base) %1 = cir.ptr_stride(%0, %index) cir.load %1 To memref.load %base[%index]