Skip to content

Commit 69ed3e8

Browse files
committed
Merge commit 'acdba090f2724335cf6cf6ecbfb68f67f0cd2def' into llvmspirv_pulldown
2 parents fa855a1 + acdba09 commit 69ed3e8

File tree

18 files changed

+153
-154
lines changed

18 files changed

+153
-154
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -766,15 +766,15 @@ bool tools::isTLSDESCEnabled(const ToolChain &TC,
766766
void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
767767
ArgStringList &CmdArgs, const InputInfo &Output,
768768
const InputInfo &Input, bool IsThinLTO) {
769-
const bool IsOSAIX = ToolChain.getTriple().isOSAIX();
770-
const bool IsAMDGCN = ToolChain.getTriple().isAMDGCN();
769+
const llvm::Triple &Triple = ToolChain.getTriple();
770+
const bool IsOSAIX = Triple.isOSAIX();
771+
const bool IsAMDGCN = Triple.isAMDGCN();
771772
const char *Linker = Args.MakeArgString(ToolChain.GetLinkerPath());
772773
const Driver &D = ToolChain.getDriver();
773774
const bool IsFatLTO = Args.hasArg(options::OPT_ffat_lto_objects);
774775
const bool IsUnifiedLTO = Args.hasArg(options::OPT_funified_lto);
775776
if (llvm::sys::path::filename(Linker) != "ld.lld" &&
776-
llvm::sys::path::stem(Linker) != "ld.lld" &&
777-
!ToolChain.getTriple().isOSOpenBSD()) {
777+
llvm::sys::path::stem(Linker) != "ld.lld" && !Triple.isOSOpenBSD()) {
778778
// Tell the linker to load the plugin. This has to come before
779779
// AddLinkerInputs as gold requires -plugin and AIX ld requires -bplugin to
780780
// come before any -plugin-opt/-bplugin_opt that -Wl might forward.
@@ -843,7 +843,7 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
843843
// the plugin.
844844

845845
// Handle flags for selecting CPU variants.
846-
std::string CPU = getCPUName(D, Args, ToolChain.getTriple());
846+
std::string CPU = getCPUName(D, Args, Triple);
847847
if (!CPU.empty())
848848
CmdArgs.push_back(
849849
Args.MakeArgString(Twine(PluginOptPrefix) + ExtraDash + "mcpu=" + CPU));
@@ -974,10 +974,9 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
974974
bool HasRoptr = Args.hasFlag(options::OPT_mxcoff_roptr,
975975
options::OPT_mno_xcoff_roptr, false);
976976
StringRef OptStr = HasRoptr ? "-mxcoff-roptr" : "-mno-xcoff-roptr";
977-
978977
if (!IsOSAIX)
979978
D.Diag(diag::err_drv_unsupported_opt_for_target)
980-
<< OptStr << ToolChain.getTriple().str();
979+
<< OptStr << Triple.str();
981980

982981
if (HasRoptr) {
983982
// The data sections option is on by default on AIX. We only need to error
@@ -1040,7 +1039,7 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
10401039
}
10411040

10421041
if (Args.hasFlag(options::OPT_femulated_tls, options::OPT_fno_emulated_tls,
1043-
ToolChain.getTriple().hasDefaultEmulatedTLS())) {
1042+
Triple.hasDefaultEmulatedTLS())) {
10441043
CmdArgs.push_back(
10451044
Args.MakeArgString(Twine(PluginOptPrefix) + "-emulated-tls"));
10461045
}

libc/config/linux/aarch64/entrypoints.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,6 @@ set(TARGET_LIBM_ENTRYPOINTS
396396
libc.src.math.frexp
397397
libc.src.math.frexpf
398398
libc.src.math.frexpl
399-
libc.src.math.fromfp
400-
libc.src.math.fromfpf
401-
libc.src.math.fromfpl
402-
libc.src.math.fromfpx
403-
libc.src.math.fromfpxf
404-
libc.src.math.fromfpxl
405399
libc.src.math.hypot
406400
libc.src.math.hypotf
407401
libc.src.math.ilogb
@@ -484,12 +478,6 @@ set(TARGET_LIBM_ENTRYPOINTS
484478
libc.src.math.trunc
485479
libc.src.math.truncf
486480
libc.src.math.truncl
487-
libc.src.math.ufromfp
488-
libc.src.math.ufromfpf
489-
libc.src.math.ufromfpl
490-
libc.src.math.ufromfpx
491-
libc.src.math.ufromfpxf
492-
libc.src.math.ufromfpxl
493481
)
494482

495483
if(LIBC_TYPES_HAS_FLOAT128)
@@ -512,8 +500,6 @@ if(LIBC_TYPES_HAS_FLOAT128)
512500
libc.src.math.fminimum_mag_numf128
513501
libc.src.math.fmodf128
514502
libc.src.math.frexpf128
515-
libc.src.math.fromfpf128
516-
libc.src.math.fromfpxf128
517503
libc.src.math.ilogbf128
518504
libc.src.math.ldexpf128
519505
libc.src.math.llogbf128
@@ -531,8 +517,6 @@ if(LIBC_TYPES_HAS_FLOAT128)
531517
libc.src.math.roundf128
532518
libc.src.math.sqrtf128
533519
libc.src.math.truncf128
534-
libc.src.math.ufromfpf128
535-
libc.src.math.ufromfpxf128
536520
)
537521
endif()
538522

libc/config/linux/arm/entrypoints.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,6 @@ set(TARGET_LIBM_ENTRYPOINTS
263263
libc.src.math.frexp
264264
libc.src.math.frexpf
265265
libc.src.math.frexpl
266-
libc.src.math.fromfp
267-
libc.src.math.fromfpf
268-
libc.src.math.fromfpl
269-
libc.src.math.fromfpx
270-
libc.src.math.fromfpxf
271-
libc.src.math.fromfpxl
272266
libc.src.math.hypot
273267
libc.src.math.hypotf
274268
libc.src.math.ilogb
@@ -351,12 +345,6 @@ set(TARGET_LIBM_ENTRYPOINTS
351345
libc.src.math.trunc
352346
libc.src.math.truncf
353347
libc.src.math.truncl
354-
libc.src.math.ufromfp
355-
libc.src.math.ufromfpf
356-
libc.src.math.ufromfpl
357-
libc.src.math.ufromfpx
358-
libc.src.math.ufromfpxf
359-
libc.src.math.ufromfpxl
360348
)
361349

362350
set(TARGET_LLVMLIBC_ENTRYPOINTS

libc/config/linux/riscv/entrypoints.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,6 @@ set(TARGET_LIBM_ENTRYPOINTS
404404
libc.src.math.frexp
405405
libc.src.math.frexpf
406406
libc.src.math.frexpl
407-
libc.src.math.fromfp
408-
libc.src.math.fromfpf
409-
libc.src.math.fromfpl
410-
libc.src.math.fromfpx
411-
libc.src.math.fromfpxf
412-
libc.src.math.fromfpxl
413407
libc.src.math.hypot
414408
libc.src.math.hypotf
415409
libc.src.math.ilogb
@@ -492,12 +486,6 @@ set(TARGET_LIBM_ENTRYPOINTS
492486
libc.src.math.trunc
493487
libc.src.math.truncf
494488
libc.src.math.truncl
495-
libc.src.math.ufromfp
496-
libc.src.math.ufromfpf
497-
libc.src.math.ufromfpl
498-
libc.src.math.ufromfpx
499-
libc.src.math.ufromfpxf
500-
libc.src.math.ufromfpxl
501489
)
502490

503491
if(LIBC_TYPES_HAS_FLOAT128)
@@ -520,8 +508,6 @@ if(LIBC_TYPES_HAS_FLOAT128)
520508
libc.src.math.fminimum_mag_numf128
521509
libc.src.math.fmodf128
522510
libc.src.math.frexpf128
523-
libc.src.math.fromfpf128
524-
libc.src.math.fromfpxf128
525511
libc.src.math.ilogbf128
526512
libc.src.math.ldexpf128
527513
libc.src.math.llogbf128
@@ -539,8 +525,6 @@ if(LIBC_TYPES_HAS_FLOAT128)
539525
libc.src.math.roundf128
540526
libc.src.math.sqrtf128
541527
libc.src.math.truncf128
542-
libc.src.math.ufromfpf128
543-
libc.src.math.ufromfpxf128
544528
)
545529
endif()
546530

libc/docs/math/index.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,21 @@ Basic Operations
190190
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
191191
| frexpf128 | |check| | |check| | | |check| | | | | | | | | |
192192
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
193-
| fromfp | |check| | |check| | |check| | |check| | | | | | | | | |
193+
| fromfp | |check| | | | | | | | | | | | |
194194
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
195-
| fromfpf | |check| | |check| | |check| | |check| | | | | | | | | |
195+
| fromfpf | |check| | | | | | | | | | | | |
196196
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
197-
| fromfpl | |check| | |check| | |check| | |check| | | | | | | | | |
197+
| fromfpl | |check| | | | | | | | | | | | |
198198
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
199-
| fromfpf128 | |check| | |check| | | |check| | | | | | | | | |
199+
| fromfpf128 | |check| | | | | | | | | | | | |
200200
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
201-
| fromfpx | |check| | |check| | |check| | |check| | | | | | | | | |
201+
| fromfpx | |check| | | | | | | | | | | | |
202202
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
203-
| fromfpxf | |check| | |check| | |check| | |check| | | | | | | | | |
203+
| fromfpxf | |check| | | | | | | | | | | | |
204204
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
205-
| fromfpxl | |check| | |check| | |check| | |check| | | | | | | | | |
205+
| fromfpxl | |check| | | | | | | | | | | | |
206206
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
207-
| fromfpxf128 | |check| | |check| | | |check| | | | | | | | | |
207+
| fromfpxf128 | |check| | | | | | | | | | | | |
208208
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
209209
| ilogb | |check| | |check| | |check| | |check| | |check| | | | |check| | |check| | |check| | | |
210210
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
@@ -364,21 +364,21 @@ Basic Operations
364364
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
365365
| truncf128 | |check| | |check| | | |check| | | | | | | | | |
366366
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
367-
| ufromfp | |check| | |check| | |check| | |check| | | | | | | | | |
367+
| ufromfp | |check| | | | | | | | | | | | |
368368
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
369-
| ufromfpf | |check| | |check| | |check| | |check| | | | | | | | | |
369+
| ufromfpf | |check| | | | | | | | | | | | |
370370
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
371-
| ufromfpl | |check| | |check| | |check| | |check| | | | | | | | | |
371+
| ufromfpl | |check| | | | | | | | | | | | |
372372
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
373-
| ufromfpf128 | |check| | |check| | | |check| | | | | | | | | |
373+
| ufromfpf128 | |check| | | | | | | | | | | | |
374374
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
375-
| ufromfpx | |check| | |check| | |check| | |check| | | | | | | | | |
375+
| ufromfpx | |check| | | | | | | | | | | | |
376376
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
377-
| ufromfpxf | |check| | |check| | |check| | |check| | | | | | | | | |
377+
| ufromfpxf | |check| | | | | | | | | | | | |
378378
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
379-
| ufromfpxl | |check| | |check| | |check| | |check| | | | | | | | | |
379+
| ufromfpxl | |check| | | | | | | | | | | | |
380380
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
381-
| ufromfpxf128 | |check| | |check| | | |check| | | | | | | | | |
381+
| ufromfpxf128 | |check| | | | | | | | | | | | |
382382
+------------------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+
383383

384384

lld/ELF/Symbols.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,8 @@ void elf::reportDuplicate(const Symbol &sym, const InputFile *newFile,
539539
if (!d->section && !errSec && errOffset && d->value == errOffset)
540540
return;
541541
if (!d->section || !errSec) {
542-
error("duplicate symbol: " + toString(sym) + "\n>>> defined in " +
543-
toString(sym.file) + "\n>>> defined in " + toString(newFile));
542+
errorOrWarn("duplicate symbol: " + toString(sym) + "\n>>> defined in " +
543+
toString(sym.file) + "\n>>> defined in " + toString(newFile));
544544
return;
545545
}
546546

@@ -564,7 +564,7 @@ void elf::reportDuplicate(const Symbol &sym, const InputFile *newFile,
564564
if (!src2.empty())
565565
msg += src2 + "\n>>> ";
566566
msg += obj2;
567-
error(msg);
567+
errorOrWarn(msg);
568568
}
569569

570570
void Symbol::checkDuplicate(const Defined &other) const {

lld/test/ELF/allow-multiple-definition.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
# RUN: llvm-objdump --no-print-imm-hex -d %t3 | FileCheck %s
1010
# RUN: llvm-objdump --no-print-imm-hex -d %t4 | FileCheck --check-prefix=REVERT %s
1111

12+
# RUN: ld.lld --noinhibit-exec %t2 %t1 -o /dev/null 2>&1 | FileCheck %s --check-prefix=WARN
13+
# WARN: warning: duplicate symbol: _bar
14+
1215
# RUN: ld.lld -z muldefs --fatal-warnings %t1 %t2 -o %t3
1316
# RUN: ld.lld -z muldefs --fatal-warnings %t2 %t1 -o %t4
1417
# RUN: llvm-objdump --no-print-imm-hex -d %t3 | FileCheck %s

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3154,7 +3154,7 @@ AppleObjCRuntimeV2::TaggedPointerVendorExtended::GetClassDescriptor(
31543154
<< m_objc_debug_taggedpointer_ext_payload_lshift) >>
31553155
m_objc_debug_taggedpointer_ext_payload_rshift);
31563156
int64_t data_payload_signed =
3157-
((int64_t)((int64_t)unobfuscated
3157+
((int64_t)((uint64_t)unobfuscated
31583158
<< m_objc_debug_taggedpointer_ext_payload_lshift) >>
31593159
m_objc_debug_taggedpointer_ext_payload_rshift);
31603160

llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,6 +1455,9 @@ SDValue SelectionDAGLegalize::ExpandInsertToVectorThroughStack(SDValue Op) {
14551455
// First store the whole vector.
14561456
SDValue Ch = DAG.getStore(DAG.getEntryNode(), dl, Vec, StackPtr, PtrInfo);
14571457

1458+
// Freeze the index so we don't poison the clamping code we're about to emit.
1459+
Idx = DAG.getFreeze(Idx);
1460+
14581461
// Then store the inserted part.
14591462
if (PartVT.isVector()) {
14601463
SDValue SubStackPtr =

llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ class HWAddressSanitizer {
422422
bool InstrumentLandingPads;
423423
bool InstrumentWithCalls;
424424
bool InstrumentStack;
425+
bool InstrumentGlobals;
425426
bool DetectUseAfterScope;
426427
bool UsePageAliases;
427428
bool UseMatchAllCallback;
@@ -639,11 +640,13 @@ void HWAddressSanitizer::initializeModule() {
639640
// If we don't have personality function support, fall back to landing pads.
640641
InstrumentLandingPads = optOr(ClInstrumentLandingPads, !NewRuntime);
641642

643+
InstrumentGlobals =
644+
!CompileKernel && !UsePageAliases && optOr(ClGlobals, NewRuntime);
645+
642646
if (!CompileKernel) {
643647
createHwasanCtorComdat();
644-
bool InstrumentGlobals = optOr(ClGlobals, NewRuntime);
645648

646-
if (InstrumentGlobals && !UsePageAliases)
649+
if (InstrumentGlobals)
647650
instrumentGlobals();
648651

649652
bool InstrumentPersonalityFunctions =
@@ -787,6 +790,13 @@ bool HWAddressSanitizer::ignoreAccess(Instruction *Inst, Value *Ptr) {
787790
if (SSI && SSI->stackAccessIsSafe(*Inst))
788791
return true;
789792
}
793+
794+
if (isa<GlobalVariable>(getUnderlyingObject(Ptr))) {
795+
if (!InstrumentGlobals)
796+
return true;
797+
// TODO: Optimize inbound global accesses, like Asan `instrumentMop`.
798+
}
799+
790800
return false;
791801
}
792802

llvm/test/CodeGen/AArch64/pr86717.ll

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2+
; RUN: llc < %s -mtriple=aarch64 | FileCheck %s
3+
4+
define <16 x i8> @f(i32 %0) {
5+
; CHECK-LABEL: f:
6+
; CHECK: // %bb.0:
7+
; CHECK-NEXT: sub sp, sp, #16
8+
; CHECK-NEXT: .cfi_def_cfa_offset 16
9+
; CHECK-NEXT: movi v0.2d, #0000000000000000
10+
; CHECK-NEXT: mov w8, #1 // =0x1
11+
; CHECK-NEXT: mov x9, sp
12+
; CHECK-NEXT: sub w8, w8, w0
13+
; CHECK-NEXT: bfxil x9, x8, #0, #4
14+
; CHECK-NEXT: mov w8, #3 // =0x3
15+
; CHECK-NEXT: str q0, [sp]
16+
; CHECK-NEXT: strb w8, [x9]
17+
; CHECK-NEXT: ldr q0, [sp], #16
18+
; CHECK-NEXT: ret
19+
%2 = sub nuw i32 1, %0
20+
%3 = insertelement <16 x i8> zeroinitializer, i8 3, i32 %2
21+
ret <16 x i8> %3
22+
}

0 commit comments

Comments
 (0)