[llvm] [AMDGPU] Quit PromoteAllocaToVector if intrinsic is used (PR #68744)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 00:26:30 PDT 2023


================
@@ -771,7 +771,8 @@ bool AMDGPUPromoteAllocaImpl::tryPromoteAllocaToVector(AllocaInst &Alloca) {
     }
 
     // Ignore assume-like intrinsics and comparisons used in assumes.
-    if (isAssumeLikeIntrinsic(Inst)) {
+    // Make sure that intrinsics do not have any use like e.g. llvm.objectsize
+    if (isAssumeLikeIntrinsic(Inst) && Inst->use_empty()) {
----------------
Pierre-vh wrote:

Instead of this you should do 
```
if(isAssumeLikeIntrinsic(Inst)) {
  if(!Inst->use_empty()) {
        RejectUserr(Inst, "assume-like intrinsic cannot have any users");
        return false;
  }
```
To explicitly reject them IMO.

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


More information about the llvm-commits mailing list