Skip to content

Commit 8b2f656

Browse files
Merge branch 'llvm:main' into main
2 parents 5cebc48 + 05e94c9 commit 8b2f656

File tree

24 files changed

+604
-202
lines changed

24 files changed

+604
-202
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Checks encoding of output file
2+
// This is only required for z/OS.
3+
//
4+
// REQUIRES: system-zos, systemz-registered-target
5+
// RUN: %clang_cc1 -triple s390x-ibm-zos -S %s -o %t.s
6+
// RUN: ls -T %t.s | FileCheck %s
7+
8+
// CHECK: t IBM-1047 T=on
9+
void foo() { return; }

lldb/tools/debugserver/source/MacOSX/MachProcess.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,7 @@ static uint64_t bits(uint64_t value, uint32_t msbit, uint32_t lsbit) {
17391739
ReplyToAllExceptions();
17401740
}
17411741

1742-
m_task.ShutDownExcecptionThread();
1742+
m_task.ShutDownExceptionThread();
17431743

17441744
// Detach from our process
17451745
errno = 0;

lldb/tools/debugserver/source/MacOSX/MachTask.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class MachTask {
6868
bool ExceptionPortIsValid() const;
6969
kern_return_t SaveExceptionPortInfo();
7070
kern_return_t RestoreExceptionPortInfo();
71-
kern_return_t ShutDownExcecptionThread();
71+
void ShutDownExceptionThread();
7272

7373
bool StartExceptionThread(
7474
const RNBContext::IgnoredExceptions &ignored_exceptions, DNBError &err);

lldb/tools/debugserver/source/MacOSX/MachTask.mm

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,8 @@
145145
//----------------------------------------------------------------------
146146
void MachTask::Clear() {
147147
// Do any cleanup needed for this task
148-
if (m_exception_thread)
149-
ShutDownExcecptionThread();
148+
ShutDownExceptionThread();
150149
m_task = TASK_NULL;
151-
m_exception_thread = 0;
152150
m_exception_port = MACH_PORT_NULL;
153151
m_exec_will_be_suspended = false;
154152
m_do_double_resume = false;
@@ -685,8 +683,11 @@ static void get_threads_profile_data(DNBProfileDataScanType scanType,
685683
return false;
686684
}
687685

688-
kern_return_t MachTask::ShutDownExcecptionThread() {
686+
void MachTask::ShutDownExceptionThread() {
689687
DNBError err;
688+
689+
if (!m_exception_thread)
690+
return;
690691

691692
err = RestoreExceptionPortInfo();
692693

@@ -702,6 +703,8 @@ static void get_threads_profile_data(DNBProfileDataScanType scanType,
702703
if (DNBLogCheckLogBit(LOG_TASK) || err.Fail())
703704
err.LogThreaded("::pthread_join ( thread = %p, value_ptr = NULL)",
704705
m_exception_thread);
706+
707+
m_exception_thread = nullptr;
705708

706709
// Deallocate our exception port that we used to track our child process
707710
mach_port_t task_self = mach_task_self();
@@ -713,7 +716,7 @@ static void get_threads_profile_data(DNBProfileDataScanType scanType,
713716
m_exec_will_be_suspended = false;
714717
m_do_double_resume = false;
715718

716-
return err.Status();
719+
return;
717720
}
718721

719722
void *MachTask::ExceptionThread(void *arg) {

llvm/lib/Support/VirtualOutputBackends.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,20 @@ static Error createDirectoriesOnDemand(StringRef OutputPath,
254254
});
255255
}
256256

257+
static sys::fs::OpenFlags generateFlagsFromConfig(OutputConfig Config) {
258+
sys::fs::OpenFlags OF = sys::fs::OF_None;
259+
if (Config.getTextWithCRLF())
260+
OF |= sys::fs::OF_TextWithCRLF;
261+
else if (Config.getText())
262+
OF |= sys::fs::OF_Text;
263+
// Don't pass OF_Append if writting to temporary since OF_Append is
264+
// not Atomic Append
265+
if (Config.getAppend() && !Config.getAtomicWrite())
266+
OF |= sys::fs::OF_Append;
267+
268+
return OF;
269+
}
270+
257271
Error OnDiskOutputFile::tryToCreateTemporary(std::optional<int> &FD) {
258272
// Create a temporary file.
259273
// Insert -%%%%%%%% before the extension (if any), and because some tools
@@ -269,8 +283,9 @@ Error OnDiskOutputFile::tryToCreateTemporary(std::optional<int> &FD) {
269283
return createDirectoriesOnDemand(OutputPath, Config, [&]() -> Error {
270284
int NewFD;
271285
SmallString<128> UniquePath;
286+
sys::fs::OpenFlags OF = generateFlagsFromConfig(Config);
272287
if (std::error_code EC =
273-
sys::fs::createUniqueFile(ModelPath, NewFD, UniquePath))
288+
sys::fs::createUniqueFile(ModelPath, NewFD, UniquePath, OF))
274289
return make_error<TempFileOutputError>(ModelPath, OutputPath, EC);
275290

276291
if (Config.getDiscardOnSignal())
@@ -312,13 +327,7 @@ Error OnDiskOutputFile::initializeFile(std::optional<int> &FD) {
312327
// Not using a temporary file. Open the final output file.
313328
return createDirectoriesOnDemand(OutputPath, Config, [&]() -> Error {
314329
int NewFD;
315-
sys::fs::OpenFlags OF = sys::fs::OF_None;
316-
if (Config.getTextWithCRLF())
317-
OF |= sys::fs::OF_TextWithCRLF;
318-
else if (Config.getText())
319-
OF |= sys::fs::OF_Text;
320-
if (Config.getAppend())
321-
OF |= sys::fs::OF_Append;
330+
sys::fs::OpenFlags OF = generateFlagsFromConfig(Config);
322331
if (std::error_code EC = sys::fs::openFileForWrite(
323332
OutputPath, NewFD, sys::fs::CD_CreateAlways, OF))
324333
return convertToOutputError(OutputPath, EC);

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7044,6 +7044,12 @@ ParseStatus AMDGPUAsmParser::parseNamedBit(StringRef Name,
70447044
if (Name == "a16" && !hasA16())
70457045
return Error(S, "a16 modifier is not supported on this GPU");
70467046

7047+
if (Bit == 0 && Name == "gds") {
7048+
StringRef Mnemo = ((AMDGPUOperand &)*Operands[0]).getToken();
7049+
if (Mnemo.starts_with("ds_gws"))
7050+
return Error(S, "nogds is not allowed");
7051+
}
7052+
70477053
if (isGFX9() && ImmTy == AMDGPUOperand::ImmTyA16)
70487054
ImmTy = AMDGPUOperand::ImmTyR128A16;
70497055

llvm/lib/Target/Xtensa/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ tablegen(LLVM XtensaGenDisassemblerTables.inc -gen-disassembler)
1010
tablegen(LLVM XtensaGenInstrInfo.inc -gen-instr-info)
1111
tablegen(LLVM XtensaGenMCCodeEmitter.inc -gen-emitter)
1212
tablegen(LLVM XtensaGenRegisterInfo.inc -gen-register-info)
13+
tablegen(LLVM XtensaGenSDNodeInfo.inc -gen-sd-node-info)
1314
tablegen(LLVM XtensaGenSubtargetInfo.inc -gen-subtarget)
1415

1516
add_public_tablegen_target(XtensaCommonTableGen)
@@ -22,6 +23,7 @@ add_llvm_target(XtensaCodeGen
2223
XtensaISelDAGToDAG.cpp
2324
XtensaISelLowering.cpp
2425
XtensaRegisterInfo.cpp
26+
XtensaSelectionDAGInfo.cpp
2527
XtensaSubtarget.cpp
2628
XtensaTargetMachine.cpp
2729

llvm/lib/Target/Xtensa/XtensaISelDAGToDAG.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include "MCTargetDesc/XtensaMCTargetDesc.h"
1414
#include "Xtensa.h"
15+
#include "XtensaSelectionDAGInfo.h"
1516
#include "XtensaTargetMachine.h"
1617
#include "llvm/CodeGen/MachineFunction.h"
1718
#include "llvm/CodeGen/MachineRegisterInfo.h"

llvm/lib/Target/Xtensa/XtensaISelLowering.cpp

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "XtensaConstantPoolValue.h"
1616
#include "XtensaInstrInfo.h"
1717
#include "XtensaMachineFunctionInfo.h"
18+
#include "XtensaSelectionDAGInfo.h"
1819
#include "XtensaSubtarget.h"
1920
#include "XtensaTargetMachine.h"
2021
#include "llvm/CodeGen/CallingConvLower.h"
@@ -1510,58 +1511,6 @@ SDValue XtensaTargetLowering::LowerOperation(SDValue Op,
15101511
}
15111512
}
15121513

1513-
const char *XtensaTargetLowering::getTargetNodeName(unsigned Opcode) const {
1514-
switch (Opcode) {
1515-
case XtensaISD::BR_JT:
1516-
return "XtensaISD::BR_JT";
1517-
case XtensaISD::CALL:
1518-
return "XtensaISD::CALL";
1519-
case XtensaISD::CALLW8:
1520-
return "XtensaISD::CALLW8";
1521-
case XtensaISD::EXTUI:
1522-
return "XtensaISD::EXTUI";
1523-
case XtensaISD::MOVSP:
1524-
return "XtensaISD::MOVSP";
1525-
case XtensaISD::PCREL_WRAPPER:
1526-
return "XtensaISD::PCREL_WRAPPER";
1527-
case XtensaISD::RET:
1528-
return "XtensaISD::RET";
1529-
case XtensaISD::RETW:
1530-
return "XtensaISD::RETW";
1531-
case XtensaISD::RUR:
1532-
return "XtensaISD::RUR";
1533-
case XtensaISD::SELECT_CC:
1534-
return "XtensaISD::SELECT_CC";
1535-
case XtensaISD::SELECT_CC_FP:
1536-
return "XtensaISD::SELECT_CC_FP";
1537-
case XtensaISD::SRCL:
1538-
return "XtensaISD::SRCL";
1539-
case XtensaISD::SRCR:
1540-
return "XtensaISD::SRCR";
1541-
case XtensaISD::CMPUO:
1542-
return "XtensaISD::CMPUO";
1543-
case XtensaISD::CMPUEQ:
1544-
return "XtensaISD::CMPUEQ";
1545-
case XtensaISD::CMPULE:
1546-
return "XtensaISD::CMPULE";
1547-
case XtensaISD::CMPULT:
1548-
return "XtensaISD::CMPULT";
1549-
case XtensaISD::CMPOEQ:
1550-
return "XtensaISD::CMPOEQ";
1551-
case XtensaISD::CMPOLE:
1552-
return "XtensaISD::CMPOLE";
1553-
case XtensaISD::CMPOLT:
1554-
return "XtensaISD::CMPOLT";
1555-
case XtensaISD::MADD:
1556-
return "XtensaISD::MADD";
1557-
case XtensaISD::MSUB:
1558-
return "XtensaISD::MSUB";
1559-
case XtensaISD::MOVS:
1560-
return "XtensaISD::MOVS";
1561-
}
1562-
return nullptr;
1563-
}
1564-
15651514
TargetLowering::AtomicExpansionKind
15661515
XtensaTargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const {
15671516
return AtomicExpansionKind::CmpXChg;

llvm/lib/Target/Xtensa/XtensaISelLowering.h

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -20,67 +20,6 @@
2020

2121
namespace llvm {
2222

23-
namespace XtensaISD {
24-
enum {
25-
FIRST_NUMBER = ISD::BUILTIN_OP_END,
26-
BR_JT,
27-
28-
// Calls a function. Operand 0 is the chain operand and operand 1
29-
// is the target address. The arguments start at operand 2.
30-
// There is an optional glue operand at the end.
31-
CALL,
32-
// Call with rotation window by 8 registers
33-
CALLW8,
34-
35-
// Extract unsigned immediate. Operand 0 is value, operand 1
36-
// is bit position of the field [0..31], operand 2 is bit size
37-
// of the field [1..16]
38-
EXTUI,
39-
40-
MOVSP,
41-
42-
// Wraps a TargetGlobalAddress that should be loaded using PC-relative
43-
// accesses. Operand 0 is the address.
44-
PCREL_WRAPPER,
45-
RET,
46-
RETW,
47-
48-
RUR,
49-
50-
// Select with condition operator - This selects between a true value and
51-
// a false value (ops #2 and #3) based on the boolean result of comparing
52-
// the lhs and rhs (ops #0 and #1) of a conditional expression with the
53-
// condition code in op #4
54-
SELECT_CC,
55-
// Select with condition operator - This selects between a true value and
56-
// a false value (ops #2 and #3) based on the boolean result of comparing
57-
// f32 operands lhs and rhs (ops #0 and #1) of a conditional expression
58-
// with the condition code in op #4 and boolean branch kind in op #5
59-
SELECT_CC_FP,
60-
61-
// SRCL(R) performs shift left(right) of the concatenation of 2 registers
62-
// and returns high(low) 32-bit part of 64-bit result
63-
SRCL,
64-
// Shift Right Combined
65-
SRCR,
66-
67-
// Floating point unordered compare conditions
68-
CMPUEQ,
69-
CMPULE,
70-
CMPULT,
71-
CMPUO,
72-
// Floating point compare conditions
73-
CMPOEQ,
74-
CMPOLE,
75-
CMPOLT,
76-
// FP multipy-add/sub
77-
MADD,
78-
MSUB,
79-
// FP move
80-
MOVS,
81-
};
82-
}
83-
8423
class XtensaSubtarget;
8524

8625
class XtensaTargetLowering : public TargetLowering {
@@ -104,8 +43,6 @@ class XtensaTargetLowering : public TargetLowering {
10443

10544
bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;
10645

107-
const char *getTargetNodeName(unsigned Opcode) const override;
108-
10946
bool isFPImmLegal(const APFloat &Imm, EVT VT,
11047
bool ForCodeSize) const override;
11148

0 commit comments

Comments
 (0)