diff --git a/interpreter/llvm-project/llvm/lib/Support/CommandLine.cpp b/interpreter/llvm-project/llvm/lib/Support/CommandLine.cpp index 4ae3ad4c24535..64fc199377518 100644 --- a/interpreter/llvm-project/llvm/lib/Support/CommandLine.cpp +++ b/interpreter/llvm-project/llvm/lib/Support/CommandLine.cpp @@ -729,6 +729,9 @@ static Option *getOptionPred(StringRef Name, size_t &Length, // string. while (OMI == OptionsMap.end() && Name.size() > 1) { Name = Name.substr(0, Name.size() - 1); // Chop off the last character. +#ifdef __NVCOMPILER + nulls() << "asdf" << Name; // nvc++ workaround to prevent optimizer bug +#endif OMI = OptionsMap.find(Name); if (OMI != OptionsMap.end() && !Pred(OMI->getValue())) OMI = OptionsMap.end(); diff --git a/interpreter/llvm-project/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/interpreter/llvm-project/llvm/utils/TableGen/AsmMatcherEmitter.cpp index 00bdd127e3c28..f14e12e7444af 100644 --- a/interpreter/llvm-project/llvm/utils/TableGen/AsmMatcherEmitter.cpp +++ b/interpreter/llvm-project/llvm/utils/TableGen/AsmMatcherEmitter.cpp @@ -586,6 +586,9 @@ struct MatchableInfo { /// suboperand index. int findAsmOperand(StringRef N, int SubOpIdx) const { auto I = find_if(AsmOperands, [&](const AsmOperand &Op) { +#ifdef __NVCOMPILER + nulls() << Op.SrcOpName << " " << N << "\n"; // nvc++ workaround to prevent optimizer bug +#endif return Op.SrcOpName == N && Op.SubOpIdx == SubOpIdx; }); return (I != AsmOperands.end()) ? I - AsmOperands.begin() : -1; @@ -595,14 +598,24 @@ struct MatchableInfo { /// This does not check the suboperand index. int findAsmOperandNamed(StringRef N, int LastIdx = -1) const { auto I = std::find_if(AsmOperands.begin() + LastIdx + 1, AsmOperands.end(), - [&](const AsmOperand &Op) { return Op.SrcOpName == N; }); + [&](const AsmOperand &Op) { +#ifdef __NVCOMPILER + nulls() << Op.SrcOpName << " " << N << "\n"; // nvc++ workaround to prevent optimizer bug +#endif + return Op.SrcOpName == N; + }); return (I != AsmOperands.end()) ? I - AsmOperands.begin() : -1; } int findAsmOperandOriginallyNamed(StringRef N) const { auto I = find_if(AsmOperands, - [&](const AsmOperand &Op) { return Op.OrigSrcOpName == N; }); + [&](const AsmOperand &Op) { +#ifdef __NVCOMPILER + nulls() << Op.OrigSrcOpName << " " << N << "\n"; // nvc++ workaround to prevent optimizer bug +#endif + return Op.OrigSrcOpName == N; + }); return (I != AsmOperands.end()) ? I - AsmOperands.begin() : -1; }