From 2c18021a2b561589ff1ffba1afe2d4d0856c2b0f Mon Sep 17 00:00:00 2001 From: Mikhail Lychkov Date: Thu, 11 Mar 2021 15:03:40 +0300 Subject: [PATCH] Fix CUDA lit tests after pulldown from llorg 20 lit tests for CUDA are failed with the following assert: "clang-13: llvm/lib/Transforms/Utils/CloneFunction.cpp:152: void llvm::CloneFunctionInto(llvm::Function*, const llvm::Function*, llvm::ValueToValueMapTy&, llvm::CloneFunctionChangeType, llvm::SmallVectorImpl&, const char*, llvm::ClonedCodeInfo*, llvm::ValueMapTypeRemapper*, llvm::ValueMaterializer*) : Assertion `(NewFunc->getParent() == nullptr || NewFunc->getParent() != OldFunc->getParent()) && "Set SameModule to true if the new function is in the same module"' failed." Change CloneFunctionChangeType to pass those lit tests. Signed-off-by: Mikhail Lychkov --- llvm/lib/Target/NVPTX/SYCL/GlobalOffset.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/NVPTX/SYCL/GlobalOffset.cpp b/llvm/lib/Target/NVPTX/SYCL/GlobalOffset.cpp index f0689833a8306..9aa1f517ee5f2 100644 --- a/llvm/lib/Target/NVPTX/SYCL/GlobalOffset.cpp +++ b/llvm/lib/Target/NVPTX/SYCL/GlobalOffset.cpp @@ -276,7 +276,7 @@ class GlobalOffset : public ModulePass { SmallVector Returns; CloneFunctionInto(NewFunc, Func, VMap, - CloneFunctionChangeType::DifferentModule, Returns); + CloneFunctionChangeType::GlobalChanges, Returns); } else { NewFunc->copyAttributesFrom(Func); NewFunc->setComdat(Func->getComdat());