[llvm-branch-commits] [llvm] 8b51e5e - [NewPM][Inliner] Make inlined calls to functions in same SCC as callee exponentially expensive
Author: Arthur Eubanks
Date: 2022-03-08T17:12:22-08:00
New Revision: 8b51e5ee0a2e6a38886e7ededd3267443cb99f1e
URL:
https://github.com/llvm/llvm-project/commit/8b51e5ee0a2e6a38886e7ededd3267443cb99f1e
DIFF:
https://github.com/llvm/llvm-project/commit/8b51e5ee0a2e6a38886e7ededd3267443cb99f1e.diff
LOG: [NewPM][Inliner] Make inlined calls to functions in same SCC as callee
exponentially expensive
Introduce a new attribute "function-inline-cost-multiplier" which
multiplies the inline cost of a call site (or all calls to a callee) by
the multiplier.
When processing the list of calls created by inlining, check each call
to see if the new call's callee is in the same SCC as the original
callee. If so, set the "function-inline-cost-multiplier" attribute of
the new call site to double the original call site's attribute value.
This does not happen when the original call site is intra-SCC.
This is an alternative to D120584, which marks the call sites as
noinline.
Hopefully fixes PR45253.
Reviewed By: davidxl
Differential Revision: https://reviews.llvm.org/D121084
(cherry picked from commit 53e5e586709a329370ea268a8e8191b16fd641b7)
Added:
llvm/test/Transforms/Inline/mut-rec-scc-2.ll
llvm/test/Transforms/Inline/mut-rec-scc.ll
Modified:
llvm/include/llvm/Analysis/InlineCost.h
llvm/lib/Analysis/InlineCost.cpp
llvm/lib/Transforms/IPO/Inliner.cpp
llvm/test/Transforms/Inline/inline-cost-attributes.ll
Removed:
diff --git a/llvm/include/llvm/Analysis/InlineCost.h
b/llvm/include/llvm/Analysis/InlineCost.h
index f86ee5a148749..d3fa3b879125f 100644
--- a/llvm/include/llvm/Analysis/InlineCost.h
+++ b/llvm/include/llvm/Analysis/InlineCost.h
@@ -52,6 +52,9 @@ const unsigned TotalAllocaSizeRecursiveCaller = 1024;
/// Do not inline dynamic allocas that have been constant propagated to be
/// static allocas above this amount in bytes.
const uint64_t MaxSimplifiedDynamicAllocaToInline = 65536;
+
+const char FunctionInlineCostMultiplierAttributeName[] =
+"function-inline-cost-multiplier";
} // namespace InlineConstants
// The cost-benefit pair computed by cost-benefit analysis.
@@ -217,6 +220,8 @@ struct InlineParams {
Optional AllowRecursiveCall = false;
};
+Optional getStringFnAttrAsInt(CallBase &CB, StringRef AttrKind);
+
/// Generate the parameters to tune the inline cost analysis based only on the
/// commandline options.
InlineParams getInlineParams();
diff --git a/llvm/lib/Analysis/InlineCost.cpp
b/llvm/lib/Analysis/InlineCost.cpp
index d5411d916c777..cd5314e7a17a1 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -133,8 +133,6 @@ static cl::opt DisableGEPConstOperand(
cl::desc("Disables evaluation of GetElementPtr with constant operands"));
namespace {
-class InlineCostCallAnalyzer;
-
/// This function behaves more like CallBase::hasFnAttr: when it looks for the
/// requested attribute, it check both the call instruction and the called
/// function (if it's available and operand bundles don't prohibit that).
@@ -151,7 +149,9 @@ Attribute getFnAttr(CallBase &CB, StringRef AttrKind) {
return {};
}
+} // namespace
+namespace llvm {
Optional getStringFnAttrAsInt(CallBase &CB, StringRef AttrKind) {
Attribute Attr = getFnAttr(CB, AttrKind);
int AttrValue;
@@ -159,6 +159,10 @@ Optional getStringFnAttrAsInt(CallBase &CB, StringRef
AttrKind) {
return None;
return AttrValue;
}
+} // namespace llvm
+
+namespace {
+class InlineCostCallAnalyzer;
// This struct is used to store information about inline cost of a
// particular instruction
@@ -904,6 +908,11 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
getStringFnAttrAsInt(CandidateCall, "function-inline-cost"))
Cost = *AttrCost;
+if (Optional AttrCostMult = getStringFnAttrAsInt(
+CandidateCall,
+InlineConstants::FunctionInlineCostMultiplierAttributeName))
+ Cost *= *AttrCostMult;
+
if (Optional AttrThreshold =
getStringFnAttrAsInt(CandidateCall, "function-inline-threshold"))
Threshold = *AttrThreshold;
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp
b/llvm/lib/Transforms/IPO/Inliner.cpp
index 49babc24cb82c..10abea7ebd321 100644
--- a/llvm/lib/Transforms/IPO/Inliner.cpp
+++ b/llvm/lib/Transforms/IPO/Inliner.cpp
@@ -22,6 +22,7 @@
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/BasicAliasAnalysis.h"
@@ -92,6 +93,18 @@ static cl::opt
DisableInlinedAllocaMerging("disable-inlined-alloca-merging",
cl::init(false), cl::Hidden);
+static cl::opt IntraSCCCostMultiplier(
+"intra-scc-cost-multiplier", cl::init(2), cl::Hidden,
+cl::desc(
+
[llvm-branch-commits] [llvm] da3953f - [NFC][PhaseOrdering] Add some tests from D119839
Author: Andrew Wei
Date: 2022-03-08T19:22:12-08:00
New Revision: da3953fb0315c0e65cc12479f3cd56a1dad7bc3f
URL:
https://github.com/llvm/llvm-project/commit/da3953fb0315c0e65cc12479f3cd56a1dad7bc3f
DIFF:
https://github.com/llvm/llvm-project/commit/da3953fb0315c0e65cc12479f3cd56a1dad7bc3f.diff
LOG: [NFC][PhaseOrdering] Add some tests from D119839
Based on original tests from D119839.
See https://github.com/llvm/llvm-project/issues/53853
Added:
llvm/test/Transforms/PhaseOrdering/simplifycfg-switch-lowering-vs-correlatedpropagation.ll
Modified:
Removed:
diff --git
a/llvm/test/Transforms/PhaseOrdering/simplifycfg-switch-lowering-vs-correlatedpropagation.ll
b/llvm/test/Transforms/PhaseOrdering/simplifycfg-switch-lowering-vs-correlatedpropagation.ll
new file mode 100644
index 0..4e1863304e6ba
--- /dev/null
+++
b/llvm/test/Transforms/PhaseOrdering/simplifycfg-switch-lowering-vs-correlatedpropagation.ll
@@ -0,0 +1,143 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -O1 -S < %s -enable-new-pm=0 | FileCheck %s
+; RUN: opt -O2 -S < %s -enable-new-pm=0 | FileCheck %s
+; RUN: opt -O3 -S < %s -enable-new-pm=0 | FileCheck %s
+; RUN: opt -passes='default' -S < %s | FileCheck %s
+; RUN: opt -passes='default' -S < %s | FileCheck %s
+; RUN: opt -passes='default' -S < %s | FileCheck %s
+
+; We are worse at propagating correlation facts when in select form
+; as compared to the PHI form, so if we lower switches to early,
+; we may make further optimizations problematic.
+
+; propagate value to bb2.
+define i64 @test1(i64 %x) {
+; CHECK-LABEL: @test1(
+; CHECK-NEXT: entry:
+; CHECK-NEXT:[[SWITCH:%.*]] = icmp eq i64 [[X:%.*]], 0
+; CHECK-NEXT:[[TMP0:%.*]] = icmp eq i64 [[X]], 100
+; CHECK-NEXT:[[DOT:%.*]] = select i1 [[TMP0]], i64 200, i64 10
+; CHECK-NEXT:[[COMMON_RET_OP:%.*]] = select i1 [[SWITCH]], i64 0, i64
[[DOT]]
+; CHECK-NEXT:ret i64 [[COMMON_RET_OP]]
+;
+entry:
+ switch i64 %x, label %bb3 [
+ i64 0, label %bb1
+ i64 1, label %bb2
+ ]
+bb1:
+ ret i64 0
+bb2:
+ %0 = icmp eq i64 %x, 100
+ br i1 %0, label %bb4, label %bb5
+bb3:
+ unreachable
+bb4:
+ ret i64 200
+bb5:
+ ret i64 10
+}
+
+; propagate value both to bb1 and bb2.
+define i64 @test2(i64 %x) {
+; CHECK-LABEL: @test2(
+; CHECK-NEXT: entry:
+; CHECK-NEXT:[[SWITCH_SELECTCMP:%.*]] = icmp eq i64 [[X:%.*]], 101
+; CHECK-NEXT:[[SWITCH_SELECT:%.*]] = select i1 [[SWITCH_SELECTCMP]], i64
200, i64 10
+; CHECK-NEXT:[[SWITCH_SELECTCMP1:%.*]] = icmp eq i64 [[X]], 1
+; CHECK-NEXT:[[SWITCH_SELECT2:%.*]] = select i1 [[SWITCH_SELECTCMP1]], i64
0, i64 [[SWITCH_SELECT]]
+; CHECK-NEXT:ret i64 [[SWITCH_SELECT2]]
+;
+entry:
+ switch i64 %x, label %bb3 [
+ i64 1, label %bb1
+ i64 2, label %bb2
+ ]
+bb1:
+ %0 = icmp eq i64 %x, 100
+ br i1 %0, label %bb4, label %return
+return:
+ ret i64 0
+bb2:
+ %1 = icmp eq i64 %x, 101
+ br i1 %1, label %bb4, label %bb5
+bb3:
+ unreachable
+bb4:
+ ret i64 200
+bb5:
+ ret i64 10
+}
+
+define i64 @test3(i64 %x) {
+; CHECK-LABEL: @test3(
+; CHECK-NEXT: entry:
+; CHECK-NEXT:[[COND:%.*]] = icmp eq i64 [[X:%.*]], 1
+; CHECK-NEXT:[[SPEC_SELECT:%.*]] = select i1 [[COND]], i64 10, i64 0
+; CHECK-NEXT:ret i64 [[SPEC_SELECT]]
+;
+entry:
+ switch i64 %x, label %bb1 [
+ i64 1, label %bb2
+ ]
+bb1:
+ ret i64 0
+bb2:
+ %0 = icmp eq i64 %x, 100
+ br i1 %0, label %bb4, label %bb5
+bb4:
+ ret i64 200
+bb5:
+ ret i64 10
+}
+
+; bb2 has two predecessors with case value 1 and 2.
+define i64 @test_fail1(i64 %x) {
+; CHECK-LABEL: @test_fail1(
+; CHECK-NEXT: entry:
+; CHECK-NEXT:[[SWITCH:%.*]] = icmp eq i64 [[X:%.*]], 0
+; CHECK-NEXT:[[TMP0:%.*]] = icmp eq i64 [[X]], 100
+; CHECK-NEXT:[[DOT:%.*]] = select i1 [[TMP0]], i64 200, i64 10
+; CHECK-NEXT:[[COMMON_RET_OP:%.*]] = select i1 [[SWITCH]], i64 0, i64
[[DOT]]
+; CHECK-NEXT:ret i64 [[COMMON_RET_OP]]
+;
+entry:
+ switch i64 %x, label %bb3 [
+ i64 0, label %bb1
+ i64 1, label %bb2
+ i64 2, label %bb2
+ ]
+bb1:
+ ret i64 0
+bb2:
+ %0 = icmp eq i64 %x, 100
+ br i1 %0, label %bb4, label %bb5
+bb3:
+ unreachable
+bb4:
+ ret i64 200
+bb5:
+ ret i64 10
+}
+
+; return block has two predecessors.
+define i64 @test_fail2(i64 %x) {
+; CHECK-LABEL: @test_fail2(
+; CHECK-NEXT: entry:
+; CHECK-NEXT:[[SWITCH:%.*]] = icmp eq i64 [[X:%.*]], 0
+; CHECK-NEXT:[[SPEC_SELECT:%.*]] = select i1 [[SWITCH]], i64 2, i64 [[X]]
+; CHECK-NEXT:ret i64 [[SPEC_SELECT]]
+;
+entry:
+ switch i64 %x, label %bb2 [
+ i64 0, label %bb1
+ i64 1, label %return
+ ]
+bb1:
+ br label %return
+return:
+ %retval.0 = phi i64 [ %x, %entry ], [ 2, %bb1 ]
+ ret i64 %retval.0
+bb2:
+ unreachable
+}
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm
[llvm-branch-commits] [llvm] ba9ff03 - [SimplifyCFG][PhaseOrdering] Defer lowering switch into an integer range comparison and branch until after at least the IPSCCP
Author: Roman Lebedev
Date: 2022-03-08T19:22:12-08:00
New Revision: ba9ff030d302910e0d2155536558f71da98d5a5a
URL:
https://github.com/llvm/llvm-project/commit/ba9ff030d302910e0d2155536558f71da98d5a5a
DIFF:
https://github.com/llvm/llvm-project/commit/ba9ff030d302910e0d2155536558f71da98d5a5a.diff
LOG: [SimplifyCFG][PhaseOrdering] Defer lowering switch into an integer range
comparison and branch until after at least the IPSCCP
That transformation is lossy, as discussed in
https://github.com/llvm/llvm-project/issues/53853
and https://github.com/rust-lang/rust/issues/85133#issuecomment-904185574
This is an alternative to D119839,
which would add a limited IPSCCP into SimplifyCFG.
Unlike lowering switch to lookup, we still want this transformation
to happen relatively early, but after giving a chance for the things
like CVP to do their thing. It seems like deferring it just until
the IPSCCP is enough for the tests at hand, but perhaps we need to
be more aggressive and disable it until CVP.
Fixes https://github.com/llvm/llvm-project/issues/53853
Refs. https://github.com/rust-lang/rust/issues/85133
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D119854
Added:
Modified:
llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Passes/PassBuilderPipelines.cpp
llvm/lib/Passes/PassRegistry.def
llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Other/new-pm-print-pipeline.ll
llvm/test/Transforms/Coroutines/coro-catchswitch-cleanuppad.ll
llvm/test/Transforms/LoopUnroll/ARM/upperbound.ll
llvm/test/Transforms/PhaseOrdering/simplifycfg-switch-lowering-vs-correlatedpropagation.ll
llvm/test/Transforms/SimplifyCFG/DeadSetCC.ll
llvm/test/Transforms/SimplifyCFG/EqualPHIEdgeBlockMerge.ll
llvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-no-new-successors.ll
llvm/test/Transforms/SimplifyCFG/ForwardSwitchConditionToPHI.ll
llvm/test/Transforms/SimplifyCFG/preserve-branchweights.ll
llvm/test/Transforms/SimplifyCFG/switch-dead-default.ll
llvm/test/Transforms/SimplifyCFG/switch-range-to-icmp.ll
llvm/test/Transforms/SimplifyCFG/switch-to-icmp.ll
llvm/test/Transforms/SimplifyCFG/switch_create-custom-dl.ll
llvm/test/Transforms/SimplifyCFG/switch_create.ll
Removed:
diff --git a/llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h
b/llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h
index fb3a7490346f4..7af879638a4d8 100644
--- a/llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h
+++ b/llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h
@@ -23,6 +23,7 @@ class AssumptionCache;
struct SimplifyCFGOptions {
int BonusInstThreshold = 1;
bool ForwardSwitchCondToPhi = false;
+ bool ConvertSwitchRangeToICmp = false;
bool ConvertSwitchToLookupTable = false;
bool NeedCanonicalLoop = true;
bool HoistCommonInsts = false;
@@ -41,6 +42,10 @@ struct SimplifyCFGOptions {
ForwardSwitchCondToPhi = B;
return *this;
}
+ SimplifyCFGOptions &convertSwitchRangeToICmp(bool B) {
+ConvertSwitchRangeToICmp = B;
+return *this;
+ }
SimplifyCFGOptions &convertSwitchToLookupTable(bool B) {
ConvertSwitchToLookupTable = B;
return *this;
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 015ca1eec4df3..dedfc81f11bba 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -679,6 +679,8 @@ Expected
parseSimplifyCFGOptions(StringRef Params) {
bool Enable = !ParamName.consume_front("no-");
if (ParamName == "forward-switch-cond") {
Result.forwardSwitchCondToPhi(Enable);
+} else if (ParamName == "switch-range-to-icmp") {
+ Result.convertSwitchRangeToICmp(Enable);
} else if (ParamName == "switch-to-lookup") {
Result.convertSwitchToLookupTable(Enable);
} else if (ParamName == "keep-loops") {
diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp
b/llvm/lib/Passes/PassBuilderPipelines.cpp
index 194bff054fd72..e838665eb9ce9 100644
--- a/llvm/lib/Passes/PassBuilderPipelines.cpp
+++ b/llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -259,14 +259,16 @@
PassBuilder::buildO1FunctionSimplificationPipeline(OptimizationLevel Level,
FPM.addPass(EarlyCSEPass(true /* Enable mem-ssa. */));
// Hoisting of scalars and load expressions.
- FPM.addPass(SimplifyCFGPass());
+ FPM.addPass(
+ SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(true)));
FPM.addPass(InstCombinePass());
FPM.addPass(LibCallsShrinkWrapPass());
invokePeepholeEPCallbacks(FPM, Level);
- FPM.addPass(SimplifyCFGPass());
+ FPM.addPass(
+ Simp
[llvm-branch-commits] [clang] d843bde - [clang][driver] Fix float128 diagnostics with glibc >= 2.32
Author: Timm Bäder Date: 2022-03-08T19:22:37-08:00 New Revision: d843bde69aab7fbb3efff34229e8876b1ce80a5b URL: https://github.com/llvm/llvm-project/commit/d843bde69aab7fbb3efff34229e8876b1ce80a5b DIFF: https://github.com/llvm/llvm-project/commit/d843bde69aab7fbb3efff34229e8876b1ce80a5b.diff LOG: [clang][driver] Fix float128 diagnostics with glibc >= 2.32 Fix checking for an unsupported stdlib++. Differential Revision: https://reviews.llvm.org/D121209 (cherry picked from commit 5b7941ad7c893b4bb019e3c96b760b0f2670ccfc) Added: Modified: clang/lib/Driver/ToolChains/PPCLinux.cpp Removed: diff --git a/clang/lib/Driver/ToolChains/PPCLinux.cpp b/clang/lib/Driver/ToolChains/PPCLinux.cpp index e480d8bd8703c..2fea262fd109c 100644 --- a/clang/lib/Driver/ToolChains/PPCLinux.cpp +++ b/clang/lib/Driver/ToolChains/PPCLinux.cpp @@ -76,9 +76,11 @@ bool PPCLinuxToolChain::SupportIEEEFloat128( if (Args.hasArg(options::OPT_nostdlib, options::OPT_nostdlibxx)) return true; + CXXStdlibType StdLib = ToolChain::GetCXXStdlibType(Args); bool HasUnsupportedCXXLib = - ToolChain::GetCXXStdlibType(Args) == CST_Libcxx && - GCCInstallation.getVersion().isOlderThan(12, 1, 0); + StdLib == CST_Libcxx || + (StdLib == CST_Libstdcxx && + GCCInstallation.getVersion().isOlderThan(12, 1, 0)); return GlibcSupportsFloat128(Linux::getDynamicLinker(Args)) && !(D.CCCIsCXX() && HasUnsupportedCXXLib); ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] eb84577 - Revert "[release] Use the Bootstrapping build for building LLVM releases"
Author: Louis Dionne
Date: 2022-03-08T20:35:54-08:00
New Revision: eb84577cbc23d44735f10bca9dbd2151aba96a60
URL:
https://github.com/llvm/llvm-project/commit/eb84577cbc23d44735f10bca9dbd2151aba96a60
DIFF:
https://github.com/llvm/llvm-project/commit/eb84577cbc23d44735f10bca9dbd2151aba96a60.diff
LOG: Revert "[release] Use the Bootstrapping build for building LLVM releases"
This reverts commit c8bb1777fff5d1ae28a2deac0d6677e081d4200f to fix
https://github.com/llvm/llvm-project/issues/54154 on the release branch.
Differential Revision: https://reviews.llvm.org/D121258
Added:
Modified:
llvm/utils/release/test-release.sh
Removed:
diff --git a/llvm/utils/release/test-release.sh
b/llvm/utils/release/test-release.sh
index 009f9358145f3..e27e857935376 100755
--- a/llvm/utils/release/test-release.sh
+++ b/llvm/utils/release/test-release.sh
@@ -244,17 +244,16 @@ projects="llvm clang"
if [ $do_clang_tools = "yes" ]; then
projects="$projects clang-tools-extra"
fi
-runtimes=""
if [ $do_rt = "yes" ]; then
- runtimes="$runtimes compiler-rt"
+ projects="$projects compiler-rt"
fi
if [ $do_libs = "yes" ]; then
- runtimes="$runtimes libcxx"
+ projects="$projects libcxx"
if [ $do_libcxxabi = "yes" ]; then
-runtimes="$runtimes libcxxabi"
+projects="$projects libcxxabi"
fi
if [ $do_libunwind = "yes" ]; then
-runtimes="$runtimes libunwind"
+projects="$projects libunwind"
fi
fi
if [ $do_openmp = "yes" ]; then
@@ -381,7 +380,6 @@ function configure_llvmCore() {
esac
project_list=${projects// /;}
-runtime_list=${runtimes// /;}
echo "# Using C compiler: $c_compiler"
echo "# Using C++ compiler: $cxx_compiler"
@@ -394,7 +392,6 @@ function configure_llvmCore() {
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DLLVM_ENABLE_PROJECTS="$project_list" \
-DLLVM_LIT_ARGS="-j $NumJobs" \
--DLLVM_ENABLE_RUNTIMES="$runtime_list" \
$ExtraConfigureFlags $BuildDir/llvm-project/llvm \
2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
env CC="$c_compiler" CXX="$cxx_compiler" \
@@ -403,7 +400,6 @@ function configure_llvmCore() {
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DLLVM_ENABLE_PROJECTS="$project_list" \
-DLLVM_LIT_ARGS="-j $NumJobs" \
--DLLVM_ENABLE_RUNTIMES="$runtime_list" \
$ExtraConfigureFlags $BuildDir/llvm-project/llvm \
2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] f7007c5 - Lambdas are not necessarily locals. This resolves DR48250.
Author: David Stone
Date: 2022-03-08T20:41:20-08:00
New Revision: f7007c570a216c0fa87b863733a1011bdb2ff9ca
URL:
https://github.com/llvm/llvm-project/commit/f7007c570a216c0fa87b863733a1011bdb2ff9ca
DIFF:
https://github.com/llvm/llvm-project/commit/f7007c570a216c0fa87b863733a1011bdb2ff9ca.diff
LOG: Lambdas are not necessarily locals. This resolves DR48250.
Differential Revision: https://reviews.llvm.org/D99134
(cherry picked from commit 0bff3a965022647fcdd17cc8f2217f5a2cd30b4c)
Added:
Modified:
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/test/SemaCXX/lambdas-implicit-explicit-template.cpp
Removed:
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 1da0dfec3f230..467372c71496a 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -6012,7 +6012,9 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc,
NamedDecl *D,
(ParentDependsOnArgs && (ParentDC->isFunctionOrMethod() ||
isa(ParentDC) ||
isa(ParentDC))) ||
- (isa(D) && cast(D)->isLambda())) {
+ (isa(D) && cast(D)->isLambda() &&
+ cast(D)->getTemplateDepth() >
+ TemplateArgs.getNumRetainedOuterLevels())) {
// D is a local of some kind. Look into the map of local
// declarations to their instantiations.
if (CurrentInstantiationScope) {
diff --git a/clang/test/SemaCXX/lambdas-implicit-explicit-template.cpp
b/clang/test/SemaCXX/lambdas-implicit-explicit-template.cpp
index 13fe12abe9e9d..a5410d2aed597 100644
--- a/clang/test/SemaCXX/lambdas-implicit-explicit-template.cpp
+++ b/clang/test/SemaCXX/lambdas-implicit-explicit-template.cpp
@@ -39,3 +39,13 @@ void c2() {
const auto lambda = [&](auto arg1) {};
[&](auto arg2) { lambda.operator()(arg2); }(0);
}
+
+auto d = [](auto) {};
+
+template
+void d1(T x) { d.operator()(x); }
+
+void d2() { d1(0); }
+
+template int e1 = [](auto){ return T(); }.operator()(T());
+int e2 = e1;
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] 569b773 - [libcxx][CI] Set Arm triples to match native clang build's default
Author: David Spickett
Date: 2022-03-08T20:43:33-08:00
New Revision: 569b773323a3a1c174ae794741c7e1191f8deefc
URL:
https://github.com/llvm/llvm-project/commit/569b773323a3a1c174ae794741c7e1191f8deefc
DIFF:
https://github.com/llvm/llvm-project/commit/569b773323a3a1c174ae794741c7e1191f8deefc.diff
LOG: [libcxx][CI] Set Arm triples to match native clang build's default
We were using:
armv8-linux-gnueabihf
But for a native clang build the default target is:
armv8l-linux-gnueabihf
(ditto for v7)
Add the "l" to the target triples and update the one test
that is unsupported to look for the various possible names.
armv(7 or 8)(m or l, optionally)
The UNSUPPORTED does not include aarch64 because aarch64 Linux
(and others that follow Arm's AAPCS64) use quad precision for
long double where arm64 (darwin) does not:
https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms
https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#811arithmetic-types
Reviewed By: rovka
Differential Revision: https://reviews.llvm.org/D119948
Added:
Modified:
libcxx/cmake/caches/Armv7Arm.cmake
libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake
libcxx/cmake/caches/Armv8Arm.cmake
libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake
libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp
Removed:
diff --git a/libcxx/cmake/caches/Armv7Arm.cmake
b/libcxx/cmake/caches/Armv7Arm.cmake
index 8b2b54eba13ce..0e9dc10e9d41f 100644
--- a/libcxx/cmake/caches/Armv7Arm.cmake
+++ b/libcxx/cmake/caches/Armv7Arm.cmake
@@ -1,4 +1,4 @@
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
-set(LIBCXX_TARGET_TRIPLE "armv7-linux-gnueabihf" CACHE STRING "")
+set(LIBCXX_TARGET_TRIPLE "armv7l-linux-gnueabihf" CACHE STRING "")
set(CMAKE_CXX_FLAGS "-marm" CACHE STRING "")
set(CMAKE_C_FLAGS "-marm" CACHE STRING "")
diff --git a/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake
b/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake
index 67ec43b93f207..61cd3bf7376ea 100644
--- a/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake
+++ b/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake
@@ -1,5 +1,5 @@
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
-set(LIBCXX_TARGET_TRIPLE "armv7-linux-gnueabihf" CACHE STRING "")
+set(LIBCXX_TARGET_TRIPLE "armv7l-linux-gnueabihf" CACHE STRING "")
set(CMAKE_CXX_FLAGS "-mthumb" CACHE STRING "")
set(CMAKE_C_FLAGS "-mthumb" CACHE STRING "")
set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
diff --git a/libcxx/cmake/caches/Armv8Arm.cmake
b/libcxx/cmake/caches/Armv8Arm.cmake
index 55dfa908b3d01..eee2eb46da56d 100644
--- a/libcxx/cmake/caches/Armv8Arm.cmake
+++ b/libcxx/cmake/caches/Armv8Arm.cmake
@@ -1,4 +1,4 @@
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
-set(LIBCXX_TARGET_TRIPLE "armv8-linux-gnueabihf" CACHE STRING "")
+set(LIBCXX_TARGET_TRIPLE "armv8l-linux-gnueabihf" CACHE STRING "")
set(CMAKE_CXX_FLAGS "-marm" CACHE STRING "")
set(CMAKE_C_FLAGS "-marm" CACHE STRING "")
diff --git a/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake
b/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake
index fb1d10efaddce..9c2f90661ef8d 100644
--- a/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake
+++ b/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake
@@ -1,5 +1,5 @@
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
-set(LIBCXX_TARGET_TRIPLE "armv8-linux-gnueabihf" CACHE STRING "")
+set(LIBCXX_TARGET_TRIPLE "armv8l-linux-gnueabihf" CACHE STRING "")
set(CMAKE_CXX_FLAGS "-mthumb" CACHE STRING "")
set(CMAKE_C_FLAGS "-mthumb" CACHE STRING "")
set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
diff --git
a/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp
b/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp
index b35a50e0a5894..3d777d9d81b60 100644
---
a/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp
+++
b/libcxx/test/std/language.support/cmp/cmp.alg/strong_order_long_double.verify.cpp
@@ -10,7 +10,8 @@
// UNSUPPORTED: libcpp-no-concepts
// The following platforms have sizeof(long double) == sizeof(double), so this
test doesn't apply to them.
-// UNSUPPORTED: target={{arm64|armv8|armv7|armv7m|powerpc|powerpc64}}-{{.+}}
+// This test does apply to aarch64 where Arm's AAPCS64 is followed. There they
are
diff erent sizes.
+// UNSUPPORTED: target={{arm64|armv(7|8)(l|m)?|powerpc|powerpc64}}-{{.+}}
// UNSUPPORTED: target=x86_64-pc-windows-{{.+}}
//
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxxabi] e879b2b - [libcxxabi] [test] Depend on unwind only if available
Author: Michał Górny Date: 2022-03-08T21:33:47-08:00 New Revision: e879b2bf82ef2d096d2c0e5147ebac541a7b8828 URL: https://github.com/llvm/llvm-project/commit/e879b2bf82ef2d096d2c0e5147ebac541a7b8828 DIFF: https://github.com/llvm/llvm-project/commit/e879b2bf82ef2d096d2c0e5147ebac541a7b8828.diff LOG: [libcxxabi] [test] Depend on unwind only if available When building libcxxabi via LLVM_ENABLE_RUNTIMES=libcxxabi the CMake invocation fails because of missing "unwind" target. However, if the extraneous dependency is removed, the library builds just fine against installed libunwind and tests work fine. To fix this, add the dependency only if the target actually exists. Differential Revision: https://reviews.llvm.org/D119538 (cherry picked from commit 5244ef0faf5595495c1adedfa16c346d35caebdf) Added: Modified: libcxxabi/test/CMakeLists.txt Removed: diff --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt index 6baaf40ca7b11..57b5fccab8008 100644 --- a/libcxxabi/test/CMakeLists.txt +++ b/libcxxabi/test/CMakeLists.txt @@ -63,7 +63,7 @@ endif() if (NOT LIBCXXABI_STANDALONE_BUILD) list(APPEND LIBCXXABI_TEST_DEPS cxx) - if (LIBCXXABI_USE_LLVM_UNWINDER) + if (LIBCXXABI_USE_LLVM_UNWINDER AND TARGET unwind) list(APPEND LIBCXXABI_TEST_DEPS unwind) endif() endif() ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
