[llvm] [SROA] Prevent load atomic vector from being generated (PR #112432)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 13:40:14 PDT 2024


================
@@ -2853,6 +2853,11 @@ class AllocaSliceRewriter : public InstVisitor<AllocaSliceRewriter, bool> {
 
   bool visitLoadInst(LoadInst &LI) {
     LLVM_DEBUG(dbgs() << "    original: " << LI << "\n");
+
+    // load atomic vector would be generated, which is illegal
+    if (LI.isAtomic() && NewAI.getAllocatedType()->isVectorTy())
----------------
jofrn wrote:

It looks like this is written [here](https://llvm.org/docs/LangRef.html#id211:~:text=results%20when%20they%20may%20see%20multiple%20atomic%20stores.-,The%20type%20of%20the%20pointee%20must%20be%20an%20integer%2C%20pointer%2C%20or%20floating%2Dpoint%20type%20whose%20bit%20width%20is%20a%20power%20of%20two%20greater%20than%20or%20equal%20to%20eight%20and%20less%20than%20or%20equal%20to%20a%20target%2Dspecific%20size%20limit.,-align%20must%20be%20explicitly%20specified%20on%20atomic%20loads).

https://github.com/llvm/llvm-project/pull/112432


More information about the llvm-commits mailing list