- Mar 24, 2023
-
-
Fangrui Song authored
They have been obsoleted for a long time and D146565 recently removed Clang support.
-
Fangrui Song authored
[Driver][test] Remove remnant mips*-linux-android tests after 805f51f9
-
Heejin Ahn authored
Misc. cleanups for `WebAssemblyDebugValueManager`. - Use `Register` for registers - Simpler for loop iteration - Rename a variable - Reorder methods - Reduce `SmallVector` size for `DBG_VALUE`s to 1; one def usually have a single `DBG_VALUE` attached to it in most cases - Add a few more lines of comments Reviewed By: dschuff Differential Revision: https://reviews.llvm.org/D146743
-
NagaChaitanya Vellanki authored
Fixes https://github.com/llvm/llvm-project/issues/61481 Reviewed By: dang Differential Revision: https://reviews.llvm.org/D146671
-
Cyndy Ishida authored
Sometimes the clang driver will receive a target triple where the deployment version is too low to support the platform + arch. In those cases, the compiler upgrades the final minOS which is what gets recorded ultimately by the linker in LC_BUILD_VERSION. TextAPI should also reuse this logic for capturing minOS in recorded TBDv5 files. Reviewed By: ributzka Differential Revision: https://reviews.llvm.org/D145690
-
Lang Hames authored
-
Chia-hung Duan authored
This reverts commit e0361396.
-
Leonard Chan authored
It's possible to segfault in `DevirtModule::applyICallBranchFunnel` when attempting to call `getCaller` on a call base that was erased in a prior iteration. This can occur when attempting to find devirtualizable calls via `findDevirtualizableCallsForTypeTest` if the vtable passed to llvm.type.test is a global and not a local. The function works by taking the first argument of the llvm.type.test call (which is a vtable), iterating through all uses of it, and adding any relevant all uses that are calls associated with that intrinsic call to a vector. For most cases where the vtable is actually a *local*, this wouldn't be an issue. Take for example: ``` define i32 @fn(ptr %obj) #0 { %vtable = load ptr, ptr %obj %p = call i1 @llvm.type.test(ptr %vtable, metadata !"typeid2") call void @llvm.assume(i1 %p) %fptr = load ptr, ptr %vtable %result = call i32 %fptr(ptr %obj, i32 1) ret i32 %result } ``` `findDevirtualizableCallsForTypeTest` will check the call base ` %result = call i32 %fptr(ptr %obj, i32 1)`, find that it is associated with a virtualizable call from `%vtable`, find all loads for `%vtable`, and add any instances those load results are called into a vector. Now consider the case where instead `%vtable` was the global itself rather than a local: ``` define i32 @fn(ptr %obj) #0 { %p = call i1 @llvm.type.test(ptr @vtable, metadata !"typeid2") call void @llvm.assume(i1 %p) %fptr = load ptr, ptr @vtable %result = call i32 %fptr(ptr %obj, i32 1) ret i32 %result } ``` `findDevirtualizableCallsForTypeTest` should work normally and add one unique call instance to a vector. However, if there are multiple instances where this same global is used for llvm.type.test, like with: ``` define i32 @fn(ptr %obj) #0 { %p = call i1 @llvm.type.test(ptr @vtable, metadata !"typeid2") call void @llvm.assume(i1 %p) %fptr = load ptr, ptr @vtable %result = call i32 %fptr(ptr %obj, i32 1) ret i32 %result } define i32 @fn2(ptr %obj) #0 { %p = call i1 @llvm.type.test(ptr @vtable, metadata !"typeid2") call void @llvm.assume(i1 %p) %fptr = load ptr, ptr @vtable %result = call i32 %fptr(ptr %obj, i32 1) ret i32 %result } ``` Then each call base `%result = call i32 %fptr(ptr %obj, i32 1)` will be added to the vector twice. This is because for either call base `%result = call i32 %fptr(ptr %obj, i32 1) `, we determine it is associated with a virtualizable call from `@vtable`, and then we iterate through all the uses of `@vtable`, which is used across multiple functions. So when scanning the first `%result = call i32 %fptr(ptr %obj, i32 1)`, then both call bases will be added to the vector, but when scanning the second one, both call bases are added again, resulting in duplicate call bases in the CSInfo.CallSites vector. Note this is actually accounted for in every other instance WPD iterates over CallSites. What everything else does is actually add the call base to the `OptimizedCalls` set and just check if it's already in the set. We can't reuse that particular set since it serves a different purpose marking which calls where devirtualized which `applyICallBranchFunnel` explicitly says it doesn't. For this fix, we can just account for duplicates with a map and do the actual replacements afterwards by iterating over the map. Differential Revision: https://reviews.llvm.org/D146267 -
Joseph Huber authored
Summary: The previous patch fixed how we handle emitting atomics for targeting NVPTX directly. This is the only other file that really does that and has atomics and I forgot to update it.
-
Joseph Huber authored
-
Joseph Huber authored
Since Clang 16.0.0 users can target the `NVPTX` architecture directly via `--target=nvptx64-nvidia-cuda`. However, this does not set the atomic inlining size correctly. This leads to spurious warnings and emission of runtime atomics that are never implemented. This patch ensures that we set this to the appropriate pointer width. This will always be 64 in the future as `nvptx64` will only be supported moving forward. Fixes: https://github.com/llvm/llvm-project/issues/61410 Reviewed By: tra Differential Revision: https://reviews.llvm.org/D146750
-
Sam Clegg authored
See the docs in lld/docs/WebAssembly.rst for more on this. This feature unlocks a lot of simplification in the emscripten toolchain since we can represent the JS libraries to wasm-ld as stub libraries. See https://github.com/emscripten-core/emscripten/issues/18875 Differential Revision: https://reviews.llvm.org/D145308
-
NagaChaitanya Vellanki authored
Fixes https://github.com/llvm/llvm-project/issues/61518 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D146503
-
AdityaK authored
Split from: https://reviews.llvm.org/D146565, already reviewed there.
-
Arthur Eubanks authored
makeArrayRef is deprecated.
-
Alexander Yermolovich authored
Fixing a small typo. Reviewed By: clayborg Differential Revision: https://reviews.llvm.org/D146659
-
Gulfem Savrun Yeniceri authored
This reverts commit c2de8ff9. It caused a segmentation fault while running ExecutionEngine tests on Mac. https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-mac-x64/b8785839382041226465/overview
-
AdityaK authored
Reviewers: enh, phosek, srhines, MaskRay thanks to @enh for pointing these out. Differential Revision: https://reviews.llvm.org/D146565
-
Colin Cross authored
Reviewers: ccross, asb, phosek, enh, srhines, hiraditya Putting: https://android.googlesource.com/toolchain/llvm_android/+/refs/heads/master/patches/Enable-targeting-riscv64-linux-android.patch for review. Differential Revision: https://reviews.llvm.org/D146560
-
Kirill Stoimenov authored
-
Alex Langford authored
In ee232506 I moved UnixSignal initialization from lldbTarget to the various platform plugins. This inadvertently broke lldb-server because lldb-server doesn't use Platform plugins. lldb-server still needs to be able to create a UnixSignals object for the host platform so we can add the relevant platform plugin to lldb-server to make sure we always have a HostPlatform. Differential Revision: https://reviews.llvm.org/D146668
-
Nick Desaulniers authored
When GCC added support for stack smashing protections, it was defined that: > This hook returns a CALL_EXPR that alerts the runtime that the stack > protect guard variable has been modified. This expression should > involve a call to a noreturn function. > The default version of this hook invokes a function called > ‘__stack_chk_fail’, taking no arguments. Do so as well for __stack_smash_handler for OpenBSD. Every libc implementation I could find has __stack_chk_fail marked noreturn, or the implementation calls abort, exit, or panic (which themselves are noreturn). Glibc: https://sourceware.org/git/?p=glibc.git;a=blob;f=debug/stack_chk_fail.c Musl: https://git.musl-libc.org/cgit/musl/tree/src/env/__stack_chk_fail.c Bionic: https://android.googlesource.com/platform/bionic/+/refs/heads/master/libc/bionic/__stack_chk_fail.cpp FreeBSD: https://cgit.freebsd.org/src/tree/lib/libc/secure/stack_protector.c OpenBSD: https://github.com/openbsd/src/blob/master/lib/libc/sys/stack_protector.c NetBSD: https://github.com/NetBSD/src/blob/trunk/lib/libc/misc/stack_protector.c Linux Kernel: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/panic.c Apple: https://opensource.apple.com/source/Libc/Libc-1439.40.11/sys/OpenBSD/stack_protector.c.auto.html Link: https://gcc.gnu.org/onlinedocs/gccint/Stack-Smashing-Protection.html#Stack-Smashing-Protection This will later help us diagnose functions that fall through to other functions vs end in calls to functions that are noreturn. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D146339
-
Chia-hung Duan authored
Add Timer and TimingManager which provide convenient way to meause the execution time of code snippets. The output looks like, ``` -- Average Operation Time -- -- Name (# of Calls) -- 1747.2(ns) popBatch (59) 92.3(ns) popBatchImpl (73) 101.6(ns) EmptyBatchProcess (5) 2587.0(ns) pushBlocksImpl (13) ``` Note that `EmptyBatchProcess` is nested under the timer `popBatchImpl`. Reviewed By: cferris Differential Revision: https://reviews.llvm.org/D143626 -
Simon Pilgrim authored
-
Alex Brachet authored
Differential Revision: https://reviews.llvm.org/D146740
-
Nicolas Vasilache authored
Vector dialect patterns have grown enormously in the past year to a point where they are now impenetrable. Start reorganizing them towards finer-grained control. Differential Revision: https://reviews.llvm.org/D146736
-
Julian Lettner authored
My recent change [1] extended the external-swift-debugging.cpp test, but didn't account for PAC under which function pointers aren't trivially comparable. We could use `ptrauth_strip()`, but for the test it's easier to just the symbol name. [1] https://reviews.llvm.org/D146264
-
Nicolas Vasilache authored
Differential Revision: https://reviews.llvm.org/D146742
-
Momchil Velikov authored
Reviewed By: mkazantsev Differential Revision: https://reviews.llvm.org/D145705
-
Simon Pilgrim authored
We don't need an explicit AND mask, we can use KnownBits to determine if each element has (the same) single non-zero bit and shift that into the msb/signbit for MOVMSK to access directly.
-
Paul Kirth authored
When fixing the test earlier, we missed the JSON case for NaN and INF, so handle those the same as for non-JSON, by creating the string dynamically. Reviewed By: abhina.sreeskantharajan Differential Revision: https://reviews.llvm.org/D146739
-
Emilia Dreamer authored
The trailing return type arrow checker verifies that a declaration is being parsed, however, this isn't true when inside of macros. It turns out the existence of the auto keyword is enough to make sure that we're dealing with a trailing return type, and whether we're in a declaration doesn't matter. Fixes https://github.com/llvm/llvm-project/issues/47664 Reviewed By: HazardyKnusperkeks, owenpan Differential Revision: https://reviews.llvm.org/D141811
-
Momchil Velikov authored
Reviewed By: mkazantsev Differential Revision: https://reviews.llvm.org/D143892
-
Mike Hommey authored
Building with -DLIBCXX_ENABLE_THREADS=OFF -DLIBCXXABI_ENABLE_THREADS=OFF (like e.g. for wasm) fails after D146228 because of a misplaced std namespace begin/end. Reviewed By: philnik, #libc Differential Revision: https://reviews.llvm.org/D146682
-
Hristo Hristov authored
Implemented [[ https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2711r1.html | P2711R1 ]] for existing views. (`join_with_view` is not yet implemented) Reviewed By: #libc, philnik Differential Revision: https://reviews.llvm.org/D144822
-
Viktoriia Bakalova authored
-
Fangrui Song authored
Close #61322 Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D146603
-
Alex Brachet authored
Differential Revision: https://reviews.llvm.org/D146738
-
Michael Jones authored
The printf and fprintf implementations use our internal implementation to improve performance when it's available, but this patch enables using the public FILE API for overlay mode. Reviewed By: sivachandra, lntue Differential Revision: https://reviews.llvm.org/D146001
-
Jeff Byrnes authored
ArgPromotion currently produces phantom / dead loads. A good example of this is store-into-inself.ll. First, ArgPromo finds the promotable argument %p in @l. Then it inserts a load of %p in the caller, and passes instead the loaded value / transforms the function body. PromoteMem2Reg is able to optimize out the entire function body, resulting in an unused argument. In a subsequent ArgPromotion pass, it removes the dead argument, resulting in a dead load in the caller. These dead loads may reduce effectiveness of other transformations (e.g. SimplifyCFG, MergedLoadStoreMotion). This patch removes loads and geps that are made dead in the caller after removal of dead args. Differential Revision: https://reviews.llvm.org/D146327
-