[llvm-branch-commits] [mlir] [MLIR][OpenMP] Add `OpenMP_Clause` tablegen definitions (PR #92521)
@@ -0,0 +1,1183 @@ +//=== OpenMPClauses.td - OpenMP dialect clause definitions -*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--===// +// +// This file contains clause definitions for the OpenMP dialect. +// +// For each "Xyz" clause, there is an "OpenMP_XyzClauseSkip" class and an +// "OpenMP_XyzClause" definition. The latter is an instantiation of the former +// where all "skip" template parameters are set to `false` and should be the +// preferred variant to used whenever possible when defining `OpenMP_Op` +// instances. +// +//===--===// + +#ifndef OPENMP_CLAUSES +#define OPENMP_CLAUSES + +include "mlir/Dialect/OpenMP/OpenMPOpBase.td" + +//===--===// +// V5.2: [5.11] `aligned` clause +//===--===// + +class OpenMP_AlignedClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit extraClassDeclaration = false + > : OpenMP_Clause { + let arguments = (ins +Variadic:$aligned_vars, +OptionalAttr:$alignment_values + ); + + let assemblyFormat = [{ +`aligned` `(` custom($aligned_vars, type($aligned_vars), +$alignment_values) `)` + }]; + + let description = [{ +The `alignment_values` attribute additionally specifies alignment of each +corresponding aligned operand. Note that `aligned_vars` and +`alignment_values` should contain the same number of elements. + }]; +} + +def OpenMP_AlignedClause : OpenMP_AlignedClauseSkip<>; + +//===--===// +// V5.2: [6.6] `allocate` clause +//===--===// + +class OpenMP_AllocateClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit extraClassDeclaration = false + > : OpenMP_Clause { + let arguments = (ins +Variadic:$allocate_vars, +Variadic:$allocators_vars + ); + + let assemblyFormat = [{ +`allocate` `(` + custom($allocate_vars, type($allocate_vars), + $allocators_vars, type($allocators_vars)) `)` + }]; + + let description = [{ +The `allocators_vars` and `allocate_vars` parameters are a variadic list of +values that specify the memory allocator to be used to obtain storage for +private values. + }]; +} + +def OpenMP_AllocateClause : OpenMP_AllocateClauseSkip<>; + +//===--===// +// V5.2: [16.1, 16.2] `cancel-directive-name` clause set +//===--===// + +class OpenMP_CancelDirectiveNameClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit extraClassDeclaration = false + > : OpenMP_Clause { + let arguments = (ins +CancellationConstructTypeAttr:$cancellation_construct_type_val + ); + + let assemblyFormat = [{ +`cancellation_construct_type` `(` + custom($cancellation_construct_type_val) `)` + }]; + + // TODO: Add description. +} + +def OpenMP_CancelDirectiveNameClause : OpenMP_CancelDirectiveNameClauseSkip<>; + +//===--===// +// V5.2: [4.4.3] `collapse` clause +//===--===// + +class OpenMP_CollapseClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit extraClassDeclaration = false + > : OpenMP_Clause { + let traits = [ +AllTypesMatch<["lowerBound", "upperBound", "step"]> + ]; + + let arguments = (ins +Variadic:$lowerBound, +Variadic:$upperBound, +Variadic:$step + ); + + let extraClassDeclaration = [{ +/// Returns the number of loops in the loop nest. +unsigned getNumLoops() { return getLowerBound().size(); } + }]; + + // Description and formatting integrated in the `omp.loop_nest` operation, + // which is the only one currently accepting this clause. +} + +def OpenMP_CollapseClause : OpenMP_CollapseClauseSkip<>; + +//===--===// +// V5.2: [5.7.2] `copyprivate` clause +//===--===// + +class OpenMP_CopyprivateClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit ex
[llvm-branch-commits] [mlir] [MLIR][OpenMP] Add `OpenMP_Clause` tablegen definitions (PR #92521)
https://github.com/skatrak updated https://github.com/llvm/llvm-project/pull/92521 >From 7466061b62bb48352696a3890898dcea56f7e509 Mon Sep 17 00:00:00 2001 From: Sergio Afonso Date: Fri, 17 May 2024 10:56:32 +0100 Subject: [PATCH] [MLIR][OpenMP] Add `OpenMP_Clause` tablegen definitions This patch adds a new tablegen file for the OpenMP dialect containing the list of clauses currently supported. --- .../mlir/Dialect/OpenMP/OpenMPClauses.td | 1184 + 1 file changed, 1184 insertions(+) create mode 100644 mlir/include/mlir/Dialect/OpenMP/OpenMPClauses.td diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPClauses.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPClauses.td new file mode 100644 index 0..9d6ceb0c8d1e7 --- /dev/null +++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPClauses.td @@ -0,0 +1,1184 @@ +//=== OpenMPClauses.td - OpenMP dialect clause definitions -*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--===// +// +// This file contains clause definitions for the OpenMP dialect. +// +// For each "Xyz" clause, there is an "OpenMP_XyzClauseSkip" class and an +// "OpenMP_XyzClause" definition. The latter is an instantiation of the former +// where all "skip" template parameters are set to `false` and should be the +// preferred variant to used whenever possible when defining `OpenMP_Op` +// instances. +// +//===--===// + +#ifndef OPENMP_CLAUSES +#define OPENMP_CLAUSES + +include "mlir/Dialect/OpenMP/OpenMPOpBase.td" + +//===--===// +// V5.2: [5.11] `aligned` clause +//===--===// + +class OpenMP_AlignedClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit extraClassDeclaration = false + > : OpenMP_Clause { + let arguments = (ins +Variadic:$aligned_vars, +OptionalAttr:$alignment_values + ); + + let assemblyFormat = [{ +`aligned` `(` custom($aligned_vars, type($aligned_vars), +$alignment_values) `)` + }]; + + let description = [{ +The `alignment_values` attribute additionally specifies alignment of each +corresponding aligned operand. Note that `aligned_vars` and +`alignment_values` should contain the same number of elements. + }]; +} + +def OpenMP_AlignedClause : OpenMP_AlignedClauseSkip<>; + +//===--===// +// V5.2: [6.6] `allocate` clause +//===--===// + +class OpenMP_AllocateClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit extraClassDeclaration = false + > : OpenMP_Clause { + let arguments = (ins +Variadic:$allocate_vars, +Variadic:$allocators_vars + ); + + let assemblyFormat = [{ +`allocate` `(` + custom($allocate_vars, type($allocate_vars), + $allocators_vars, type($allocators_vars)) `)` + }]; + + let description = [{ +The `allocators_vars` and `allocate_vars` parameters are a variadic list of +values that specify the memory allocator to be used to obtain storage for +private values. + }]; +} + +def OpenMP_AllocateClause : OpenMP_AllocateClauseSkip<>; + +//===--===// +// V5.2: [16.1, 16.2] `cancel-directive-name` clause set +//===--===// + +class OpenMP_CancelDirectiveNameClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit extraClassDeclaration = false + > : OpenMP_Clause { + let arguments = (ins +CancellationConstructTypeAttr:$cancellation_construct_type_val + ); + + let assemblyFormat = [{ +`cancellation_construct_type` `(` + custom($cancellation_construct_type_val) `)` + }]; + + // TODO: Add description. +} + +def OpenMP_CancelDirectiveNameClause : OpenMP_CancelDirectiveNameClauseSkip<>; + +//===--===// +// V5.2: [4.4.3] `collapse` clause +//===--===// + +class OpenMP_CollapseClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit extraClassDeclaration = false + > : OpenMP_Clause { + let traits = [ +AllTypesMatch<["lowerBound", "upperBound", "step"]> + ]; + + let arguments
[llvm-branch-commits] [flang] [Flang][OpenMP] Update flang with changes to the OpenMP dialect (PR #92524)
https://github.com/skatrak updated https://github.com/llvm/llvm-project/pull/92524 >From 3659909ba1e21e2a8364ee48c9c6c5b22ae4f8f5 Mon Sep 17 00:00:00 2001 From: Sergio Afonso Date: Fri, 17 May 2024 11:38:36 +0100 Subject: [PATCH] [Flang][OpenMP] Update flang with changes to the OpenMP dialect This patch applies fixes after the updates to OpenMP clause operands, as well as updating some tests that were impacted by changes to the ordering or assembly format of some clauses in MLIR. --- flang/lib/Lower/OpenMP/ClauseProcessor.cpp| 4 ++-- flang/lib/Lower/OpenMP/ClauseProcessor.h | 4 ++-- flang/lib/Lower/OpenMP/OpenMP.cpp | 19 --- flang/test/Lower/OpenMP/atomic-capture.f90| 2 +- flang/test/Lower/OpenMP/copyin-order.f90 | 2 +- flang/test/Lower/OpenMP/parallel-wsloop.f90 | 2 +- flang/test/Lower/OpenMP/parallel.f90 | 24 +-- flang/test/Lower/OpenMP/simd.f90 | 2 +- flang/test/Lower/OpenMP/target.f90| 24 +-- .../use-device-ptr-to-use-device-addr.f90 | 2 +- 10 files changed, 43 insertions(+), 42 deletions(-) diff --git a/flang/lib/Lower/OpenMP/ClauseProcessor.cpp b/flang/lib/Lower/OpenMP/ClauseProcessor.cpp index 875599098b3dc..3cbc925f8869c 100644 --- a/flang/lib/Lower/OpenMP/ClauseProcessor.cpp +++ b/flang/lib/Lower/OpenMP/ClauseProcessor.cpp @@ -973,7 +973,7 @@ bool ClauseProcessor::processEnter( } bool ClauseProcessor::processUseDeviceAddr( -mlir::omp::UseDeviceClauseOps &result, +mlir::omp::UseDeviceAddrClauseOps &result, llvm::SmallVectorImpl &useDeviceTypes, llvm::SmallVectorImpl &useDeviceLocs, llvm::SmallVectorImpl &useDeviceSyms) const { @@ -985,7 +985,7 @@ bool ClauseProcessor::processUseDeviceAddr( } bool ClauseProcessor::processUseDevicePtr( -mlir::omp::UseDeviceClauseOps &result, +mlir::omp::UseDevicePtrClauseOps &result, llvm::SmallVectorImpl &useDeviceTypes, llvm::SmallVectorImpl &useDeviceLocs, llvm::SmallVectorImpl &useDeviceSyms) const { diff --git a/flang/lib/Lower/OpenMP/ClauseProcessor.h b/flang/lib/Lower/OpenMP/ClauseProcessor.h index 4d3d4448e8f03..328d018ec2e52 100644 --- a/flang/lib/Lower/OpenMP/ClauseProcessor.h +++ b/flang/lib/Lower/OpenMP/ClauseProcessor.h @@ -125,12 +125,12 @@ class ClauseProcessor { mlir::omp::ReductionClauseOps &result) const; bool processTo(llvm::SmallVectorImpl &result) const; bool processUseDeviceAddr( - mlir::omp::UseDeviceClauseOps &result, + mlir::omp::UseDeviceAddrClauseOps &result, llvm::SmallVectorImpl &useDeviceTypes, llvm::SmallVectorImpl &useDeviceLocs, llvm::SmallVectorImpl &useDeviceSyms) const; bool processUseDevicePtr( - mlir::omp::UseDeviceClauseOps &result, + mlir::omp::UseDevicePtrClauseOps &result, llvm::SmallVectorImpl &useDeviceTypes, llvm::SmallVectorImpl &useDeviceLocs, llvm::SmallVectorImpl &useDeviceSyms) const; diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp index ece098a5bfbb1..e542f58e9b826 100644 --- a/flang/lib/Lower/OpenMP/OpenMP.cpp +++ b/flang/lib/Lower/OpenMP/OpenMP.cpp @@ -244,7 +244,8 @@ createAndSetPrivatizedLoopVar(lower::AbstractConverter &converter, // clause. Support for such list items in a use_device_ptr clause // is deprecated." static void promoteNonCPtrUseDevicePtrArgsToUseDeviceAddr( -mlir::omp::UseDeviceClauseOps &clauseOps, +llvm::SmallVectorImpl &useDeviceAddrVars, +llvm::SmallVectorImpl &useDevicePtrVars, llvm::SmallVectorImpl &useDeviceTypes, llvm::SmallVectorImpl &useDeviceLocs, llvm::SmallVectorImpl &useDeviceSymbols) { @@ -256,10 +257,9 @@ static void promoteNonCPtrUseDevicePtrArgsToUseDeviceAddr( // Iterate over our use_device_ptr list and shift all non-cptr arguments into // use_device_addr. - for (auto *it = clauseOps.useDevicePtrVars.begin(); - it != clauseOps.useDevicePtrVars.end();) { + for (auto *it = useDevicePtrVars.begin(); it != useDevicePtrVars.end();) { if (!fir::isa_builtin_cptr_type(fir::unwrapRefType(it->getType( { - clauseOps.useDeviceAddrVars.push_back(*it); + useDeviceAddrVars.push_back(*it); // We have to shuffle the symbols around as well, to maintain // the correct Input -> BlockArg for use_device_ptr/use_device_addr. // NOTE: However, as map's do not seem to be included currently @@ -267,11 +267,11 @@ static void promoteNonCPtrUseDevicePtrArgsToUseDeviceAddr( // future alterations. I believe the reason they are not currently // is that the BlockArg assign/lowering needs to be extended // to a greater set of types. - auto idx = std::distance(clauseOps.useDevicePtrVars.begin(), it); + auto idx = std::distance(useDevicePtrVars.begin(), it); moveElementToBack(idx, useDeviceTypes); moveElementToBack(idx, useDeviceLocs); moveElemen
[llvm-branch-commits] [mlir] [MLIR][OpenMP] Add `OpenMP_Clause` tablegen definitions (PR #92521)
@@ -0,0 +1,1183 @@ +//=== OpenMPClauses.td - OpenMP dialect clause definitions -*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===--===// +// +// This file contains clause definitions for the OpenMP dialect. +// +// For each "Xyz" clause, there is an "OpenMP_XyzClauseSkip" class and an +// "OpenMP_XyzClause" definition. The latter is an instantiation of the former +// where all "skip" template parameters are set to `false` and should be the +// preferred variant to used whenever possible when defining `OpenMP_Op` +// instances. +// +//===--===// + +#ifndef OPENMP_CLAUSES +#define OPENMP_CLAUSES + +include "mlir/Dialect/OpenMP/OpenMPOpBase.td" + +//===--===// +// V5.2: [5.11] `aligned` clause +//===--===// + +class OpenMP_AlignedClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit extraClassDeclaration = false + > : OpenMP_Clause { + let arguments = (ins +Variadic:$aligned_vars, +OptionalAttr:$alignment_values + ); + + let assemblyFormat = [{ +`aligned` `(` custom($aligned_vars, type($aligned_vars), +$alignment_values) `)` + }]; + + let description = [{ +The `alignment_values` attribute additionally specifies alignment of each +corresponding aligned operand. Note that `aligned_vars` and +`alignment_values` should contain the same number of elements. + }]; +} + +def OpenMP_AlignedClause : OpenMP_AlignedClauseSkip<>; + +//===--===// +// V5.2: [6.6] `allocate` clause +//===--===// + +class OpenMP_AllocateClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit extraClassDeclaration = false + > : OpenMP_Clause { + let arguments = (ins +Variadic:$allocate_vars, +Variadic:$allocators_vars + ); + + let assemblyFormat = [{ +`allocate` `(` + custom($allocate_vars, type($allocate_vars), + $allocators_vars, type($allocators_vars)) `)` + }]; + + let description = [{ +The `allocators_vars` and `allocate_vars` parameters are a variadic list of +values that specify the memory allocator to be used to obtain storage for +private values. + }]; +} + +def OpenMP_AllocateClause : OpenMP_AllocateClauseSkip<>; + +//===--===// +// V5.2: [16.1, 16.2] `cancel-directive-name` clause set +//===--===// + +class OpenMP_CancelDirectiveNameClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit extraClassDeclaration = false + > : OpenMP_Clause { + let arguments = (ins +CancellationConstructTypeAttr:$cancellation_construct_type_val + ); + + let assemblyFormat = [{ +`cancellation_construct_type` `(` + custom($cancellation_construct_type_val) `)` + }]; + + // TODO: Add description. +} + +def OpenMP_CancelDirectiveNameClause : OpenMP_CancelDirectiveNameClauseSkip<>; + +//===--===// +// V5.2: [4.4.3] `collapse` clause +//===--===// + +class OpenMP_CollapseClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit extraClassDeclaration = false + > : OpenMP_Clause { + let traits = [ +AllTypesMatch<["lowerBound", "upperBound", "step"]> + ]; + + let arguments = (ins +Variadic:$lowerBound, +Variadic:$upperBound, +Variadic:$step + ); + + let extraClassDeclaration = [{ +/// Returns the number of loops in the loop nest. +unsigned getNumLoops() { return getLowerBound().size(); } + }]; + + // Description and formatting integrated in the `omp.loop_nest` operation, + // which is the only one currently accepting this clause. +} + +def OpenMP_CollapseClause : OpenMP_CollapseClauseSkip<>; + +//===--===// +// V5.2: [5.7.2] `copyprivate` clause +//===--===// + +class OpenMP_CopyprivateClauseSkip< +bit traits = false, bit arguments = false, bit assemblyFormat = false, +bit description = false, bit ex
[llvm-branch-commits] [llvm] 6f236cd - Revert "[AMDGPU] Use LSH for lowering ctlz_zero_undef.i8/i16 (#88512)"
Author: Leon Clark Date: 2024-05-20T16:00:15+01:00 New Revision: 6f236cdc42601d96f06781e75d0112bdb8d4a4ce URL: https://github.com/llvm/llvm-project/commit/6f236cdc42601d96f06781e75d0112bdb8d4a4ce DIFF: https://github.com/llvm/llvm-project/commit/6f236cdc42601d96f06781e75d0112bdb8d4a4ce.diff LOG: Revert "[AMDGPU] Use LSH for lowering ctlz_zero_undef.i8/i16 (#88512)" This reverts commit fb2c6597e39e9e1a775525ea0236b2f89e46acff. Added: Modified: llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.h llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-ctlz-zero-undef.mir llvm/test/CodeGen/AMDGPU/ctlz_zero_undef.ll Removed: diff --git a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp index 980e58510ceb7..d35a022ad6806 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp @@ -3117,30 +3117,20 @@ static bool isCttzOpc(unsigned Opc) { SDValue AMDGPUTargetLowering::lowerCTLZResults(SDValue Op, SelectionDAG &DAG) const { auto SL = SDLoc(Op); - auto Opc = Op.getOpcode(); auto Arg = Op.getOperand(0u); auto ResultVT = Op.getValueType(); if (ResultVT != MVT::i8 && ResultVT != MVT::i16) return {}; - assert(isCtlzOpc(Opc)); + assert(isCtlzOpc(Op.getOpcode())); assert(ResultVT == Arg.getValueType()); - const uint64_t NumBits = ResultVT.getFixedSizeInBits(); - SDValue NumExtBits = DAG.getConstant(32u - NumBits, SL, MVT::i32); - SDValue NewOp; - - if (Opc == ISD::CTLZ_ZERO_UNDEF) { -NewOp = DAG.getNode(ISD::ANY_EXTEND, SL, MVT::i32, Arg); -NewOp = DAG.getNode(ISD::SHL, SL, MVT::i32, NewOp, NumExtBits); -NewOp = DAG.getNode(Opc, SL, MVT::i32, NewOp); - } else { -NewOp = DAG.getNode(ISD::ZERO_EXTEND, SL, MVT::i32, Arg); -NewOp = DAG.getNode(Opc, SL, MVT::i32, NewOp); -NewOp = DAG.getNode(ISD::SUB, SL, MVT::i32, NewOp, NumExtBits); - } - + auto const LeadingZeroes = 32u - ResultVT.getFixedSizeInBits(); + auto SubVal = DAG.getConstant(LeadingZeroes, SL, MVT::i32); + auto NewOp = DAG.getNode(ISD::ZERO_EXTEND, SL, MVT::i32, Arg); + NewOp = DAG.getNode(Op.getOpcode(), SL, MVT::i32, NewOp); + NewOp = DAG.getNode(ISD::SUB, SL, MVT::i32, NewOp, SubVal); return DAG.getNode(ISD::TRUNCATE, SL, ResultVT, NewOp); } diff --git a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp index 15a4b6796880f..bd7bf78c4c0bd 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp @@ -1270,22 +1270,13 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST_, .custom(); // The 64-bit versions produce 32-bit results, but only on the SALU. - getActionDefinitionsBuilder(G_CTLZ_ZERO_UNDEF) - .legalFor({{S32, S32}, {S32, S64}}) - .customIf(scalarNarrowerThan(1, 32)) - .clampScalar(0, S32, S32) - .clampScalar(1, S32, S64) - .scalarize(0) - .widenScalarToNextPow2(0, 32) - .widenScalarToNextPow2(1, 32); - - getActionDefinitionsBuilder(G_CTTZ_ZERO_UNDEF) - .legalFor({{S32, S32}, {S32, S64}}) - .clampScalar(0, S32, S32) - .clampScalar(1, S32, S64) - .scalarize(0) - .widenScalarToNextPow2(0, 32) - .widenScalarToNextPow2(1, 32); + getActionDefinitionsBuilder({G_CTLZ_ZERO_UNDEF, G_CTTZ_ZERO_UNDEF}) +.legalFor({{S32, S32}, {S32, S64}}) +.clampScalar(0, S32, S32) +.clampScalar(1, S32, S64) +.scalarize(0) +.widenScalarToNextPow2(0, 32) +.widenScalarToNextPow2(1, 32); // S64 is only legal on SALU, and needs to be broken into 32-bit elements in // RegBankSelect. @@ -2137,8 +2128,6 @@ bool AMDGPULegalizerInfo::legalizeCustom( case TargetOpcode::G_CTLZ: case TargetOpcode::G_CTTZ: return legalizeCTLZ_CTTZ(MI, MRI, B); - case TargetOpcode::G_CTLZ_ZERO_UNDEF: -return legalizeCTLZ_ZERO_UNDEF(MI, MRI, B); case TargetOpcode::G_INTRINSIC_FPTRUNC_ROUND: return legalizeFPTruncRound(MI, B); case TargetOpcode::G_STACKSAVE: @@ -4156,25 +4145,6 @@ bool AMDGPULegalizerInfo::legalizeCTLZ_CTTZ(MachineInstr &MI, return true; } -bool AMDGPULegalizerInfo::legalizeCTLZ_ZERO_UNDEF(MachineInstr &MI, - MachineRegisterInfo &MRI, - MachineIRBuilder &B) const { - Register Dst = MI.getOperand(0).getReg(); - Register Src = MI.getOperand(1).getReg(); - LLT SrcTy = MRI.getType(Src); - TypeSize NumBits = SrcTy.getSizeInBits(); - - assert(NumBits < 32u); - - auto ShiftAmt = B.buildConstant(S32, 32u - NumBits); - auto Extend = B.buildAnyExt(S32, {Src}).getReg(0u); - auto Shift = B.buildLShr(S32, {Extend}, ShiftAmt); - auto Ctlz
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
@@ -458,6 +482,38 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer( Instruction *Base = IRB.CreateCall(IRG_SP, {Constant::getNullValue(IRB.getInt64Ty())}); Base->setName("basetag"); + auto TargetTriple = Triple(M.getTargetTriple()); + // This is not a stable ABI for now, so only allow in dev builds with API eugenis wrote: Add a note about ThreadLong format being compatible with hwasan, but the entries are twice as long. https://github.com/llvm/llvm-project/pull/86356 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
https://github.com/eugenis edited https://github.com/llvm/llvm-project/pull/86356 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
https://github.com/eugenis commented: Needs tests. https://github.com/llvm/llvm-project/pull/86356 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
@@ -82,6 +84,26 @@ static cl::opt ClMaxLifetimes( cl::desc("How many lifetime ends to handle for a single alloca."), cl::Optional); +// Mode for selecting how to insert frame record info into the stack ring +// buffer. +enum RecordStackHistoryMode { + // Do not record frame record info. + none, + + // Insert instructions into the prologue for storing into the stack ring + // buffer directly. + instr, eugenis wrote: maybe "inline"? https://github.com/llvm/llvm-project/pull/86356 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
@@ -2497,7 +2497,8 @@ AArch64FrameLowering::getFrameIndexReference(const MachineFunction &MF, int FI, return resolveFrameIndexReference( MF, FI, FrameReg, /*PreferFP=*/ - MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress), + MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress) || + MF.getFunction().hasFnAttribute(Attribute::SanitizeMemTag), /*ForSimm=*/false); eugenis wrote: So this will cause most of the local references to use FP, but our "base tagged pointer" is SP-based (see the aarch64_irg_sp intrinsic). Would not that pessimize the codegen a lot? Please check that nothing stupid is happening in the backend. There is a bunch of relevant tests under test/CodeGen/AArch64/stack-tagging-* https://github.com/llvm/llvm-project/pull/86356 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
@@ -82,6 +84,26 @@ static cl::opt ClMaxLifetimes( cl::desc("How many lifetime ends to handle for a single alloca."), cl::Optional); +// Mode for selecting how to insert frame record info into the stack ring +// buffer. +enum RecordStackHistoryMode { + // Do not record frame record info. + none, + + // Insert instructions into the prologue for storing into the stack ring + // buffer directly. + instr, fmayer wrote: It is called `instr` in HWASan https://github.com/llvm/llvm-project/pull/86356 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Ignore hot markers as function references in updateELFSymbolTable (PR #92713)
@@ -4788,13 +4788,25 @@ void RewriteInstance::updateELFSymbolTable( if (!IsDynSym && shouldStrip(Symbol)) continue; +Expected SymbolName = Symbol.getName(StringSection); maksfb wrote: Can we move the code that checks for special symbols here and skip function matching for them all together? Otherwise we are checking for the markers in several locations unnecessarily. https://github.com/llvm/llvm-project/pull/92713 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Ignore hot markers as function references in updateELFSymbolTable (PR #92713)
@@ -4788,13 +4788,25 @@ void RewriteInstance::updateELFSymbolTable( if (!IsDynSym && shouldStrip(Symbol)) continue; +Expected SymbolName = Symbol.getName(StringSection); aaupov wrote: There are non-trivial conditions (https://github.com/llvm/llvm-project/pull/92713/files#diff-4be6195ccdb53447f870b9b26a36d0b916ace3cbd6efe595bb3cbffd53cf0dacL4902) that guard updating those special symbols. NFC testing shows it may not be safe to just move these checks. https://github.com/llvm/llvm-project/pull/92713 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Ignore hot markers as function references in updateELFSymbolTable (PR #92713)
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/92713 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] Discard SHT_LLVM_LTO sections in relocatable links (PR #92825)
https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/92825 So long as ld -r links using bitcode always result in an ELF object, and not a merged bitcode object, the output form a relocatable link using FatLTO objects should not have a .llvm.lto section. Prior to this, using the object code sections would cause the bitcode section in the output of a relocatable link to be corrupted, by concatenating all the .llvm.lto sections together. This patch discards SHT_LLVM_LTO sections when not using --fat-lto-objects, so that the relocatable ELF output won't contain inalid bitcode. ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] Discard SHT_LLVM_LTO sections in relocatable links (PR #92825)
llvmbot wrote: @llvm/pr-subscribers-lld-elf Author: Paul Kirth (ilovepi) Changes So long as ld -r links using bitcode always result in an ELF object, and not a merged bitcode object, the output form a relocatable link using FatLTO objects should not have a .llvm.lto section. Prior to this, using the object code sections would cause the bitcode section in the output of a relocatable link to be corrupted, by concatenating all the .llvm.lto sections together. This patch discards SHT_LLVM_LTO sections when not using --fat-lto-objects, so that the relocatable ELF output won't contain inalid bitcode. --- Full diff: https://github.com/llvm/llvm-project/pull/92825.diff 2 Files Affected: - (modified) lld/ELF/InputFiles.cpp (+9) - (modified) lld/test/ELF/fatlto/fatlto.test (+2-5) ``diff diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 1f496026d3ae2..0ac49761601c4 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -832,6 +832,15 @@ void ObjFile::initializeSections(bool ignoreComdats, this->sections[i] = createInputSection(i, sec, check(obj.getSectionName(sec, shstrtab))); break; +case SHT_LLVM_LTO: + // When doing a relocatable link with FatLTO objects, if we're not using + // the bitcode, discard it, since it will be concatenated together when + // handling orphan sections, and which will be an invalid bitcode object. + if (config->relocatable && !config->fatLTOObjects) { +sections[i] = &InputSection::discarded; +break; + } + LLVM_FALLTHROUGH; default: this->sections[i] = createInputSection(i, sec, check(obj.getSectionName(sec, shstrtab))); diff --git a/lld/test/ELF/fatlto/fatlto.test b/lld/test/ELF/fatlto/fatlto.test index e250325dc54f4..d2c96c3c51b98 100644 --- a/lld/test/ELF/fatlto/fatlto.test +++ b/lld/test/ELF/fatlto/fatlto.test @@ -50,10 +50,6 @@ ; RUN: cmp %t/foo-fatLTO.archive %t/foo-LTO ;; Test FatLTO works with relocatable links using PIC objects -;; Currently, with PIC relocatable links, FatLTO sections are treated as -;; orphan sections and incorrectly concatenated together. This test verifies -;; the current behavior, but should be fixed to either merge those sections -;; correctly, or to drop them altogether. ; RUN: opt < %t/a-LTO.ll -passes="embed-bitcode" | llc --relocation-model=pic --filetype=obj -o %t/a-fat-pic.o ; RUN: llvm-readobj -S %t/a-fat-pic.o | FileCheck --check-prefix=HAS_LLVM_LTO %s @@ -64,9 +60,10 @@ ; RUN: llvm-readobj -S %t/fat.pic.archive | FileCheck --check-prefix=HAS_LLVM_LTO %s ; RUN: ld.lld --whole-archive %t/fat.pic.archive -r -o %t/fat-pic-relocatable.o -; RUN: llvm-readobj -S %t/fat-pic-relocatable.o | FileCheck --check-prefix=HAS_LLVM_LTO %s +; RUN: llvm-readobj -S %t/fat-pic-relocatable.o | FileCheck --check-prefix=CHECK-NON-LTO-TARGET %s ; HAS_LLVM_LTO: Name: .llvm.lto +; HAS_LLVM_LTO: Type: SHT_LLVM_LTO ;--- a-LTO.ll target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" `` https://github.com/llvm/llvm-project/pull/92825 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Ignore hot markers as function references in updateELFSymbolTable (PR #92713)
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/92713 >From a32bf63f61f6d382f09982d992f3cabc8dc55cfd Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 19:44:20 -0700 Subject: [PATCH 1/3] drop changes to bolt/test/AArch64/text-data.c Created using spr 1.3.4 --- bolt/test/AArch64/text-data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bolt/test/AArch64/text-data.c b/bolt/test/AArch64/text-data.c index 17e507a7cc1b4..2986fe7840078 100644 --- a/bolt/test/AArch64/text-data.c +++ b/bolt/test/AArch64/text-data.c @@ -3,7 +3,7 @@ // RUN: %clang %cflags %s -o %t.exe -Wl,-q // RUN: llvm-bolt %t.exe -o %t.bolt --lite=0 --use-old-text=0 -// RUN: llvm-objdump -j .bolt.org.text -d --disassemble-symbols=arr %t.bolt | \ +// RUN: llvm-objdump -j .text -d --disassemble-symbols=arr %t.bolt | \ // RUN: FileCheck %s // CHECK: {{.*}} : >From d09b18df4eb75879ef528bfcb43604b86d56860c Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 20:13:19 -0700 Subject: [PATCH 2/3] Address comments Created using spr 1.3.4 --- bolt/lib/Rewrite/RewriteInstance.cpp | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 0d11bdc46fa5a..ba5cec7d9c596 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4789,7 +4789,6 @@ void RewriteInstance::updateELFSymbolTable( continue; Expected SymbolName = Symbol.getName(StringSection); -assert(SymbolName && "cannot get symbol name"); const BinaryFunction *Function = BC->getBinaryFunctionAtAddress(Symbol.st_value); @@ -4798,8 +4797,11 @@ void RewriteInstance::updateELFSymbolTable( if (Function && Symbol.getType() == ELF::STT_SECTION) Function = nullptr; -// Ignore input hot markers as function aliases – markers are handled -// separately. +// Ignore input hot markers as function aliases. +// If hot markers are treated as function aliases, we may create +// non-sensical __hot_start.cold symbols which would not have a parent +// when read by BOLT as we don't register them as function aliases +// (explicitly ignored in parsing symbol table in discoverFileObjects). if (Function && (*SymbolName == "__hot_start" || *SymbolName == "__hot_end")) Function = nullptr; >From b36c250836607410246e6ddf2f855d43df77e80d Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 20:17:15 -0700 Subject: [PATCH 3/3] keep assert Created using spr 1.3.4 --- bolt/lib/Rewrite/RewriteInstance.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index ba5cec7d9c596..e788ca7afd5ad 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4789,6 +4789,7 @@ void RewriteInstance::updateELFSymbolTable( continue; Expected SymbolName = Symbol.getName(StringSection); +assert(SymbolName && "cannot get symbol name"); const BinaryFunction *Function = BC->getBinaryFunctionAtAddress(Symbol.st_value); ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Ignore hot markers as function references in updateELFSymbolTable (PR #92713)
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/92713 >From a32bf63f61f6d382f09982d992f3cabc8dc55cfd Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 19:44:20 -0700 Subject: [PATCH 1/3] drop changes to bolt/test/AArch64/text-data.c Created using spr 1.3.4 --- bolt/test/AArch64/text-data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bolt/test/AArch64/text-data.c b/bolt/test/AArch64/text-data.c index 17e507a7cc1b4..2986fe7840078 100644 --- a/bolt/test/AArch64/text-data.c +++ b/bolt/test/AArch64/text-data.c @@ -3,7 +3,7 @@ // RUN: %clang %cflags %s -o %t.exe -Wl,-q // RUN: llvm-bolt %t.exe -o %t.bolt --lite=0 --use-old-text=0 -// RUN: llvm-objdump -j .bolt.org.text -d --disassemble-symbols=arr %t.bolt | \ +// RUN: llvm-objdump -j .text -d --disassemble-symbols=arr %t.bolt | \ // RUN: FileCheck %s // CHECK: {{.*}} : >From d09b18df4eb75879ef528bfcb43604b86d56860c Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 20:13:19 -0700 Subject: [PATCH 2/3] Address comments Created using spr 1.3.4 --- bolt/lib/Rewrite/RewriteInstance.cpp | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 0d11bdc46fa5a..ba5cec7d9c596 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4789,7 +4789,6 @@ void RewriteInstance::updateELFSymbolTable( continue; Expected SymbolName = Symbol.getName(StringSection); -assert(SymbolName && "cannot get symbol name"); const BinaryFunction *Function = BC->getBinaryFunctionAtAddress(Symbol.st_value); @@ -4798,8 +4797,11 @@ void RewriteInstance::updateELFSymbolTable( if (Function && Symbol.getType() == ELF::STT_SECTION) Function = nullptr; -// Ignore input hot markers as function aliases – markers are handled -// separately. +// Ignore input hot markers as function aliases. +// If hot markers are treated as function aliases, we may create +// non-sensical __hot_start.cold symbols which would not have a parent +// when read by BOLT as we don't register them as function aliases +// (explicitly ignored in parsing symbol table in discoverFileObjects). if (Function && (*SymbolName == "__hot_start" || *SymbolName == "__hot_end")) Function = nullptr; >From b36c250836607410246e6ddf2f855d43df77e80d Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 20:17:15 -0700 Subject: [PATCH 3/3] keep assert Created using spr 1.3.4 --- bolt/lib/Rewrite/RewriteInstance.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index ba5cec7d9c596..e788ca7afd5ad 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4789,6 +4789,7 @@ void RewriteInstance::updateELFSymbolTable( continue; Expected SymbolName = Symbol.getName(StringSection); +assert(SymbolName && "cannot get symbol name"); const BinaryFunction *Function = BC->getBinaryFunctionAtAddress(Symbol.st_value); ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
@@ -2497,7 +2497,8 @@ AArch64FrameLowering::getFrameIndexReference(const MachineFunction &MF, int FI, return resolveFrameIndexReference( MF, FI, FrameReg, /*PreferFP=*/ - MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress), + MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress) || + MF.getFunction().hasFnAttribute(Attribute::SanitizeMemTag), /*ForSimm=*/false); fmayer wrote: I don't think that makes a difference. I compiled a [moderately complicated file from AOSP](https://cs.android.com/android/platform/superproject/main/+/main:system/unwinding/libunwindstack/Unwinder.cpp) with memtag-stack and without this change (and with and without the `-stack-tagging-record-stack-history=instr`), and the assembly is the same. The docstring "getFrameIndexReference - Provide a base+offset reference to an FI slot for debug info." also implies this shouldn't affect codegen. https://github.com/llvm/llvm-project/pull/86356 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/86356 >From a64c5d63a4df7f59845291ca0d634466713b1ff8 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Fri, 29 Mar 2024 16:53:52 -0700 Subject: [PATCH 1/5] update Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index a6e236386d5ba..6538abea83290 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -489,7 +489,6 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer( auto *IntptrTy = IRB.getIntPtrTy(M.getDataLayout()); Value *SlotPtr = memtag::getAndroidSlotPtr(IRB, StackMteSlot); -SlotPtr->setName("TLS_SLOT_STACK_MTE"); auto *ThreadLong = IRB.CreateLoad(IntptrTy, SlotPtr); Value *TaggedFP = IRB.CreateOr( memtag::getFP(IRB), >From 8591fb38c7e065862a0814792a368e2983b8b10c Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 29 Apr 2024 14:45:16 -0700 Subject: [PATCH 2/5] api lvl Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index 840635315eee0..e38cce94a5cc0 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -484,7 +484,7 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer( Base->setName("basetag"); auto TargetTriple = Triple(M.getTargetTriple()); if (ClRecordStackHistory == instr && TargetTriple.isAndroid() && - TargetTriple.isAArch64() && !TargetTriple.isAndroidVersionLT(35)) { + TargetTriple.isAArch64() && !TargetTriple.isAndroidVersionLT(36)) { constexpr int StackMteSlot = -3; constexpr uint64_t TagMask = 0xFULL << 56; >From 66fbd757608c44b04d64de3f058ce813b14706fe Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 29 Apr 2024 16:00:09 -0700 Subject: [PATCH 3/5] hidden Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index e38cce94a5cc0..43d82a1234f7a 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -102,7 +102,7 @@ static cl::opt ClRecordStackHistory( cl::values(clEnumVal(none, "Do not record stack ring history"), clEnumVal(instr, "Insert instructions into the prologue for " "storing into the stack ring buffer")), -cl::Hidden, cl::init(instr)); +cl::Hidden, cl::init(none)); static const Align kTagGranuleSize = Align(16); >From 62c281253d2e5b38619b3395bcb5f0aa7cb3e8d8 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 6 May 2024 17:40:16 -0700 Subject: [PATCH 4/5] fp Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp index c86c98eed24f0..491a46e03b1d1 100644 --- a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp @@ -2497,7 +2497,8 @@ AArch64FrameLowering::getFrameIndexReference(const MachineFunction &MF, int FI, return resolveFrameIndexReference( MF, FI, FrameReg, /*PreferFP=*/ - MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress), + MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress) || + MF.getFunction().hasFnAttribute(Attribute::SanitizeMemTag), /*ForSimm=*/false); } >From 79ec757be06ccfb2ed9ae744d945820a8c67fa49 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 20 May 2024 15:20:18 -0700 Subject: [PATCH 5/5] comment Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index 8d53fb1d4c14b..eab3a90e57e20 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -485,8 +485,11 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer( auto TargetTriple = Triple(M.getTargetTriple()); // This is not a stable ABI for now, so only allow in dev builds with API // level 1. + // The ThreadLong format is the same as with HWASan, but the entries for + // stack MTE take two slots (16 bytes). if (ClRecordStackHistory == instr && TargetTriple.isAndroid() && - TargetTriple.isAArch64() && !TargetTriple.isAndroidVe
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
@@ -2497,7 +2497,8 @@ AArch64FrameLowering::getFrameIndexReference(const MachineFunction &MF, int FI, return resolveFrameIndexReference( MF, FI, FrameReg, /*PreferFP=*/ - MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress), + MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress) || + MF.getFunction().hasFnAttribute(Attribute::SanitizeMemTag), /*ForSimm=*/false); fmayer wrote: Maybe that file was a bad example. Let me check some more. https://github.com/llvm/llvm-project/pull/86356 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
https://github.com/fmayer deleted https://github.com/llvm/llvm-project/pull/86356 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Ignore hot markers as function references in updateELFSymbolTable (PR #92713)
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/92713 >From a32bf63f61f6d382f09982d992f3cabc8dc55cfd Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 19:44:20 -0700 Subject: [PATCH 1/4] drop changes to bolt/test/AArch64/text-data.c Created using spr 1.3.4 --- bolt/test/AArch64/text-data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bolt/test/AArch64/text-data.c b/bolt/test/AArch64/text-data.c index 17e507a7cc1b4..2986fe7840078 100644 --- a/bolt/test/AArch64/text-data.c +++ b/bolt/test/AArch64/text-data.c @@ -3,7 +3,7 @@ // RUN: %clang %cflags %s -o %t.exe -Wl,-q // RUN: llvm-bolt %t.exe -o %t.bolt --lite=0 --use-old-text=0 -// RUN: llvm-objdump -j .bolt.org.text -d --disassemble-symbols=arr %t.bolt | \ +// RUN: llvm-objdump -j .text -d --disassemble-symbols=arr %t.bolt | \ // RUN: FileCheck %s // CHECK: {{.*}} : >From d09b18df4eb75879ef528bfcb43604b86d56860c Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 20:13:19 -0700 Subject: [PATCH 2/4] Address comments Created using spr 1.3.4 --- bolt/lib/Rewrite/RewriteInstance.cpp | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 0d11bdc46fa5a..ba5cec7d9c596 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4789,7 +4789,6 @@ void RewriteInstance::updateELFSymbolTable( continue; Expected SymbolName = Symbol.getName(StringSection); -assert(SymbolName && "cannot get symbol name"); const BinaryFunction *Function = BC->getBinaryFunctionAtAddress(Symbol.st_value); @@ -4798,8 +4797,11 @@ void RewriteInstance::updateELFSymbolTable( if (Function && Symbol.getType() == ELF::STT_SECTION) Function = nullptr; -// Ignore input hot markers as function aliases – markers are handled -// separately. +// Ignore input hot markers as function aliases. +// If hot markers are treated as function aliases, we may create +// non-sensical __hot_start.cold symbols which would not have a parent +// when read by BOLT as we don't register them as function aliases +// (explicitly ignored in parsing symbol table in discoverFileObjects). if (Function && (*SymbolName == "__hot_start" || *SymbolName == "__hot_end")) Function = nullptr; >From b36c250836607410246e6ddf2f855d43df77e80d Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 20:17:15 -0700 Subject: [PATCH 3/4] keep assert Created using spr 1.3.4 --- bolt/lib/Rewrite/RewriteInstance.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index ba5cec7d9c596..e788ca7afd5ad 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4789,6 +4789,7 @@ void RewriteInstance::updateELFSymbolTable( continue; Expected SymbolName = Symbol.getName(StringSection); +assert(SymbolName && "cannot get symbol name"); const BinaryFunction *Function = BC->getBinaryFunctionAtAddress(Symbol.st_value); >From 1a1e2ae769bc6c9c6eb82980349f4ba7b4404aae Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Mon, 20 May 2024 15:49:16 -0700 Subject: [PATCH 4/4] Hoist the special symbol handling Created using spr 1.3.4 --- bolt/lib/Rewrite/RewriteInstance.cpp | 31 ++-- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 98d21bd7b0c77..9cc4c8c8c4faf 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4826,11 +4826,20 @@ void RewriteInstance::updateELFSymbolTable( updateSymbolValue(*SymbolName); ++NumHotTextSymsUpdated; } - // Ignore input hot markers as function aliases. - // If hot markers are treated as function aliases, we may create - // non-sensical __hot_start.cold symbols which would not have a parent - // when read by BOLT as we don't register them as function aliases - // (explicitly ignored in parsing symbol table in discoverFileObjects). + goto registerSymbol; +} + +if (*SymbolName == "__hot_data_start" || *SymbolName == "__hot_data_end") { + if (opts::HotData) { +updateSymbolValue(*SymbolName); +++NumHotDataSymsUpdated; + } + goto registerSymbol; +} + +if (*SymbolName == "_end") { + if (NextAvailableAddress > Symbol.st_value) +updateSymbolValue(*SymbolName, NextAvailableAddress); goto registerSymbol; } @@ -4930,17 +4939,7 @@ void RewriteInstance::updateELFSymbolTable( } } -// Handle special symbols based on their name. -if (opts::HotData && (*SymbolName == "__hot_data_start" || - *SymbolName == "__hot_data_end"))
[llvm-branch-commits] [llvm] [BOLT] Ignore special symbols as function references in updateELFSymbolTable (PR #92713)
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/92713 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Ignore special symbols as function aliases in updateELFSymbolTable (PR #92713)
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/92713 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
@@ -2497,7 +2497,8 @@ AArch64FrameLowering::getFrameIndexReference(const MachineFunction &MF, int FI, return resolveFrameIndexReference( MF, FI, FrameReg, /*PreferFP=*/ - MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress), + MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress) || + MF.getFunction().hasFnAttribute(Attribute::SanitizeMemTag), /*ForSimm=*/false); fmayer wrote: I compiled all of those tests with and without the `getFrameIndexReference` change, the assembly is the same Without the `getFrameIndexReference` change: ``` for f in llvm/test/CodeGen/AArch64/stack-tagging-*; do build/bin/llc -mtriple=aarch64-linux-android1 -mattr=+mte -stack-tagging-use-stack-safety=0 -stack-tagging-record-stack-history=instr $f -o tmp2/sp/$(basename $f).S; done ``` and with the `getFrameIndexReference` change: ``` for f in llvm/test/CodeGen/AArch64/stack-tagging-*; do build/bin/llc -mtriple=aarch64-linux-android1 -mattr=+mte -stack-tagging-use-stack-safety=0 -stack-tagging-record-stack-history=instr $f -o tmp2/fp/$(basename $f).S; done ``` ``` for f in fp/*; do diff -u $f sp/$(basename $f); done ``` comes back empty. I also compiled a semi-randomly picked C++ file from AOSP [Unwinder.cpp](https://cs.android.com/android/platform/superproject/main/+/main:system/unwinding/libunwindstack/Unwinder.cpp?q=Unwinder.cpp&ss=android%2Fplatform%2Fsuperproject%2Fmain) which also compiles to the same Assembly. https://github.com/llvm/llvm-project/pull/86356 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
https://github.com/fmayer edited https://github.com/llvm/llvm-project/pull/86356 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Ignore special symbols as function aliases in updateELFSymbolTable (PR #92713)
https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/92713 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Ignore special symbols as function aliases in updateELFSymbolTable (PR #92713)
https://github.com/maksfb approved this pull request. LGTM. Thanks. https://github.com/llvm/llvm-project/pull/92713 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [BOLT] Ignore special symbols as function aliases in updateELFSymbolTable (PR #92713)
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/92713 >From a32bf63f61f6d382f09982d992f3cabc8dc55cfd Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 19:44:20 -0700 Subject: [PATCH 1/4] drop changes to bolt/test/AArch64/text-data.c Created using spr 1.3.4 --- bolt/test/AArch64/text-data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bolt/test/AArch64/text-data.c b/bolt/test/AArch64/text-data.c index 17e507a7cc1b4..2986fe7840078 100644 --- a/bolt/test/AArch64/text-data.c +++ b/bolt/test/AArch64/text-data.c @@ -3,7 +3,7 @@ // RUN: %clang %cflags %s -o %t.exe -Wl,-q // RUN: llvm-bolt %t.exe -o %t.bolt --lite=0 --use-old-text=0 -// RUN: llvm-objdump -j .bolt.org.text -d --disassemble-symbols=arr %t.bolt | \ +// RUN: llvm-objdump -j .text -d --disassemble-symbols=arr %t.bolt | \ // RUN: FileCheck %s // CHECK: {{.*}} : >From d09b18df4eb75879ef528bfcb43604b86d56860c Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 20:13:19 -0700 Subject: [PATCH 2/4] Address comments Created using spr 1.3.4 --- bolt/lib/Rewrite/RewriteInstance.cpp | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 0d11bdc46fa5a..ba5cec7d9c596 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4789,7 +4789,6 @@ void RewriteInstance::updateELFSymbolTable( continue; Expected SymbolName = Symbol.getName(StringSection); -assert(SymbolName && "cannot get symbol name"); const BinaryFunction *Function = BC->getBinaryFunctionAtAddress(Symbol.st_value); @@ -4798,8 +4797,11 @@ void RewriteInstance::updateELFSymbolTable( if (Function && Symbol.getType() == ELF::STT_SECTION) Function = nullptr; -// Ignore input hot markers as function aliases – markers are handled -// separately. +// Ignore input hot markers as function aliases. +// If hot markers are treated as function aliases, we may create +// non-sensical __hot_start.cold symbols which would not have a parent +// when read by BOLT as we don't register them as function aliases +// (explicitly ignored in parsing symbol table in discoverFileObjects). if (Function && (*SymbolName == "__hot_start" || *SymbolName == "__hot_end")) Function = nullptr; >From b36c250836607410246e6ddf2f855d43df77e80d Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 20:17:15 -0700 Subject: [PATCH 3/4] keep assert Created using spr 1.3.4 --- bolt/lib/Rewrite/RewriteInstance.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index ba5cec7d9c596..e788ca7afd5ad 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4789,6 +4789,7 @@ void RewriteInstance::updateELFSymbolTable( continue; Expected SymbolName = Symbol.getName(StringSection); +assert(SymbolName && "cannot get symbol name"); const BinaryFunction *Function = BC->getBinaryFunctionAtAddress(Symbol.st_value); >From 1a1e2ae769bc6c9c6eb82980349f4ba7b4404aae Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Mon, 20 May 2024 15:49:16 -0700 Subject: [PATCH 4/4] Hoist the special symbol handling Created using spr 1.3.4 --- bolt/lib/Rewrite/RewriteInstance.cpp | 31 ++-- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 98d21bd7b0c77..9cc4c8c8c4faf 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4826,11 +4826,20 @@ void RewriteInstance::updateELFSymbolTable( updateSymbolValue(*SymbolName); ++NumHotTextSymsUpdated; } - // Ignore input hot markers as function aliases. - // If hot markers are treated as function aliases, we may create - // non-sensical __hot_start.cold symbols which would not have a parent - // when read by BOLT as we don't register them as function aliases - // (explicitly ignored in parsing symbol table in discoverFileObjects). + goto registerSymbol; +} + +if (*SymbolName == "__hot_data_start" || *SymbolName == "__hot_data_end") { + if (opts::HotData) { +updateSymbolValue(*SymbolName); +++NumHotDataSymsUpdated; + } + goto registerSymbol; +} + +if (*SymbolName == "_end") { + if (NextAvailableAddress > Symbol.st_value) +updateSymbolValue(*SymbolName, NextAvailableAddress); goto registerSymbol; } @@ -4930,17 +4939,7 @@ void RewriteInstance::updateELFSymbolTable( } } -// Handle special symbols based on their name. -if (opts::HotData && (*SymbolName == "__hot_data_start" || - *SymbolName == "__hot_data_end"))
[llvm-branch-commits] [llvm] [BOLT] Ignore special symbols as function aliases in updateELFSymbolTable (PR #92713)
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/92713 >From a32bf63f61f6d382f09982d992f3cabc8dc55cfd Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 19:44:20 -0700 Subject: [PATCH 1/4] drop changes to bolt/test/AArch64/text-data.c Created using spr 1.3.4 --- bolt/test/AArch64/text-data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bolt/test/AArch64/text-data.c b/bolt/test/AArch64/text-data.c index 17e507a7cc1b4..2986fe7840078 100644 --- a/bolt/test/AArch64/text-data.c +++ b/bolt/test/AArch64/text-data.c @@ -3,7 +3,7 @@ // RUN: %clang %cflags %s -o %t.exe -Wl,-q // RUN: llvm-bolt %t.exe -o %t.bolt --lite=0 --use-old-text=0 -// RUN: llvm-objdump -j .bolt.org.text -d --disassemble-symbols=arr %t.bolt | \ +// RUN: llvm-objdump -j .text -d --disassemble-symbols=arr %t.bolt | \ // RUN: FileCheck %s // CHECK: {{.*}} : >From d09b18df4eb75879ef528bfcb43604b86d56860c Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 20:13:19 -0700 Subject: [PATCH 2/4] Address comments Created using spr 1.3.4 --- bolt/lib/Rewrite/RewriteInstance.cpp | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 0d11bdc46fa5a..ba5cec7d9c596 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4789,7 +4789,6 @@ void RewriteInstance::updateELFSymbolTable( continue; Expected SymbolName = Symbol.getName(StringSection); -assert(SymbolName && "cannot get symbol name"); const BinaryFunction *Function = BC->getBinaryFunctionAtAddress(Symbol.st_value); @@ -4798,8 +4797,11 @@ void RewriteInstance::updateELFSymbolTable( if (Function && Symbol.getType() == ELF::STT_SECTION) Function = nullptr; -// Ignore input hot markers as function aliases – markers are handled -// separately. +// Ignore input hot markers as function aliases. +// If hot markers are treated as function aliases, we may create +// non-sensical __hot_start.cold symbols which would not have a parent +// when read by BOLT as we don't register them as function aliases +// (explicitly ignored in parsing symbol table in discoverFileObjects). if (Function && (*SymbolName == "__hot_start" || *SymbolName == "__hot_end")) Function = nullptr; >From b36c250836607410246e6ddf2f855d43df77e80d Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Sun, 19 May 2024 20:17:15 -0700 Subject: [PATCH 3/4] keep assert Created using spr 1.3.4 --- bolt/lib/Rewrite/RewriteInstance.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index ba5cec7d9c596..e788ca7afd5ad 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4789,6 +4789,7 @@ void RewriteInstance::updateELFSymbolTable( continue; Expected SymbolName = Symbol.getName(StringSection); +assert(SymbolName && "cannot get symbol name"); const BinaryFunction *Function = BC->getBinaryFunctionAtAddress(Symbol.st_value); >From 1a1e2ae769bc6c9c6eb82980349f4ba7b4404aae Mon Sep 17 00:00:00 2001 From: Amir Ayupov Date: Mon, 20 May 2024 15:49:16 -0700 Subject: [PATCH 4/4] Hoist the special symbol handling Created using spr 1.3.4 --- bolt/lib/Rewrite/RewriteInstance.cpp | 31 ++-- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 98d21bd7b0c77..9cc4c8c8c4faf 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4826,11 +4826,20 @@ void RewriteInstance::updateELFSymbolTable( updateSymbolValue(*SymbolName); ++NumHotTextSymsUpdated; } - // Ignore input hot markers as function aliases. - // If hot markers are treated as function aliases, we may create - // non-sensical __hot_start.cold symbols which would not have a parent - // when read by BOLT as we don't register them as function aliases - // (explicitly ignored in parsing symbol table in discoverFileObjects). + goto registerSymbol; +} + +if (*SymbolName == "__hot_data_start" || *SymbolName == "__hot_data_end") { + if (opts::HotData) { +updateSymbolValue(*SymbolName); +++NumHotDataSymsUpdated; + } + goto registerSymbol; +} + +if (*SymbolName == "_end") { + if (NextAvailableAddress > Symbol.st_value) +updateSymbolValue(*SymbolName, NextAvailableAddress); goto registerSymbol; } @@ -4930,17 +4939,7 @@ void RewriteInstance::updateELFSymbolTable( } } -// Handle special symbols based on their name. -if (opts::HotData && (*SymbolName == "__hot_data_start" || - *SymbolName == "__hot_data_end"))
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/86356 >From a64c5d63a4df7f59845291ca0d634466713b1ff8 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Fri, 29 Mar 2024 16:53:52 -0700 Subject: [PATCH 1/5] update Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index a6e236386d5ba..6538abea83290 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -489,7 +489,6 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer( auto *IntptrTy = IRB.getIntPtrTy(M.getDataLayout()); Value *SlotPtr = memtag::getAndroidSlotPtr(IRB, StackMteSlot); -SlotPtr->setName("TLS_SLOT_STACK_MTE"); auto *ThreadLong = IRB.CreateLoad(IntptrTy, SlotPtr); Value *TaggedFP = IRB.CreateOr( memtag::getFP(IRB), >From 8591fb38c7e065862a0814792a368e2983b8b10c Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 29 Apr 2024 14:45:16 -0700 Subject: [PATCH 2/5] api lvl Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index 840635315eee0..e38cce94a5cc0 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -484,7 +484,7 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer( Base->setName("basetag"); auto TargetTriple = Triple(M.getTargetTriple()); if (ClRecordStackHistory == instr && TargetTriple.isAndroid() && - TargetTriple.isAArch64() && !TargetTriple.isAndroidVersionLT(35)) { + TargetTriple.isAArch64() && !TargetTriple.isAndroidVersionLT(36)) { constexpr int StackMteSlot = -3; constexpr uint64_t TagMask = 0xFULL << 56; >From 66fbd757608c44b04d64de3f058ce813b14706fe Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 29 Apr 2024 16:00:09 -0700 Subject: [PATCH 3/5] hidden Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index e38cce94a5cc0..43d82a1234f7a 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -102,7 +102,7 @@ static cl::opt ClRecordStackHistory( cl::values(clEnumVal(none, "Do not record stack ring history"), clEnumVal(instr, "Insert instructions into the prologue for " "storing into the stack ring buffer")), -cl::Hidden, cl::init(instr)); +cl::Hidden, cl::init(none)); static const Align kTagGranuleSize = Align(16); >From 62c281253d2e5b38619b3395bcb5f0aa7cb3e8d8 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 6 May 2024 17:40:16 -0700 Subject: [PATCH 4/5] fp Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp index c86c98eed24f0..491a46e03b1d1 100644 --- a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp @@ -2497,7 +2497,8 @@ AArch64FrameLowering::getFrameIndexReference(const MachineFunction &MF, int FI, return resolveFrameIndexReference( MF, FI, FrameReg, /*PreferFP=*/ - MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress), + MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress) || + MF.getFunction().hasFnAttribute(Attribute::SanitizeMemTag), /*ForSimm=*/false); } >From 79ec757be06ccfb2ed9ae744d945820a8c67fa49 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 20 May 2024 15:20:18 -0700 Subject: [PATCH 5/5] comment Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index 8d53fb1d4c14b..eab3a90e57e20 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -485,8 +485,11 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer( auto TargetTriple = Triple(M.getTargetTriple()); // This is not a stable ABI for now, so only allow in dev builds with API // level 1. + // The ThreadLong format is the same as with HWASan, but the entries for + // stack MTE take two slots (16 bytes). if (ClRecordStackHistory == instr && TargetTriple.isAndroid() && - TargetTriple.isAArch64() && !TargetTriple.isAndroidVe
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/86356 >From a64c5d63a4df7f59845291ca0d634466713b1ff8 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Fri, 29 Mar 2024 16:53:52 -0700 Subject: [PATCH 1/5] update Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index a6e236386d5ba..6538abea83290 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -489,7 +489,6 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer( auto *IntptrTy = IRB.getIntPtrTy(M.getDataLayout()); Value *SlotPtr = memtag::getAndroidSlotPtr(IRB, StackMteSlot); -SlotPtr->setName("TLS_SLOT_STACK_MTE"); auto *ThreadLong = IRB.CreateLoad(IntptrTy, SlotPtr); Value *TaggedFP = IRB.CreateOr( memtag::getFP(IRB), >From 8591fb38c7e065862a0814792a368e2983b8b10c Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 29 Apr 2024 14:45:16 -0700 Subject: [PATCH 2/5] api lvl Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index 840635315eee0..e38cce94a5cc0 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -484,7 +484,7 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer( Base->setName("basetag"); auto TargetTriple = Triple(M.getTargetTriple()); if (ClRecordStackHistory == instr && TargetTriple.isAndroid() && - TargetTriple.isAArch64() && !TargetTriple.isAndroidVersionLT(35)) { + TargetTriple.isAArch64() && !TargetTriple.isAndroidVersionLT(36)) { constexpr int StackMteSlot = -3; constexpr uint64_t TagMask = 0xFULL << 56; >From 66fbd757608c44b04d64de3f058ce813b14706fe Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 29 Apr 2024 16:00:09 -0700 Subject: [PATCH 3/5] hidden Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index e38cce94a5cc0..43d82a1234f7a 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -102,7 +102,7 @@ static cl::opt ClRecordStackHistory( cl::values(clEnumVal(none, "Do not record stack ring history"), clEnumVal(instr, "Insert instructions into the prologue for " "storing into the stack ring buffer")), -cl::Hidden, cl::init(instr)); +cl::Hidden, cl::init(none)); static const Align kTagGranuleSize = Align(16); >From 62c281253d2e5b38619b3395bcb5f0aa7cb3e8d8 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 6 May 2024 17:40:16 -0700 Subject: [PATCH 4/5] fp Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp index c86c98eed24f0..491a46e03b1d1 100644 --- a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp @@ -2497,7 +2497,8 @@ AArch64FrameLowering::getFrameIndexReference(const MachineFunction &MF, int FI, return resolveFrameIndexReference( MF, FI, FrameReg, /*PreferFP=*/ - MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress), + MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress) || + MF.getFunction().hasFnAttribute(Attribute::SanitizeMemTag), /*ForSimm=*/false); } >From 79ec757be06ccfb2ed9ae744d945820a8c67fa49 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 20 May 2024 15:20:18 -0700 Subject: [PATCH 5/5] comment Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index 8d53fb1d4c14b..eab3a90e57e20 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -485,8 +485,11 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer( auto TargetTriple = Triple(M.getTargetTriple()); // This is not a stable ABI for now, so only allow in dev builds with API // level 1. + // The ThreadLong format is the same as with HWASan, but the entries for + // stack MTE take two slots (16 bytes). if (ClRecordStackHistory == instr && TargetTriple.isAndroid() && - TargetTriple.isAArch64() && !TargetTriple.isAndroidVe
[llvm-branch-commits] [llvm] [MTE] add stack frame history buffer (PR #86356)
https://github.com/fmayer updated https://github.com/llvm/llvm-project/pull/86356 >From a64c5d63a4df7f59845291ca0d634466713b1ff8 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Fri, 29 Mar 2024 16:53:52 -0700 Subject: [PATCH 1/6] update Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index a6e236386d5ba..6538abea83290 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -489,7 +489,6 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer( auto *IntptrTy = IRB.getIntPtrTy(M.getDataLayout()); Value *SlotPtr = memtag::getAndroidSlotPtr(IRB, StackMteSlot); -SlotPtr->setName("TLS_SLOT_STACK_MTE"); auto *ThreadLong = IRB.CreateLoad(IntptrTy, SlotPtr); Value *TaggedFP = IRB.CreateOr( memtag::getFP(IRB), >From 8591fb38c7e065862a0814792a368e2983b8b10c Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 29 Apr 2024 14:45:16 -0700 Subject: [PATCH 2/6] api lvl Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index 840635315eee0..e38cce94a5cc0 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -484,7 +484,7 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer( Base->setName("basetag"); auto TargetTriple = Triple(M.getTargetTriple()); if (ClRecordStackHistory == instr && TargetTriple.isAndroid() && - TargetTriple.isAArch64() && !TargetTriple.isAndroidVersionLT(35)) { + TargetTriple.isAArch64() && !TargetTriple.isAndroidVersionLT(36)) { constexpr int StackMteSlot = -3; constexpr uint64_t TagMask = 0xFULL << 56; >From 66fbd757608c44b04d64de3f058ce813b14706fe Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 29 Apr 2024 16:00:09 -0700 Subject: [PATCH 3/6] hidden Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index e38cce94a5cc0..43d82a1234f7a 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -102,7 +102,7 @@ static cl::opt ClRecordStackHistory( cl::values(clEnumVal(none, "Do not record stack ring history"), clEnumVal(instr, "Insert instructions into the prologue for " "storing into the stack ring buffer")), -cl::Hidden, cl::init(instr)); +cl::Hidden, cl::init(none)); static const Align kTagGranuleSize = Align(16); >From 62c281253d2e5b38619b3395bcb5f0aa7cb3e8d8 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 6 May 2024 17:40:16 -0700 Subject: [PATCH 4/6] fp Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp index c86c98eed24f0..491a46e03b1d1 100644 --- a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp @@ -2497,7 +2497,8 @@ AArch64FrameLowering::getFrameIndexReference(const MachineFunction &MF, int FI, return resolveFrameIndexReference( MF, FI, FrameReg, /*PreferFP=*/ - MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress), + MF.getFunction().hasFnAttribute(Attribute::SanitizeHWAddress) || + MF.getFunction().hasFnAttribute(Attribute::SanitizeMemTag), /*ForSimm=*/false); } >From 79ec757be06ccfb2ed9ae744d945820a8c67fa49 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Mon, 20 May 2024 15:20:18 -0700 Subject: [PATCH 5/6] comment Created using spr 1.3.4 --- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp index 8d53fb1d4c14b..eab3a90e57e20 100644 --- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp +++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp @@ -485,8 +485,11 @@ Instruction *AArch64StackTagging::insertBaseTaggedPointer( auto TargetTriple = Triple(M.getTargetTriple()); // This is not a stable ABI for now, so only allow in dev builds with API // level 1. + // The ThreadLong format is the same as with HWASan, but the entries for + // stack MTE take two slots (16 bytes). if (ClRecordStackHistory == instr && TargetTriple.isAndroid() && - TargetTriple.isAArch64() && !TargetTriple.isAndroidVe
[llvm-branch-commits] [clang] [clang-tools-extra] [clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument (PR #92854)
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/92854 This is an enabler for a future patch. >From 29f6855012c917040a84b5f1bfc3f6652c82f668 Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 20 May 2024 16:30:46 -0300 Subject: [PATCH] [clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument This is an enabler for a future patch. --- .../ForwardingReferenceOverloadCheck.cpp | 4 +- .../bugprone/IncorrectEnableIfCheck.cpp | 5 +- .../modernize/UseConstraintsCheck.cpp | 8 ++- clang-tools-extra/clangd/Hover.cpp| 8 ++- clang/include/clang/AST/ASTNodeTraverser.h| 2 +- clang/include/clang/AST/DeclTemplate.h| 17 ++--- clang/include/clang/AST/RecursiveASTVisitor.h | 2 +- clang/include/clang/Sema/Sema.h | 4 +- clang/lib/AST/ASTContext.cpp | 3 +- clang/lib/AST/ASTImporter.cpp | 6 +- clang/lib/AST/DeclPrinter.cpp | 3 +- clang/lib/AST/DeclTemplate.cpp| 17 +++-- clang/lib/AST/JSONNodeDumper.cpp | 2 +- clang/lib/AST/ODRDiagsEmitter.cpp | 12 ++-- clang/lib/AST/ODRHash.cpp | 2 +- clang/lib/AST/TypePrinter.cpp | 4 +- clang/lib/ExtractAPI/DeclarationFragments.cpp | 8 +-- clang/lib/Index/IndexDecl.cpp | 3 +- clang/lib/Sema/HLSLExternalSemaSource.cpp | 48 +++-- clang/lib/Sema/SemaTemplate.cpp | 69 ++- clang/lib/Sema/SemaTemplateDeduction.cpp | 10 +-- clang/lib/Sema/SemaTemplateInstantiate.cpp| 11 +-- .../lib/Sema/SemaTemplateInstantiateDecl.cpp | 9 ++- clang/lib/Serialization/ASTReaderDecl.cpp | 3 +- clang/lib/Serialization/ASTWriterDecl.cpp | 2 +- clang/tools/libclang/CIndex.cpp | 7 +- clang/unittests/AST/ASTImporterTest.cpp | 2 +- 27 files changed, 144 insertions(+), 127 deletions(-) diff --git a/clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp index 36687a8e761e8..c87b3ea7e2616 100644 --- a/clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp @@ -54,7 +54,9 @@ AST_MATCHER(QualType, isEnableIf) { AST_MATCHER_P(TemplateTypeParmDecl, hasDefaultArgument, clang::ast_matchers::internal::Matcher, TypeMatcher) { return Node.hasDefaultArgument() && - TypeMatcher.matches(Node.getDefaultArgument(), Finder, Builder); + TypeMatcher.matches( + Node.getDefaultArgument().getArgument().getAsType(), Finder, + Builder); } AST_MATCHER(TemplateDecl, hasAssociatedConstraints) { return Node.hasAssociatedConstraints(); diff --git a/clang-tools-extra/clang-tidy/bugprone/IncorrectEnableIfCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/IncorrectEnableIfCheck.cpp index 09aaf3e31d5dd..75f1107904fce 100644 --- a/clang-tools-extra/clang-tidy/bugprone/IncorrectEnableIfCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/IncorrectEnableIfCheck.cpp @@ -19,10 +19,11 @@ namespace { AST_MATCHER_P(TemplateTypeParmDecl, hasUnnamedDefaultArgument, ast_matchers::internal::Matcher, InnerMatcher) { if (Node.getIdentifier() != nullptr || !Node.hasDefaultArgument() || - Node.getDefaultArgumentInfo() == nullptr) + Node.getDefaultArgument().getArgument().isNull()) return false; - TypeLoc DefaultArgTypeLoc = Node.getDefaultArgumentInfo()->getTypeLoc(); + TypeLoc DefaultArgTypeLoc = + Node.getDefaultArgument().getTypeSourceInfo()->getTypeLoc(); return InnerMatcher.matches(DefaultArgTypeLoc, Finder, Builder); } diff --git a/clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp index 7a021fe14436a..ea4d99586c711 100644 --- a/clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp @@ -177,9 +177,11 @@ matchTrailingTemplateParam(const FunctionTemplateDecl *FunctionTemplate) { dyn_cast(LastParam)) { if (LastTemplateParam->hasDefaultArgument() && LastTemplateParam->getIdentifier() == nullptr) { - return {matchEnableIfSpecialization( - LastTemplateParam->getDefaultArgumentInfo()->getTypeLoc()), - LastTemplateParam}; + return { + matchEnableIfSpecialization(LastTemplateParam->getDefaultArgument() + .getTypeSourceInfo() + ->getTypeLoc()), + LastTemplateParam}; } } return {}; diff --git a/clang-tools-extra/clangd/Hover.cpp b/clang-tools-extra/clangd/Hover.cpp index 51124ab371b2a..de103e011c708 100644 --- a/clang-tools-extra/clangd/Hover.cpp +++ b/clang-tools-extra/c
[llvm-branch-commits] [clang] [clang-tools-extra] [clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument (PR #92854)
llvmbot wrote: @llvm/pr-subscribers-clang-modules @llvm/pr-subscribers-clang-tools-extra @llvm/pr-subscribers-clangd Author: Matheus Izvekov (mizvekov) Changes This is an enabler for a future patch. --- Patch is 33.99 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/92854.diff 27 Files Affected: - (modified) clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp (+3-1) - (modified) clang-tools-extra/clang-tidy/bugprone/IncorrectEnableIfCheck.cpp (+3-2) - (modified) clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp (+5-3) - (modified) clang-tools-extra/clangd/Hover.cpp (+6-2) - (modified) clang/include/clang/AST/ASTNodeTraverser.h (+1-1) - (modified) clang/include/clang/AST/DeclTemplate.h (+6-11) - (modified) clang/include/clang/AST/RecursiveASTVisitor.h (+1-1) - (modified) clang/include/clang/Sema/Sema.h (+3-1) - (modified) clang/lib/AST/ASTContext.cpp (+2-1) - (modified) clang/lib/AST/ASTImporter.cpp (+3-3) - (modified) clang/lib/AST/DeclPrinter.cpp (+2-1) - (modified) clang/lib/AST/DeclTemplate.cpp (+12-5) - (modified) clang/lib/AST/JSONNodeDumper.cpp (+1-1) - (modified) clang/lib/AST/ODRDiagsEmitter.cpp (+7-5) - (modified) clang/lib/AST/ODRHash.cpp (+1-1) - (modified) clang/lib/AST/TypePrinter.cpp (+2-2) - (modified) clang/lib/ExtractAPI/DeclarationFragments.cpp (+4-4) - (modified) clang/lib/Index/IndexDecl.cpp (+2-1) - (modified) clang/lib/Sema/HLSLExternalSemaSource.cpp (+28-20) - (modified) clang/lib/Sema/SemaTemplate.cpp (+35-34) - (modified) clang/lib/Sema/SemaTemplateDeduction.cpp (+3-7) - (modified) clang/lib/Sema/SemaTemplateInstantiate.cpp (+3-8) - (modified) clang/lib/Sema/SemaTemplateInstantiateDecl.cpp (+4-5) - (modified) clang/lib/Serialization/ASTReaderDecl.cpp (+2-1) - (modified) clang/lib/Serialization/ASTWriterDecl.cpp (+1-1) - (modified) clang/tools/libclang/CIndex.cpp (+3-4) - (modified) clang/unittests/AST/ASTImporterTest.cpp (+1-1) ``diff diff --git a/clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp index 36687a8e761e8..c87b3ea7e2616 100644 --- a/clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp @@ -54,7 +54,9 @@ AST_MATCHER(QualType, isEnableIf) { AST_MATCHER_P(TemplateTypeParmDecl, hasDefaultArgument, clang::ast_matchers::internal::Matcher, TypeMatcher) { return Node.hasDefaultArgument() && - TypeMatcher.matches(Node.getDefaultArgument(), Finder, Builder); + TypeMatcher.matches( + Node.getDefaultArgument().getArgument().getAsType(), Finder, + Builder); } AST_MATCHER(TemplateDecl, hasAssociatedConstraints) { return Node.hasAssociatedConstraints(); diff --git a/clang-tools-extra/clang-tidy/bugprone/IncorrectEnableIfCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/IncorrectEnableIfCheck.cpp index 09aaf3e31d5dd..75f1107904fce 100644 --- a/clang-tools-extra/clang-tidy/bugprone/IncorrectEnableIfCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/IncorrectEnableIfCheck.cpp @@ -19,10 +19,11 @@ namespace { AST_MATCHER_P(TemplateTypeParmDecl, hasUnnamedDefaultArgument, ast_matchers::internal::Matcher, InnerMatcher) { if (Node.getIdentifier() != nullptr || !Node.hasDefaultArgument() || - Node.getDefaultArgumentInfo() == nullptr) + Node.getDefaultArgument().getArgument().isNull()) return false; - TypeLoc DefaultArgTypeLoc = Node.getDefaultArgumentInfo()->getTypeLoc(); + TypeLoc DefaultArgTypeLoc = + Node.getDefaultArgument().getTypeSourceInfo()->getTypeLoc(); return InnerMatcher.matches(DefaultArgTypeLoc, Finder, Builder); } diff --git a/clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp index 7a021fe14436a..ea4d99586c711 100644 --- a/clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp @@ -177,9 +177,11 @@ matchTrailingTemplateParam(const FunctionTemplateDecl *FunctionTemplate) { dyn_cast(LastParam)) { if (LastTemplateParam->hasDefaultArgument() && LastTemplateParam->getIdentifier() == nullptr) { - return {matchEnableIfSpecialization( - LastTemplateParam->getDefaultArgumentInfo()->getTypeLoc()), - LastTemplateParam}; + return { + matchEnableIfSpecialization(LastTemplateParam->getDefaultArgument() + .getTypeSourceInfo() + ->getTypeLoc()), + LastTemplateParam}; } } return {}; diff --git a/clang-tools-extra/clangd/Hover.cpp b/clang-tools-extra/clangd/Hover.cpp index 51124ab371b2a..de103e011c708 100644 --- a/clang-to
[llvm-branch-commits] [clang] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #92855)
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/92855 This solves some ambuguity introduced in P0522 regarding how template template parameters are partially ordered, and should reduce the negative impact of enabling `-frelaxed-template-template-args` by default. When performing template argument deduction, we extend the provisional wording introduced in https://github.com/llvm/llvm-project/pull/89807 so it also covers deduction of class templates. Given the following example: ```C++ template struct A; template struct B; template class TT1, class T5> struct B>; // #1 template struct B>; // #2 template struct B>; ``` Prior to P0522, `#2` was picked. Afterwards, this became ambiguous. This patch restores the pre-P0522 behavior, `#2` is picked again. This has the beneficial side effect of making the following code valid: ```C++ template struct A {}; A v; template class TT> void f(TT); // OK: TT picks 'float' as the default argument for the second parameter. void g() { f(v); } ``` --- Since this changes provisional implementation of CWG2398 which has not been released yet, and already contains a changelog entry, we don't provide a changelog entry here. >From de5b6aa7f6c071440b909327ed7a21fad6c2317e Mon Sep 17 00:00:00 2001 From: Matheus Izvekov Date: Mon, 20 May 2024 01:15:03 -0300 Subject: [PATCH] [clang] Implement CWG2398 provisional TTP matching to class templates This solves some ambuguity introduced in P0522 regarding how template template parameters are partially ordered, and should reduce the negative impact of enabling `-frelaxed-template-template-args` by default. When performing template argument deduction, we extend the provisional wording introduced in https://github.com/llvm/llvm-project/pull/89807 so it also covers deduction of class templates. Given the following example: ```C++ template struct A; template struct B; template class TT1, class T5> struct B>; // #1 template struct B>; // #2 template struct B>; ``` Prior to P0522, `#2` was picked. Afterwards, this became ambiguous. This patch restores the pre-P0522 behavior, `#2` is picked again. This has the beneficial side effect of making the following code valid: ```C++ template struct A {}; A v; template class TT> void f(TT); // OK: TT picks 'float' as the default argument for the second parameter. void g() { f(v); } ``` --- Since this changes provisional implementation of CWG2398 which has not been released yet, and already contains a changelog entry, we don't provide a changelog entry here. --- clang/lib/Sema/SemaTemplate.cpp | 5 +- clang/lib/Sema/SemaTemplateDeduction.cpp | 72 +++ .../CXX/temp/temp.decls/temp.alias/p2.cpp | 5 +- clang/test/SemaTemplate/cwg2398.cpp | 3 - 4 files changed, 51 insertions(+), 34 deletions(-) diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 6af35ac8911bb..b7479cbcdba23 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -1807,6 +1807,8 @@ static void SetNestedNameSpecifier(Sema &S, TagDecl *T, // Returns the template parameter list with all default template argument // information. static TemplateParameterList *GetTemplateParameterList(TemplateDecl *TD) { + if (TD->isImplicit()) +return TD->getTemplateParameters(); // Make sure we get the template parameter list from the most // recent declaration, since that is the only one that is guaranteed to // have all the default template argument information. @@ -1827,7 +1829,8 @@ static TemplateParameterList *GetTemplateParameterList(TemplateDecl *TD) { //template friend struct C; // }; // template struct S; - while (D->getFriendObjectKind() != Decl::FriendObjectKind::FOK_None && + while ((D->isImplicit() || + D->getFriendObjectKind() != Decl::FriendObjectKind::FOK_None) && D->getPreviousDecl()) D = D->getPreviousDecl(); return cast(D)->getTemplateParameters(); diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index f16a07e1a1b34..791e44658bd96 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -583,37 +583,53 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams, return TemplateDeductionResult::Success; auto NewDeduced = DeducedTemplateArgument(Arg); -// Provisional resolution for CWG2398: If Arg is also a template template -// param, and it names a template specialization, then we deduce a -// synthesized template template parameter based on A, but using the TS's -// arguments as defaults. -if (auto *TempArg = dyn_cast_or_null( -Arg.getAsTemplateDecl())) { +// Provisional resolution for CWG2398: If Arg names a template +// specialization, then we deduce a synthesized template template parameter +
[llvm-branch-commits] [clang] [clang] Implement CWG2398 provisional TTP matching to class templates (PR #92855)
llvmbot wrote: @llvm/pr-subscribers-clang Author: Matheus Izvekov (mizvekov) Changes This solves some ambuguity introduced in P0522 regarding how template template parameters are partially ordered, and should reduce the negative impact of enabling `-frelaxed-template-template-args` by default. When performing template argument deduction, we extend the provisional wording introduced in https://github.com/llvm/llvm-project/pull/89807 so it also covers deduction of class templates. Given the following example: ```C++ templatestruct A; template struct B; template class TT1, class T5> struct B >; // #1 template struct B>; // #2 template struct B>; ``` Prior to P0522, `#2` was picked. Afterwards, this became ambiguous. This patch restores the pre-P0522 behavior, `#2` is picked again. This has the beneficial side effect of making the following code valid: ```C++ template struct A {}; A v; template class TT> void f(TT ); // OK: TT picks 'float' as the default argument for the second parameter. void g() { f(v); } ``` --- Since this changes provisional implementation of CWG2398 which has not been released yet, and already contains a changelog entry, we don't provide a changelog entry here. --- Full diff: https://github.com/llvm/llvm-project/pull/92855.diff 4 Files Affected: - (modified) clang/lib/Sema/SemaTemplate.cpp (+4-1) - (modified) clang/lib/Sema/SemaTemplateDeduction.cpp (+44-28) - (modified) clang/test/CXX/temp/temp.decls/temp.alias/p2.cpp (+3-2) - (modified) clang/test/SemaTemplate/cwg2398.cpp (-3) ``diff diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 6af35ac8911bb..b7479cbcdba23 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -1807,6 +1807,8 @@ static void SetNestedNameSpecifier(Sema &S, TagDecl *T, // Returns the template parameter list with all default template argument // information. static TemplateParameterList *GetTemplateParameterList(TemplateDecl *TD) { + if (TD->isImplicit()) +return TD->getTemplateParameters(); // Make sure we get the template parameter list from the most // recent declaration, since that is the only one that is guaranteed to // have all the default template argument information. @@ -1827,7 +1829,8 @@ static TemplateParameterList *GetTemplateParameterList(TemplateDecl *TD) { //template friend struct C; // }; // template struct S; - while (D->getFriendObjectKind() != Decl::FriendObjectKind::FOK_None && + while ((D->isImplicit() || + D->getFriendObjectKind() != Decl::FriendObjectKind::FOK_None) && D->getPreviousDecl()) D = D->getPreviousDecl(); return cast(D)->getTemplateParameters(); diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index f16a07e1a1b34..791e44658bd96 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -583,37 +583,53 @@ DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams, return TemplateDeductionResult::Success; auto NewDeduced = DeducedTemplateArgument(Arg); -// Provisional resolution for CWG2398: If Arg is also a template template -// param, and it names a template specialization, then we deduce a -// synthesized template template parameter based on A, but using the TS's -// arguments as defaults. -if (auto *TempArg = dyn_cast_or_null( -Arg.getAsTemplateDecl())) { +// Provisional resolution for CWG2398: If Arg names a template +// specialization, then we deduce a synthesized template template parameter +// based on A, but using the TS's arguments as defaults. +if (DefaultArguments.size() != 0) { assert(Arg.getKind() == TemplateName::Template); - assert(!TempArg->isExpandedParameterPack()); - + TemplateDecl *TempArg = Arg.getAsTemplateDecl(); TemplateParameterList *As = TempArg->getTemplateParameters(); - if (DefaultArguments.size() != 0) { -assert(DefaultArguments.size() <= As->size()); -SmallVector Params(As->size()); -for (unsigned I = 0; I < DefaultArguments.size(); ++I) - Params[I] = getTemplateParameterWithDefault(S, As->getParam(I), - DefaultArguments[I]); -for (unsigned I = DefaultArguments.size(); I < As->size(); ++I) - Params[I] = As->getParam(I); -// FIXME: We could unique these, and also the parameters, but we don't -// expect programs to contain a large enough amount of these deductions -// for that to be worthwhile. -auto *TPL = TemplateParameterList::Create( -S.Context, SourceLocation(), SourceLocation(), Params, -SourceLocation(
[llvm-branch-commits] [clang] [clang-tools-extra] [clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument (PR #92854)
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/92854 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] Discard SHT_LLVM_LTO sections in relocatable links (PR #92825)
MaskRay wrote: There is a bitcode wrapper (see discussions at https://reviews.llvm.org/D86847), but I agree that discarding `.llvm.lto` is better since concatenated `.llvm.lto` does not reflect the `ld.lld -r ` semantics. https://github.com/llvm/llvm-project/pull/92825 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] Discard SHT_LLVM_LTO sections in relocatable links (PR #92825)
@@ -832,6 +832,15 @@ void ObjFile::initializeSections(bool ignoreComdats, this->sections[i] = createInputSection(i, sec, check(obj.getSectionName(sec, shstrtab))); break; +case SHT_LLVM_LTO: + // When doing a relocatable link with FatLTO objects, if we're not using + // the bitcode, discard it, since it will be concatenated together when + // handling orphan sections, and which will be an invalid bitcode object. + if (config->relocatable && !config->fatLTOObjects) { +sections[i] = &InputSection::discarded; +break; + } + LLVM_FALLTHROUGH; MaskRay wrote: `[[fallthrough]]` since C++17 https://github.com/llvm/llvm-project/pull/92825 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] Discard SHT_LLVM_LTO sections in relocatable links (PR #92825)
@@ -832,6 +832,15 @@ void ObjFile::initializeSections(bool ignoreComdats, this->sections[i] = createInputSection(i, sec, check(obj.getSectionName(sec, shstrtab))); break; +case SHT_LLVM_LTO: + // When doing a relocatable link with FatLTO objects, if we're not using MaskRay wrote: // Discard .llvm.lto in a relocatable link that does not use the bitcode. The concatenated output does not reflect the semantics. In addition, since we do not use the bitcode wrapper format, the concatenated raw bitcode would be invalid. https://github.com/llvm/llvm-project/pull/92825 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] Discard SHT_LLVM_LTO sections in relocatable links (PR #92825)
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/92825 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang-tools-extra] [clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument (PR #92854)
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/92854 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang-tools-extra] [clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument (PR #92854)
@@ -10082,7 +10082,9 @@ class Sema final : public SemaBase { bool SubstTemplateArgument(const TemplateArgumentLoc &Input, const MultiLevelTemplateArgumentList &TemplateArgs, - TemplateArgumentLoc &Output); + TemplateArgumentLoc &Output, + SourceLocation Loc = {}, + const DeclarationName &Entity = {}); Endilll wrote: Changes to both declaration and implementation of `SubstTemplateArgument` doesn't seem related. https://github.com/llvm/llvm-project/pull/92854 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang-tools-extra] [clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument (PR #92854)
https://github.com/Endilll commented: It looks like you have two sets of changes here: 1) the ones related to `TemplateTypeParmDecl::getDefaultArgument()` 2) the ones related to `Sema::SubstTemplateArgument()` You don't seem to touch the latter in PR description. It would be nice if you can explain why you do both sets of changes in one PR, or split the PR in two. https://github.com/llvm/llvm-project/pull/92854 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang-tools-extra] [clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument (PR #92854)
@@ -10082,7 +10082,9 @@ class Sema final : public SemaBase { bool SubstTemplateArgument(const TemplateArgumentLoc &Input, const MultiLevelTemplateArgumentList &TemplateArgs, - TemplateArgumentLoc &Output); + TemplateArgumentLoc &Output, + SourceLocation Loc = {}, + const DeclarationName &Entity = {}); mizvekov wrote: There are a few places we used SubsType, because we only had a type, now we use SubstTemplateArgument. SubstTemplateArgument was missing arguments for setting Instantiation location and entity names. Adding those is needed so we don't regress in diagnostics. https://github.com/llvm/llvm-project/pull/92854 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang-tools-extra] [clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument (PR #92854)
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/92854 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang-tools-extra] [clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument (PR #92854)
@@ -10082,7 +10082,9 @@ class Sema final : public SemaBase { bool SubstTemplateArgument(const TemplateArgumentLoc &Input, const MultiLevelTemplateArgumentList &TemplateArgs, - TemplateArgumentLoc &Output); + TemplateArgumentLoc &Output, + SourceLocation Loc = {}, + const DeclarationName &Entity = {}); Endilll wrote: Can you add this to the description? https://github.com/llvm/llvm-project/pull/92854 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang-tools-extra] [clang] NFCI: use TemplateArgumentLoc for type-param DefaultArgument (PR #92854)
https://github.com/mizvekov edited https://github.com/llvm/llvm-project/pull/92854 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits