[PATCH] D101562: [AMDGPU] Skip promote-alloca for insertelement/insertvalue users

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 29 12:17:54 PDT 2021


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:611
 
+    // Do not promote instructions of vector type. It is hard to track their
+    // users.
----------------
s/instructions of vector type/aggregate instructions/?


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp:613-614
+    // users.
+    if (isa<InsertValueInst>(User) || isa<InsertElementInst>(User))
+      return false;
+
----------------
I would move this below the other more common instruction cases


================
Comment at: llvm/test/CodeGen/AMDGPU/skip-promote-alloca-vector-users.ll:12
+  %in = insertelement <2 x i16*> undef, i16* %alloca, i32 0
+  store volatile <2 x i16*> %in, <2 x i16*>* undef, align 4
+  ret void
----------------
Don't use a volatile store, if we did analyze the users this would have been skipped anyway


================
Comment at: llvm/test/CodeGen/AMDGPU/skip-promote-alloca-vector-users.ll:23
+  %in = insertvalue { i16* } undef, i16* %alloca, 0
+  store volatile { i16* } %in, { i16* }* undef, align 4
+  ret void
----------------
Ditto


================
Comment at: llvm/test/CodeGen/AMDGPU/skip-promote-alloca-vector-users.ll:34
+  %in = insertvalue [2 x i16*] undef, i16* %alloca, 0
+  store volatile [2 x i16*] %in, [2 x i16*]* undef, align 4
+  ret void
----------------
Ditto


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101562/new/

https://reviews.llvm.org/D101562



More information about the llvm-commits mailing list