Skip to content

Commit 3a65b4c

Browse files
author
Pavel V Chupin
committed
Merge from 'main' to 'sycl-web' (#5)
CONFLICT (content): Merge conflict in clang/include/clang/Driver/Options.td
2 parents 0824ff0 + b660abc commit 3a65b4c

File tree

324 files changed

+177372
-1238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+177372
-1238
lines changed

clang-tools-extra/clang-move/tool/ClangMove.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ namespace {
3030
std::error_code CreateNewFile(const llvm::Twine &path) {
3131
int fd = 0;
3232
if (std::error_code ec = llvm::sys::fs::openFileForWrite(
33-
path, fd, llvm::sys::fs::CD_CreateAlways, llvm::sys::fs::OF_Text))
33+
path, fd, llvm::sys::fs::CD_CreateAlways,
34+
llvm::sys::fs::OF_TextWithCRLF))
3435
return ec;
3536

3637
return llvm::sys::Process::SafelyCloseFileDescriptor(fd);

clang-tools-extra/modularize/ModuleAssistant.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static bool writeModuleMap(llvm::StringRef ModuleMapPath,
268268

269269
// Set up module map output file.
270270
std::error_code EC;
271-
llvm::ToolOutputFile Out(FilePath, EC, llvm::sys::fs::OF_Text);
271+
llvm::ToolOutputFile Out(FilePath, EC, llvm::sys::fs::OF_TextWithCRLF);
272272
if (EC) {
273273
llvm::errs() << Argv0 << ": error opening " << FilePath << ":"
274274
<< EC.message() << "\n";

clang-tools-extra/pp-trace/PPTrace.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ int main(int argc, const char **argv) {
152152
OptionsParser->getSourcePathList());
153153

154154
std::error_code EC;
155-
llvm::ToolOutputFile Out(OutputFileName, EC, llvm::sys::fs::OF_Text);
155+
llvm::ToolOutputFile Out(OutputFileName, EC, llvm::sys::fs::OF_TextWithCRLF);
156156
if (EC)
157157
error(EC.message());
158158
PPTraceFrontendActionFactory Factory(Filters, Out.os());

clang/include/clang/AST/DeclObjC.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -852,9 +852,7 @@ class ObjCPropertyDecl : public NamedDecl {
852852
bool isClassProperty() const {
853853
return PropertyAttributes & ObjCPropertyAttribute::kind_class;
854854
}
855-
bool isDirectProperty() const {
856-
return PropertyAttributes & ObjCPropertyAttribute::kind_direct;
857-
}
855+
bool isDirectProperty() const;
858856

859857
ObjCPropertyQueryKind getQueryKind() const {
860858
return isClassProperty() ? ObjCPropertyQueryKind::OBJC_PR_query_class :

clang/include/clang/Basic/LangOptions.def

+2
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ LANGOPT(ObjCSubscriptingLegacyRuntime , 1, 0, "Subscripting support in l
309309
BENIGN_LANGOPT(CompatibilityQualifiedIdBlockParamTypeChecking, 1, 0,
310310
"compatibility mode for type checking block parameters "
311311
"involving qualified id types")
312+
LANGOPT(ObjCDisableDirectMethodsForTesting, 1, 0,
313+
"Disable recognition of objc_direct methods")
312314
LANGOPT(CFProtectionBranch , 1, 0, "Control-Flow Branch Protection enabled")
313315
LANGOPT(FakeAddressSpaceMap , 1, 0, "OpenCL fake address space map")
314316
ENUM_LANGOPT(AddressSpaceMapMangling , AddrSpaceMapMangling, 2, ASMM_Target, "OpenCL address space map mangling mode")

clang/include/clang/Basic/riscv_vector.td

+277-17
Original file line numberDiff line numberDiff line change
@@ -200,24 +200,146 @@ class RVVBuiltin<string suffix, string prototype, string type_range,
200200
// Basic classes with automatic codegen.
201201
//===----------------------------------------------------------------------===//
202202

203-
class RVVBinBuiltin<string suffix, string prototype, string type_range>
204-
: RVVBuiltin<suffix, prototype, type_range> {
205-
let IntrinsicTypes = [-1, 1];
206-
}
207-
208-
multiclass RVVBinBuiltinSet<string intrinsic_name, string type_range,
209-
list<list<string>> suffixes_prototypes> {
210-
let IRName = intrinsic_name, IRNameMask = intrinsic_name # "_mask" in {
203+
multiclass RVVBuiltinSet<string intrinsic_name, string type_range,
204+
list<list<string>> suffixes_prototypes,
205+
list<int> intrinsic_types> {
206+
let IRName = intrinsic_name, IRNameMask = intrinsic_name # "_mask",
207+
IntrinsicTypes = intrinsic_types in {
211208
foreach s_p = suffixes_prototypes in {
212209
let Name = NAME # "_" # s_p[0] in {
213210
defvar suffix = s_p[1];
214211
defvar prototype = s_p[2];
215-
def : RVVBinBuiltin<suffix, prototype, type_range>;
212+
def : RVVBuiltin<suffix, prototype, type_range>;
216213
}
217214
}
218215
}
219216
}
220217

218+
// IntrinsicTypes is output, op0, op1 [-1, 0, 1]
219+
multiclass RVVOutOp0Op1BuiltinSet<string intrinsic_name, string type_range,
220+
list<list<string>> suffixes_prototypes> {
221+
defm NAME : RVVBuiltinSet<intrinsic_name, type_range, suffixes_prototypes,
222+
[-1, 0, 1]>;
223+
}
224+
225+
// IntrinsicTypes is output, op1 [-1, 1]
226+
multiclass RVVOutOp1BuiltinSet<string intrinsic_name, string type_range,
227+
list<list<string>> suffixes_prototypes> {
228+
defm "" : RVVBuiltinSet<intrinsic_name, type_range, suffixes_prototypes, [-1, 1]>;
229+
}
230+
231+
multiclass RVVOp0Op1BuiltinSet<string intrinsic_name, string type_range,
232+
list<list<string>> suffixes_prototypes> {
233+
defm "" : RVVBuiltinSet<intrinsic_name, type_range, suffixes_prototypes, [0, 1]>;
234+
}
235+
236+
multiclass RVVOutOp1Op2BuiltinSet<string intrinsic_name, string type_range,
237+
list<list<string>> suffixes_prototypes> {
238+
defm "" : RVVBuiltinSet<intrinsic_name, type_range, suffixes_prototypes, [-1, 1, 2]>;
239+
}
240+
241+
multiclass RVVSignedBinBuiltinSet {
242+
defm "" : RVVOutOp1BuiltinSet<NAME, "csil",
243+
[["vv", "v", "vvv"],
244+
["vx", "v", "vve"]]>;
245+
}
246+
247+
multiclass RVVUnsignedBinBuiltinSet {
248+
defm "" : RVVOutOp1BuiltinSet<NAME, "csil",
249+
[["vv", "Uv", "UvUvUv"],
250+
["vx", "Uv", "UvUvUe"]]>;
251+
}
252+
253+
multiclass RVVIntBinBuiltinSet {
254+
defm "" : RVVSignedBinBuiltinSet;
255+
defm "" : RVVUnsignedBinBuiltinSet;
256+
}
257+
258+
multiclass RVVSignedShiftBuiltinSet {
259+
defm "" : RVVOutOp1BuiltinSet<NAME, "csil",
260+
[["vv", "v", "vvUv"],
261+
["vx", "v", "vvz"]]>;
262+
}
263+
264+
multiclass RVVUnsignedShiftBuiltinSet {
265+
defm "" : RVVOutOp1BuiltinSet<NAME, "csil",
266+
[["vv", "Uv", "UvUvUv"],
267+
["vx", "Uv", "UvUvz"]]>;
268+
}
269+
270+
multiclass RVVShiftBuiltinSet {
271+
defm "" : RVVSignedShiftBuiltinSet;
272+
defm "" : RVVUnsignedShiftBuiltinSet;
273+
}
274+
275+
let Log2LMUL = [-3, -2, -1, 0, 1, 2] in {
276+
multiclass RVVSignedNShiftBuiltinSet {
277+
defm "" : RVVOutOp0Op1BuiltinSet<NAME, "csil",
278+
[["wv", "v", "vwUv"],
279+
["wx", "v", "vwz"]]>;
280+
}
281+
multiclass RVVUnsignedNShiftBuiltinSet {
282+
defm "" : RVVOutOp0Op1BuiltinSet<NAME, "csil",
283+
[["wv", "Uv", "UvUwUv"],
284+
["wx", "Uv", "UvUwz"]]>;
285+
}
286+
}
287+
288+
multiclass RVVIntTerBuiltinSet {
289+
defm "" : RVVOutOp1BuiltinSet<NAME, "csil",
290+
[["vv", "v", "vvvv"],
291+
["vx", "v", "vvev"],
292+
["vv", "Uv", "UvUvUvUv"],
293+
["vx", "Uv", "UvUvUeUv"]]>;
294+
}
295+
296+
multiclass RVVCarryinBuiltinSet {
297+
defm "" : RVVOutOp1BuiltinSet<NAME, "csil",
298+
[["vvm", "v", "vvvm"],
299+
["vxm", "v", "vvem"],
300+
["vvm", "Uv", "UvUvUvm"],
301+
["vxm", "Uv", "UvUvUem"]]>;
302+
}
303+
304+
multiclass RVVCarryOutInBuiltinSet<string intrinsic_name> {
305+
defm "" : RVVOp0Op1BuiltinSet<intrinsic_name, "csil",
306+
[["vvm", "vm", "mvvm"],
307+
["vxm", "vm", "mvem"],
308+
["vvm", "Uvm", "mUvUvm"],
309+
["vxm", "Uvm", "mUvUem"]]>;
310+
}
311+
312+
multiclass RVVSignedMaskOutBuiltinSet {
313+
defm "" : RVVOp0Op1BuiltinSet<NAME, "csil",
314+
[["vv", "vm", "mvv"],
315+
["vx", "vm", "mve"]]>;
316+
}
317+
318+
multiclass RVVUnsignedMaskOutBuiltinSet {
319+
defm "" : RVVOp0Op1BuiltinSet<NAME, "csil",
320+
[["vv", "Uvm", "mUvUv"],
321+
["vx", "Uvm", "mUvUe"]]>;
322+
}
323+
324+
multiclass RVVIntMaskOutBuiltinSet {
325+
defm "" : RVVSignedMaskOutBuiltinSet;
326+
defm "" : RVVUnsignedMaskOutBuiltinSet;
327+
}
328+
329+
multiclass RVVFloatingBinBuiltinSet {
330+
defm "" : RVVOutOp1BuiltinSet<NAME, "fd",
331+
[["vv", "v", "vvv"],
332+
["vf", "v", "vve"]]>;
333+
}
334+
335+
multiclass RVVIntExt<string intrinsic_name, string suffix, string prototype,
336+
string type_range> {
337+
let IRName = intrinsic_name, IRNameMask = intrinsic_name # "_mask",
338+
MangledName = NAME, IntrinsicTypes = [-1, 0] in {
339+
def "" : RVVBuiltin<suffix, prototype, type_range>;
340+
}
341+
}
342+
221343
defvar TypeList = ["c","s","i","l","f","d"];
222344
defvar EEWList = [["8", "(Log2EEW:3)"],
223345
["16", "(Log2EEW:4)"],
@@ -387,14 +509,152 @@ defm : RVVIndexedLoad<"vloxei">;
387509

388510
// 12. Vector Integer Arithmetic Instructions
389511
// 12.1. Vector Single-Width Integer Add and Subtract
390-
defm vadd : RVVBinBuiltinSet<"vadd", "csil",
391-
[["vv", "v", "vvv"],
392-
["vx", "v", "vve"],
393-
["vv", "Uv", "UvUvUv"],
394-
["vx", "Uv", "UvUvUe"]]>;
512+
defm vadd : RVVIntBinBuiltinSet;
513+
defm vsub : RVVIntBinBuiltinSet;
514+
defm vrsub : RVVOutOp1BuiltinSet<"vrsub", "csil",
515+
[["vx", "v", "vve"],
516+
["vx", "Uv", "UvUvUe"]]>;
517+
518+
// 12.2. Vector Widening Integer Add/Subtract
519+
// TODO
520+
521+
// 12.3. Vector Integer Extension
522+
let Log2LMUL = [-3, -2, -1, 0, 1, 2] in {
523+
defm vsext_vf2 : RVVIntExt<"vsext", "w", "wv", "csi">;
524+
defm vzext_vf2 : RVVIntExt<"vzext", "Uw", "UwUv", "csi">;
525+
}
526+
let Log2LMUL = [-3, -2, -1, 0, 1] in {
527+
defm vsext_vf4 : RVVIntExt<"vsext", "q", "qv", "cs">;
528+
defm vzext_vf4 : RVVIntExt<"vzext", "Uq", "UqUv", "cs">;
529+
}
530+
let Log2LMUL = [-3, -2, -1, 0] in {
531+
defm vsext_vf8 : RVVIntExt<"vsext", "o", "ov", "c">;
532+
defm vzext_vf8 : RVVIntExt<"vzext", "Uo", "UoUv", "c">;
533+
}
534+
535+
// 12.4. Vector Integer Add-with-Carry / Subtract-with-Borrow Instructions
536+
let HasMask = false in {
537+
defm vadc : RVVCarryinBuiltinSet;
538+
defm vmadc : RVVCarryOutInBuiltinSet<"vmadc_carry_in">;
539+
defm vmadc : RVVIntMaskOutBuiltinSet;
540+
defm vsbc : RVVCarryinBuiltinSet;
541+
defm vmsbc : RVVCarryOutInBuiltinSet<"vmsbc_borrow_in">;
542+
defm vmsbc : RVVIntMaskOutBuiltinSet;
543+
}
544+
545+
// 12.5. Vector Bitwise Logical Instructions
546+
defm vand : RVVIntBinBuiltinSet;
547+
defm vxor : RVVIntBinBuiltinSet;
548+
defm vor : RVVIntBinBuiltinSet;
549+
550+
// 12.6. Vector Single-Width Bit Shift Instructions
551+
defm vsll : RVVShiftBuiltinSet;
552+
defm vsrl : RVVUnsignedShiftBuiltinSet;
553+
defm vsra : RVVSignedShiftBuiltinSet;
554+
555+
// 12.7. Vector Narrowing Integer Right Shift Instructions
556+
defm vnsrl : RVVUnsignedNShiftBuiltinSet;
557+
defm vnsra : RVVSignedNShiftBuiltinSet;
558+
559+
// 12.8. Vector Integer Comparison Instructions
560+
defm vmseq : RVVIntMaskOutBuiltinSet;
561+
defm vmsne : RVVIntMaskOutBuiltinSet;
562+
defm vmsltu : RVVUnsignedMaskOutBuiltinSet;
563+
defm vmslt : RVVSignedMaskOutBuiltinSet;
564+
defm vmsleu : RVVUnsignedMaskOutBuiltinSet;
565+
defm vmsle : RVVSignedMaskOutBuiltinSet;
566+
defm vmsgtu : RVVOp0Op1BuiltinSet<"vmsgtu", "csil",
567+
[["vx", "Uvm", "mUvUe"]]>;
568+
defm vmsgt : RVVOp0Op1BuiltinSet<"vmsgt", "csil",
569+
[["vx", "vm", "mve"]]>;
570+
571+
// 12.9. Vector Integer Min/Max Instructions
572+
defm vminu : RVVUnsignedBinBuiltinSet;
573+
defm vmin : RVVSignedBinBuiltinSet;
574+
defm vmaxu : RVVUnsignedBinBuiltinSet;
575+
defm vmax : RVVSignedBinBuiltinSet;
576+
577+
// 12.10. Vector Single-Width Integer Multiply Instructions
578+
defm vmul : RVVIntBinBuiltinSet;
579+
defm vmulh : RVVSignedBinBuiltinSet;
580+
defm vmulhu : RVVUnsignedBinBuiltinSet;
581+
defm vmulhsu : RVVOutOp1BuiltinSet<"vmulhsu", "csil",
582+
[["vv", "v", "vvUv"],
583+
["vx", "v", "vvUe"]]>;
584+
585+
// 12.11. Vector Integer Divide Instructions
586+
defm vdivu : RVVUnsignedBinBuiltinSet;
587+
defm vdiv : RVVSignedBinBuiltinSet;
588+
defm vremu : RVVUnsignedBinBuiltinSet;
589+
defm vrem : RVVSignedBinBuiltinSet;
590+
591+
// 12.12. Vector Widening Integer Multiply Instructions
592+
let Log2LMUL = [-3, -2, -1, 0, 1, 2] in {
593+
defm vwmul : RVVOutOp0Op1BuiltinSet<"vwmul", "csi",
594+
[["vv", "w", "wvv"],
595+
["vx", "w", "wve"]]>;
596+
defm vwmulu : RVVOutOp0Op1BuiltinSet<"vwmulu", "csi",
597+
[["vv", "Uw", "UwUvUv"],
598+
["vx", "Uw", "UwUvUe"]]>;
599+
defm vwmulsu : RVVOutOp0Op1BuiltinSet<"vwmulsu", "csi",
600+
[["vv", "w", "wvUv"],
601+
["vx", "w", "wvUe"]]>;
602+
}
603+
604+
// 12.13. Vector Single-Width Integer Multiply-Add Instructions
605+
let HasMaskedOffOperand = false in {
606+
defm vmacc : RVVIntTerBuiltinSet;
607+
defm vnmsac : RVVIntTerBuiltinSet;
608+
defm vmadd : RVVIntTerBuiltinSet;
609+
defm vnmsub : RVVIntTerBuiltinSet;
610+
}
611+
612+
// 12.14. Vector Widening Integer Multiply-Add Instructions
613+
let HasMaskedOffOperand = false,
614+
Log2LMUL = [-3, -2, -1, 0, 1, 2] in {
615+
defm vwmaccu : RVVOutOp1Op2BuiltinSet<"vwmaccu", "csi",
616+
[["vv", "Uw", "UwUwUvUv"],
617+
["vx", "Uw", "UwUwUeUv"]]>;
618+
defm vwmacc : RVVOutOp1Op2BuiltinSet<"vwmacc", "csi",
619+
[["vv", "w", "wwvv"],
620+
["vx", "w", "wwev"]]>;
621+
defm vwmaccsu : RVVOutOp1Op2BuiltinSet<"vwmaccsu", "csi",
622+
[["vv", "w", "wwvUv"],
623+
["vx", "w", "wweUv"]]>;
624+
defm vwmaccus : RVVOutOp1Op2BuiltinSet<"vwmaccus", "csi",
625+
[["vx", "w", "wwUev"]]>;
626+
}
627+
628+
// 12.15. Vector Integer Merge Instructions
629+
// TODO
630+
631+
// 12.16. Vector Integer Move Instructions
632+
// TODO
633+
634+
// 13. Vector Fixed-Point Arithmetic Instructions
635+
// 13.1. Vector Single-Width Saturating Add and Subtract
636+
defm vsaddu : RVVUnsignedBinBuiltinSet;
637+
defm vsadd : RVVSignedBinBuiltinSet;
638+
defm vssubu : RVVUnsignedBinBuiltinSet;
639+
defm vssub : RVVSignedBinBuiltinSet;
640+
641+
// 13.2. Vector Single-Width Averaging Add and Subtract
642+
defm vaaddu : RVVUnsignedBinBuiltinSet;
643+
defm vaadd : RVVSignedBinBuiltinSet;
644+
defm vasubu : RVVUnsignedBinBuiltinSet;
645+
defm vasub : RVVSignedBinBuiltinSet;
646+
647+
// 13.3. Vector Single-Width Fractional Multiply with Rounding and Saturation
648+
defm vsmul : RVVSignedBinBuiltinSet;
649+
650+
// 13.4. Vector Single-Width Scaling Shift Instructions
651+
defm vssrl : RVVUnsignedShiftBuiltinSet;
652+
defm vssra : RVVSignedShiftBuiltinSet;
653+
654+
// 13.5. Vector Narrowing Fixed-Point Clip Instructions
655+
defm vnclipu : RVVUnsignedNShiftBuiltinSet;
656+
defm vnclip : RVVSignedNShiftBuiltinSet;
395657

396658
// 14. Vector Floating-Point Instructions
397659
// 14.2. Vector Single-Width Floating-Point Add/Subtract Instructions
398-
defm vfadd : RVVBinBuiltinSet<"vfadd", "fd",
399-
[["vv", "v", "vvv"],
400-
["vf", "v", "vve"]]>;
660+
defm vfadd : RVVFloatingBinBuiltinSet;

clang/include/clang/Driver/Options.td

+6
Original file line numberDiff line numberDiff line change
@@ -2247,6 +2247,12 @@ def fno_objc_nonfragile_abi : Flag<["-"], "fno-objc-nonfragile-abi">, Group<f_Gr
22472247
def fobjc_sender_dependent_dispatch : Flag<["-"], "fobjc-sender-dependent-dispatch">, Group<f_Group>;
22482248
def foffload_static_lib_EQ : CommaJoined<["-"], "foffload-static-lib=">, Flags<[NoXarchOption, CoreOption]>, Group<offload_lib_Group>;
22492249
def foffload_whole_static_lib_EQ : CommaJoined<["-"], "foffload-whole-static-lib=">, Flags<[NoXarchOption, CoreOption]>, Group<offload_lib_Group>;
2250+
def fobjc_disable_direct_methods_for_testing :
2251+
Flag<["-"], "fobjc-disable-direct-methods-for-testing">,
2252+
Group<f_Group>, Flags<[CC1Option]>,
2253+
HelpText<"Ignore attribute objc_direct so that direct methods can be tested">,
2254+
MarshallingInfoFlag<LangOpts<"ObjCDisableDirectMethodsForTesting">>;
2255+
22502256
def fomit_frame_pointer : Flag<["-"], "fomit-frame-pointer">, Group<f_Group>;
22512257
def fopenmp : Flag<["-"], "fopenmp">, Group<f_Group>, Flags<[CC1Option, NoArgumentUnused, FlangOption, FC1Option]>,
22522258
HelpText<"Parse OpenMP pragmas and generate parallel code.">;

clang/include/clang/Frontend/FrontendOptions.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
#include "clang/Serialization/ModuleFileExtension.h"
1717
#include "llvm/ADT/StringRef.h"
1818
#include <cassert>
19+
#include <map>
1920
#include <memory>
2021
#include <string>
21-
#include <unordered_map>
2222
#include <vector>
2323

2424
namespace llvm {
@@ -404,7 +404,7 @@ class FrontendOptions {
404404
std::string ActionName;
405405

406406
/// Args to pass to the plugins
407-
std::unordered_map<std::string,std::vector<std::string>> PluginArgs;
407+
std::map<std::string, std::vector<std::string>> PluginArgs;
408408

409409
/// The list of plugin actions to run in addition to the normal action.
410410
std::vector<std::string> AddPluginActions;

0 commit comments

Comments
 (0)