[PATCH] D79272: [mlir][StandardToSPIRV] Emulate bitwidths not supported for store op.

Han-Chung Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 17:18:07 PDT 2020


hanchung created this revision.
hanchung added reviewers: antiagainst, denis13, mravishankar.
Herald added subscribers: llvm-commits, Kayjukh, frgossen, grosul1, bader, Joonsoo, liufengdb, lucyrfox, mgester, arpith-jacob, nicolasvasilache, shauheen, jpienaar, rriddle, mehdi_amini, jfb.
Herald added a project: LLVM.

As D78974 <https://reviews.llvm.org/D78974>, this patch implements the emulation for store op. The emulation is
done with atomic operations. E.g., if the storing value is i8, rewrite the
StoreOp to:

1. load a 32-bit integer
2. clear 8 bits in the loading value
3. store 32-bit value back
4. load a 32-bit integer
5. modify 8 bits in the loading value
6. store 32-bit value back

The step 1 to step 3 are done by AtomicAnd, and the step 4 to step 6 are done
by AtomicOr.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79272

Files:
  mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
  mlir/test/Conversion/StandardToSPIRV/std-ops-to-spirv.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79272.261565.patch
Type: text/x-patch
Size: 11874 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200502/141e7ec8/attachment-0001.bin>


More information about the llvm-commits mailing list