From 0c9c9ee76c6c1078c9f7fed80906e361e3909a1e Mon Sep 17 00:00:00 2001 From: hanhanW Date: Tue, 19 Dec 2023 19:01:06 +0000 Subject: [PATCH 1/2] Integrate llvm/llvm-project@282d50147628 (2023-12-19) --- externals/llvm-project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/externals/llvm-project b/externals/llvm-project index aa165edca854..282d50147628 160000 --- a/externals/llvm-project +++ b/externals/llvm-project @@ -1 +1 @@ -Subproject commit aa165edca8545b212de084d5b18c3d30347f774a +Subproject commit 282d501476284c46fd943dcbae87494cb08e2c5f From 4b8323757bd3973735136cd05cfbdb4b5a266939 Mon Sep 17 00:00:00 2001 From: hanhanW Date: Tue, 19 Dec 2023 19:02:42 +0000 Subject: [PATCH 2/2] fixes for endswith and startswith --- lib/Dialect/Torch/Transforms/ReduceOpVariants.cpp | 2 +- .../Torch/Transforms/ReifyAbstractInterpCalculationsUtils.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Dialect/Torch/Transforms/ReduceOpVariants.cpp b/lib/Dialect/Torch/Transforms/ReduceOpVariants.cpp index a4b02cf9e17f..8ba0479625d8 100644 --- a/lib/Dialect/Torch/Transforms/ReduceOpVariants.cpp +++ b/lib/Dialect/Torch/Transforms/ReduceOpVariants.cpp @@ -274,7 +274,7 @@ class ReduceTrailingUnderscoreInplaceVariant : public RewritePattern { SmallVector fragments; llvm::SplitString(op->getName().getStringRef(), fragments, "."); - assert(fragments.size() >= 3 && fragments[2].endswith("_") && + assert(fragments.size() >= 3 && fragments[2].ends_with("_") && "IsTrailingUnderscoreInplaceVariant incorrectly applied"); fragments[2] = fragments[2].drop_back(); std::string noUnderscoreName = llvm::join(fragments, "."); diff --git a/lib/Dialect/Torch/Transforms/ReifyAbstractInterpCalculationsUtils.cpp b/lib/Dialect/Torch/Transforms/ReifyAbstractInterpCalculationsUtils.cpp index 290beb1da7c9..7c3ceab3afec 100644 --- a/lib/Dialect/Torch/Transforms/ReifyAbstractInterpCalculationsUtils.cpp +++ b/lib/Dialect/Torch/Transforms/ReifyAbstractInterpCalculationsUtils.cpp @@ -78,7 +78,7 @@ LogicalResult Torch::wrapWithCalculateOpIfLibraryFunctionAvailable( // mechanically consistent with existing torch conventions of in-place vs. // out-of-place (value-semantic) variants), remove the prefix when // looking them up in the library. - if (name.startswith("valsem.")) + if (name.starts_with("valsem.")) name = name.drop_front(strlen("valsem.")); if (isa(op)) name = cast(op)->getAttr("name").cast().getValue();