[PATCH] [RFC] __builtin___clear_cache support in LLVM

JF Bastien jfb at chromium.org
Fri Mar 14 15:21:44 PDT 2014


  I asked someone with more GPU knowledge than I have, and he came up with a potential case that is not a hack: textures. Texture memory is noncoherent by design, not by accident, and you need an explicit sort of fence to separate writes by any thread (even the current thread!) and reads by the current thread. So a “flush memory type X” operation, maybe even with directional types, could have a lasting value for texture memory.

  As a side-note, clear_cache is a "legacy" operation that doesn't neatly fit the C11/C++11 memory model. We had a discussion about similar things on the mailing list a while ago w.r.t. sync_synchronize:
    http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/thread.html#64462
  Jeffrey and Chandler had fairly strong opinions back then.

http://llvm-reviews.chandlerc.com/D3084



More information about the llvm-commits mailing list