Skip to content

Commit 905f987

Browse files
authored
merge main into amd-staging (llvm#2865)
2 parents 2e4aa78 + 0247f88 commit 905f987

File tree

31 files changed

+493
-58
lines changed

31 files changed

+493
-58
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,10 +1088,22 @@ Static Analyzer
10881088
New features
10891089
^^^^^^^^^^^^
10901090

1091-
A new flag - `-static-libclosure` was introduced to support statically linking
1092-
the runtime for the Blocks extension on Windows. This flag currently only
1093-
changes the code generation, and even then, only on Windows. This does not
1094-
impact the linker behaviour like the other `-static-*` flags.
1091+
- A new flag - `-static-libclosure` was introduced to support statically linking
1092+
the runtime for the Blocks extension on Windows. This flag currently only
1093+
changes the code generation, and even then, only on Windows. This does not
1094+
impact the linker behaviour like the other `-static-*` flags.
1095+
- OpenACC support, enabled via `-fopenacc` has reached a level of completeness
1096+
to finally be at least notionally usable. Currently, the OpenACC 3.4
1097+
specification has been completely implemented for Sema and AST creation, so
1098+
nodes will show up in the AST after having been properly checked. Lowering is
1099+
currently a work in progress, with compute, loop, and combined constructs
1100+
partially implemented, plus a handful of data and executable constructs
1101+
implemented. Lowering will only work in Clang-IR mode (so only with a compiler
1102+
built with Clang-IR enabled, and with `-fclangir` used on the command line).
1103+
However, note that the Clang-IR implementation status is also quite partial,
1104+
so frequent 'not yet implemented' diagnostics should be expected. Also, the
1105+
ACC MLIR dialect does not currently implement any lowering to LLVM-IR, so no
1106+
code generation is possible for OpenACC.
10951107

10961108
Crash and bug fixes
10971109
^^^^^^^^^^^^^^^^^^^

clang/lib/Sema/SemaOverload.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3613,20 +3613,20 @@ Sema::MemberPointerConversionResult Sema::CheckMemberPointerConversion(
36133613
QualType FromType, const MemberPointerType *ToPtrType, CastKind &Kind,
36143614
CXXCastPath &BasePath, SourceLocation CheckLoc, SourceRange OpRange,
36153615
bool IgnoreBaseAccess, MemberPointerConversionDirection Direction) {
3616-
const MemberPointerType *FromPtrType = FromType->getAs<MemberPointerType>();
3617-
if (!FromPtrType) {
3618-
// This must be a null pointer to member pointer conversion
3619-
Kind = CK_NullToMemberPointer;
3620-
return MemberPointerConversionResult::Success;
3621-
}
3622-
36233616
// Lock down the inheritance model right now in MS ABI, whether or not the
36243617
// pointee types are the same.
36253618
if (Context.getTargetInfo().getCXXABI().isMicrosoft()) {
36263619
(void)isCompleteType(CheckLoc, FromType);
36273620
(void)isCompleteType(CheckLoc, QualType(ToPtrType, 0));
36283621
}
36293622

3623+
const MemberPointerType *FromPtrType = FromType->getAs<MemberPointerType>();
3624+
if (!FromPtrType) {
3625+
// This must be a null pointer to member pointer conversion
3626+
Kind = CK_NullToMemberPointer;
3627+
return MemberPointerConversionResult::Success;
3628+
}
3629+
36303630
// T == T, modulo cv
36313631
if (Direction == MemberPointerConversionDirection::Upcast &&
36323632
!Context.hasSameUnqualifiedType(FromPtrType->getPointeeType(),

clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,3 +985,10 @@ namespace ContainerOf {
985985
return reinterpret_cast<Node*>(reinterpret_cast<char*>(list) - offset);
986986
}
987987
}
988+
989+
namespace GH144081 {
990+
struct A;
991+
template<int A::*> void f() {}
992+
template void f<nullptr>();
993+
// CHECK-LABEL: define{{.*}} void @"??$f@$0A@@GH144081@@YAXXZ"
994+
} // namespace GH144081

lldb/scripts/framework-header-fix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
# Main header regexes
2222
INCLUDE_FILENAME_REGEX = re.compile(
23-
r'#include "lldb/API/(?P<include_filename>.*){0,1}"'
23+
r'#include "lldb/(API/)?(?P<include_filename>.*){0,1}"'
2424
)
2525

2626
# RPC header regexes
@@ -70,7 +70,7 @@ def modify_main_includes(input_file_path, output_file_path):
7070
r"#include <LLDB/" + match.group("include_filename") + ">",
7171
file_buffer,
7272
)
73-
output_file.write(file_buffer)
73+
output_file.write(file_buffer)
7474

7575

7676
def remove_guards(output_file_path, unifdef_path, unifdef_guards):

lldb/test/Shell/Scripts/Inputs/Main/SBAddress.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// e.g. #include "lldb/API/SBDefines.h" -> #include <LLDB/SBDefines.h>
77
#include "lldb/API/SBDefines.h"
88
#include "lldb/API/SBModule.h"
9+
#include "lldb/lldb-types.h"
910

1011
// Any include guards specified at the command line must be removed.
1112
#ifndef SWIG

lldb/test/Shell/Scripts/TestFrameworkFixScript.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ RUN: cat %t/Outputs/SBAddress.h | FileCheck %s
99
# e.g. #include "lldb/API/SBDefines.h" -> #include <LLDB/SBDefines.h>
1010
CHECK: #include <LLDB/SBDefines.h>
1111
CHECK: #include <LLDB/SBModule.h>
12+
CHECK: #include <LLDB/lldb-types.h>

llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,9 @@ SIPeepholeSDWA::matchSDWAOperand(MachineInstr &MI) {
735735
case AMDGPU::V_ASHRREV_I16_e32:
736736
case AMDGPU::V_LSHLREV_B16_e32:
737737
case AMDGPU::V_LSHRREV_B16_e64:
738+
case AMDGPU::V_LSHRREV_B16_opsel_e64:
738739
case AMDGPU::V_ASHRREV_I16_e64:
740+
case AMDGPU::V_LSHLREV_B16_opsel_e64:
739741
case AMDGPU::V_LSHLREV_B16_e64: {
740742
// from: v_lshrrev_b16_e32 v1, 8, v0
741743
// to SDWA src:v0 src_sel:BYTE_1
@@ -758,11 +760,13 @@ SIPeepholeSDWA::matchSDWAOperand(MachineInstr &MI) {
758760
break;
759761

760762
if (Opcode == AMDGPU::V_LSHLREV_B16_e32 ||
763+
Opcode == AMDGPU::V_LSHLREV_B16_opsel_e64 ||
761764
Opcode == AMDGPU::V_LSHLREV_B16_e64)
762765
return std::make_unique<SDWADstOperand>(Dst, Src1, BYTE_1, UNUSED_PAD);
763766
return std::make_unique<SDWASrcOperand>(
764767
Src1, Dst, BYTE_1, false, false,
765768
Opcode != AMDGPU::V_LSHRREV_B16_e32 &&
769+
Opcode != AMDGPU::V_LSHRREV_B16_opsel_e64 &&
766770
Opcode != AMDGPU::V_LSHRREV_B16_e64);
767771
break;
768772
}

llvm/lib/Target/AMDGPU/VOP2Instructions.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ multiclass VOP2Inst_e64_t16<string opName,
211211
string revOp = opName> {
212212
let OtherPredicates = [Has16BitInsts], True16Predicate = NotHasTrue16BitInsts in {
213213
defm NAME : VOP2Inst<opName, P, node, revOp>;
214+
let SubtargetPredicate = isGFX10Only in {
215+
// V_MAX_I16 etc use VOP3 encoding and allow OP_SEL
216+
def _opsel_e64 : VOP3InstBase <opName#"_vop3", VOP3_Profile<P, VOP3_OPSEL>, node, 1>,
217+
Commutable_REV<revOp#"_vop3_e64", !eq(revOp, opName)>;
218+
}
214219
}
215220
let SubtargetPredicate = UseRealTrue16Insts in {
216221
defm _t16 : VOP2Inst_e64<opName#"_t16", VOPProfile_True16<P>, node, revOp#"_t16">;

llvm/lib/Target/AMDGPU/VOP3Instructions.td

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,16 +2016,14 @@ defm V_DIV_FIXUP_F16 :
20162016
defm V_ADD_NC_U16 : VOP3OpSel_Real_gfx10<0x303>;
20172017
defm V_SUB_NC_U16 : VOP3OpSel_Real_gfx10<0x304>;
20182018

2019-
// FIXME-GFX10-OPSEL: Need to add "selective" opsel support to some of these
2020-
// (they do not support SDWA or DPP).
2021-
defm V_MUL_LO_U16 : VOP3_Real_gfx10_with_name<0x305, "V_MUL_LO_U16", "v_mul_lo_u16">;
2022-
defm V_LSHRREV_B16 : VOP3_Real_gfx10_with_name<0x307, "V_LSHRREV_B16", "v_lshrrev_b16">;
2023-
defm V_ASHRREV_I16 : VOP3_Real_gfx10_with_name<0x308, "V_ASHRREV_I16", "v_ashrrev_i16">;
2024-
defm V_MAX_U16 : VOP3_Real_gfx10_with_name<0x309, "V_MAX_U16", "v_max_u16">;
2025-
defm V_MAX_I16 : VOP3_Real_gfx10_with_name<0x30a, "V_MAX_I16", "v_max_i16">;
2026-
defm V_MIN_U16 : VOP3_Real_gfx10_with_name<0x30b, "V_MIN_U16", "v_min_u16">;
2027-
defm V_MIN_I16 : VOP3_Real_gfx10_with_name<0x30c, "V_MIN_I16", "v_min_i16">;
2028-
defm V_LSHLREV_B16 : VOP3_Real_gfx10_with_name<0x314, "V_LSHLREV_B16", "v_lshlrev_b16">;
2019+
defm V_MUL_LO_U16 : VOP3OpSel_Real_gfx10_with_name<0x305, "V_MUL_LO_U16_opsel", "v_mul_lo_u16">;
2020+
defm V_LSHRREV_B16 : VOP3OpSel_Real_gfx10_with_name<0x307, "V_LSHRREV_B16_opsel", "v_lshrrev_b16">;
2021+
defm V_ASHRREV_I16 : VOP3OpSel_Real_gfx10_with_name<0x308, "V_ASHRREV_I16_opsel", "v_ashrrev_i16">;
2022+
defm V_MAX_U16 : VOP3OpSel_Real_gfx10_with_name<0x309, "V_MAX_U16_opsel", "v_max_u16">;
2023+
defm V_MAX_I16 : VOP3OpSel_Real_gfx10_with_name<0x30a, "V_MAX_I16_opsel", "v_max_i16">;
2024+
defm V_MIN_U16 : VOP3OpSel_Real_gfx10_with_name<0x30b, "V_MIN_U16_opsel", "v_min_u16">;
2025+
defm V_MIN_I16 : VOP3OpSel_Real_gfx10_with_name<0x30c, "V_MIN_I16_opsel", "v_min_i16">;
2026+
defm V_LSHLREV_B16 : VOP3OpSel_Real_gfx10_with_name<0x314, "V_LSHLREV_B16_opsel", "v_lshlrev_b16">;
20292027
defm V_PERMLANE16_B32 : VOP3OpSel_Real_gfx10<0x377>;
20302028
defm V_PERMLANEX16_B32 : VOP3OpSel_Real_gfx10<0x378>;
20312029

llvm/lib/Transforms/Scalar/MergeICmps.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,10 @@ BCECmpChain::BCECmpChain(const std::vector<BasicBlock *> &Blocks, PHINode &Phi,
479479
BaseIdentifier BaseId;
480480
for (BasicBlock *const Block : Blocks) {
481481
assert(Block && "invalid block");
482+
if (Block->hasAddressTaken()) {
483+
LLVM_DEBUG(dbgs() << "cannot merge blocks with blockaddress\n");
484+
return;
485+
}
482486
std::optional<BCECmpBlock> Comparison = visitCmpBlock(
483487
Phi.getIncomingValueForBlock(Block), Block, Phi.getParent(), BaseId);
484488
if (!Comparison) {

0 commit comments

Comments
 (0)