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 #584

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]

ShivaChen commented 2 months ago

I was rebasing to update the cir.const format changes in recent main branch. Perhaps I pushed the wrong button and it closed.