================ @@ -5021,6 +5024,36 @@ bool llvm::UpgradeDebugInfo(Module &M) { return Modified; } +static void upgradeNVVMFnVectorAttr(const StringRef Attr, const char DimC, + GlobalValue *GV, const Metadata *V) { + Function *F = cast<Function>(GV); + + constexpr StringLiteral DefaultValue = "1"; + StringRef Vect3[3] = {DefaultValue, DefaultValue, DefaultValue}; + unsigned Length = 0; + + if (F->hasFnAttribute(Attr)) { + StringRef S = F->getFnAttribute(Attr).getValueAsString(); + for (; Length < 3 && !S.empty(); Length++) { + auto [Part, Rest] = S.split(','); + Vect3[Length] = Part.trim(); + S = Rest; + } + } ---------------- Artem-B wrote:
This could use a comment explaining what is the expected input format for what we're parsing here. https://github.com/llvm/llvm-project/pull/127736 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits