================
@@ -2575,6 +2575,30 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src, 
LValue Dst,
                                              bool isInit) {
   if (!Dst.isSimple()) {
     if (Dst.isVectorElt()) {
+      if (getLangOpts().HLSL) {
+        // In HLSL, storing to individual elements of a vector through
+        // VectorElt LValue needs to be handled as separate store. We need to
+        // avoid the load/modify/store sequence to prevent overwriting other
+        // elements that might be getting updated in parallel.
----------------
bogner wrote:

The wording on this comment is a bit confusing in the way it talks about 
"avoiding RMW". Would it be better to just state that accesses to individual 
vector elements are modelled as such, and so we access them directly?

https://github.com/llvm/llvm-project/pull/169144
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to