================
@@ -0,0 +1,121 @@
+//===- SPIRVLowerResourceNames.cpp - Lower resource names to metadata 
-----===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "SPIRV.h"
+#include "llvm/ADT/MapVector.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/Analysis/ValueTracking.h"
+#include "llvm/IR/Dominators.h"
+#include "llvm/IR/GlobalVariable.h"
+#include "llvm/IR/Instructions.h"
+#include "llvm/IR/IntrinsicInst.h"
+#include "llvm/IR/IntrinsicsSPIRV.h"
+#include "llvm/IR/Module.h"
+#include "llvm/Pass.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Transforms/Utils/PromoteMemToReg.h"
+
+using namespace llvm;
+
+#define DEBUG_TYPE "spirv-lower-resource-names"
+
+static void promoteNameAllocas(ArrayRef<CallInst *> Intrinsics) {
+  MapVector<Function *, SmallVector<AllocaInst *, 4>> Allocas;
+  SmallPtrSet<AllocaInst *, 8> Seen;
+  for (CallInst *CI : Intrinsics) {
+    auto *LI = dyn_cast<LoadInst>(CI->getArgOperand(4));
+    if (!LI)
+      continue;
+    auto *AI = cast<AllocaInst>(LI->getPointerOperand());
----------------
rj123-nv wrote:

done, thanks

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

Reply via email to