- Aug 19, 2020
-
-
Yaxun (Sam) Liu authored
This patch introduces support of target id by -offload-arch. Differential Revision: https://reviews.llvm.org/D60620
-
Ronak Chauhan authored
Decode AMDGPU Kernel descriptors as assembler directives. Reviewed By: scott.linder Differential Revision: https://reviews.llvm.org/D80713
-
aartbik authored
I forgot to address this in previous CL. Sorry about that. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D86188
-
Julian Lettner authored
`dispatch_async_and_wait()` was introduced in macOS 10.14. Let's forward declare it to ensure we can compile the test with older SDKs and guard execution by checking if the symbol is available. (We can't use `__builtin_available()`, because that itself requires a higher minimum deployment target.) We also need to specify the `-undefined dynamic_lookup` compiler flag. Differential Revision: https://reviews.llvm.org/D85995
-
Julian Lettner authored
`dispatch_async_and_wait()` was introduced in macOS 10.14, which is greater than our minimal deployment target. We need to forward declare it as a "weak import" to ensure we generate a weak reference so the TSan dylib continues to work on older systems. We cannot simply `#include <dispatch.h>` or use the Darwin availability macros since this file is multi-platform. In addition, we want to prevent building these interceptors at all when building with older SDKs because linking always fails. Before: ``` ➤ dyldinfo -bind ./lib/clang/12.0.0/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib | grep dispatch_async_and_wait __DATA __interpose 0x000F5E68 pointer 0 libSystem _dispatch_async_and_wait_f ``` After: ``` ➤ dyldinfo -bind ./lib/clang/12.0.0/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib | grep dispatch_async_and_wait __DATA __got 0x000EC0A8 pointer 0 libSystem _dispatch_async_and_wait (weak import) __DATA __interpose 0x000F5E78 pointer 0 libSystem _dispatch_async_and_wait (weak import) ``` This is a follow-up to D85854 and should fix: https://reviews.llvm.org/D85854#2221529 Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D86103
-
Julian Lettner authored
The linker errors caused by this revision have been addressed. Add interceptors for `dispatch_async_and_wait[_f]()` which was added in macOS 10.14. This pair of functions is similar to `dispatch_sync()`, but does not force a context switch of the queue onto the caller thread when the queue is active (and hence is more efficient). For TSan, we can apply the same semantics as for `dispatch_sync()`. From the header docs: > Differences with dispatch_sync() > > When the runtime has brought up a thread to invoke the asynchronous > workitems already submitted to the specified queue, that servicing > thread will also be used to execute synchronous work submitted to the > queue with dispatch_async_and_wait(). > > However, if the runtime has not brought up a thread to service the > specified queue (because it has no workitems enqueued, or only > synchronous workitems), then dispatch_async_and_wait() will invoke the > workitem on the calling thread, similar to the behaviour of functions > in the dispatch_sync family. Additional context: > The guidance is to use `dispatch_async_and_wait()` instead of > `dispatch_sync()` when it is necessary to mix async and sync calls on > the same queue. `dispatch_async_and_wait()` does not guarantee > execution on the caller thread which allows to reduce context switches > when the target queue is active. > https://gist.github.com/tclementdev/6af616354912b0347cdf6db159c37057 rdar://35757961 Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D85854
-
Mehdi Amini authored
This changes the behavior of constructing MLIRContext to no longer load globally registered dialects on construction. Instead Dialects are only loaded explicitly on demand: - the Parser is lazily loading Dialects in the context as it encounters them during parsing. This is the only purpose for registering dialects and not load them in the context. - Passes are expected to declare the dialects they will create entity from (Operations, Attributes, or Types), and the PassManager is loading Dialects into the Context when starting a pipeline. This changes simplifies the configuration of the registration: a compiler only need to load the dialect for the IR it will emit, and the optimizer is self-contained and load the required Dialects. For example in the Toy tutorial, the compiler only needs to load the Toy dialect in the Context, all the others (linalg, affine, std, LLVM, ...) are automatically loaded depending on the optimization pipeline enabled. To adjust to this change, stop using the existing dialect registration: the global registry will be removed soon. 1) For passes, you need to override the method: virtual void getDependentDialects(DialectRegistry ®istry) const {} and registery on the provided registry any dialect that this pass can produce. Passes defined in TableGen can provide this list in the dependentDialects list field. 2) For dialects, on construction you can register dependent dialects using the provided MLIRContext: `context.getOrLoadDialect<DialectName>()` This is useful if a dialect may canonicalize or have interfaces involving another dialect. 3) For loading IR, dialect that can be in the input file must be explicitly registered with the context. `MlirOptMain()` is taking an explicit registry for this purpose. See how the standalone-opt.cpp example is setup: mlir::DialectRegistry registry; registry.insert<mlir::standalone::StandaloneDialect>(); registry.insert<mlir::StandardOpsDialect>(); Only operations from these two dialects can be in the input file. To include all of the dialects in MLIR Core, you can populate the registry this way: mlir::registerAllDialects(registry); 4) For `mlir-translate` callback, as well as frontend, Dialects can be loaded in the context before emitting the IR: context.getOrLoadDialect<ToyDialect>() Differential Revision: https://reviews.llvm.org/D85622 -
Mehdi Amini authored
This reverts commit d14cf457. The build is broken with GCC-5.
-
River Riddle authored
The documentation needs a refresh now that "kinds" are no longer a concept. This revision also adds mentions to a few other new concepts, e.g. traits and interfaces. Differential Revision: https://reviews.llvm.org/D86182
-
Brad Smith authored
-
Changpeng Fang authored
Summary: When the resource descriptor is of vgpr, we need a waterfall loop to read into a sgpr. In this patchm we generalized the implementation to work for any regster class sizes, and extend the work to MIMG instructions. Fixes: SWDEV-223405 Reviewers: arsenm, nhaehnle Differential Revision: https://reviews.llvm.org/D82603
-
Mehdi Amini authored
This changes the behavior of constructing MLIRContext to no longer load globally registered dialects on construction. Instead Dialects are only loaded explicitly on demand: - the Parser is lazily loading Dialects in the context as it encounters them during parsing. This is the only purpose for registering dialects and not load them in the context. - Passes are expected to declare the dialects they will create entity from (Operations, Attributes, or Types), and the PassManager is loading Dialects into the Context when starting a pipeline. This changes simplifies the configuration of the registration: a compiler only need to load the dialect for the IR it will emit, and the optimizer is self-contained and load the required Dialects. For example in the Toy tutorial, the compiler only needs to load the Toy dialect in the Context, all the others (linalg, affine, std, LLVM, ...) are automatically loaded depending on the optimization pipeline enabled. To adjust to this change, stop using the existing dialect registration: the global registry will be removed soon. 1) For passes, you need to override the method: virtual void getDependentDialects(DialectRegistry ®istry) const {} and registery on the provided registry any dialect that this pass can produce. Passes defined in TableGen can provide this list in the dependentDialects list field. 2) For dialects, on construction you can register dependent dialects using the provided MLIRContext: `context.getOrLoadDialect<DialectName>()` This is useful if a dialect may canonicalize or have interfaces involving another dialect. 3) For loading IR, dialect that can be in the input file must be explicitly registered with the context. `MlirOptMain()` is taking an explicit registry for this purpose. See how the standalone-opt.cpp example is setup: mlir::DialectRegistry registry; registry.insert<mlir::standalone::StandaloneDialect>(); registry.insert<mlir::StandardOpsDialect>(); Only operations from these two dialects can be in the input file. To include all of the dialects in MLIR Core, you can populate the registry this way: mlir::registerAllDialects(registry); 4) For `mlir-translate` callback, as well as frontend, Dialects can be loaded in the context before emitting the IR: context.getOrLoadDialect<ToyDialect>() Differential Revision: https://reviews.llvm.org/D85622 -
Chuanqi Xu authored
StackLifetime class collects lifetime marker of an `alloca` by collect the user of `BitCast` who is the user of the `alloca`. However, either the `alloca` itself could be used with the lifetime marker or the `BitCast` of the `alloca` could be transformed to other instructions. (e.g., it may be transformed to all zero reps in `InstCombine` pass). This patch tries to fix this process in `collectMarkers` functions. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D85399
-
River Riddle authored
This greatly simplifies a large portion of the underlying infrastructure, allows for lookups of singleton classes to be much more efficient and always thread-safe(no locking). As a result of this, the dialect symbol registry has been removed as it is no longer necessary. For users broken by this change, an alert was sent out(https://llvm.discourse.group/t/removing-kinds-from-attributes-and-types) that helps prevent a majority of the breakage surface area. All that should be necessary, if the advice in that alert was followed, is removing the kind passed to the ::get methods. Differential Revision: https://reviews.llvm.org/D86121
-
Elliott Hughes authored
Summary: Caught by HWASAN on arm64 Android (which uses ld128 for long double). This was running the existing fuzzer. The specific minimized fuzz input to reproduce this is: __cxa_demangle("1\006ILeeeEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE", 0, 0, 0); Reviewers: eugenis, srhines, #libc_abi! Subscribers: kristof.beyls, danielkiss, libcxx-commits Tags: #libc_abi Differential Revision: https://reviews.llvm.org/D77924 -
Brad Smith authored
-
Jonas Devlieghere authored
-
Mehdi Amini authored
This reverts commit e1de2b75. Broke a build bot.
-
Craig Topper authored
Building on the backend support from D85165. This parses the command line option in the driver, passes it on to CC1 and adds a function attribute. -Still need to support tune on the target attribute. -Need to use "generic" as the tuning by default. But need to change generic in the backend first. -Need to set tune if march is specified and mtune isn't. -May need to disable getHostCPUName's ability to guess CPU name from features when it doesn't have a family/model match for mtune=native. That's what gcc appears to do. Differential Revision: https://reviews.llvm.org/D85384
-
Roman Lebedev authored
Now that we no longer require for this map to have stable iteration order, we no longer need to pay for keeping the iteration order stable, so switch from `SmallMapVector` to `SmallDenseMap`.
-
Nithin Vadukkumchery Rajendrakumar authored
Summary: Make exactly single NodeBuilder exists at any given time Reviewers: NoQ, Szelethus, vsavchenko, xazax.hun Reviewed By: NoQ Subscribers: martong, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D85796
-
Roman Lebedev authored
While it may seem like we can just "deduplicate" the case where some basic block happens to be a predecessor more than once, which happens for e.g. switches, that is not correct thing to do. We must actually add a PHI operand for each predecessor. This was initially reported to me by David Major as a clang crash during gecko build for android.
-
-
Sterling Augustine authored
Although it works fine with glibc, as currently implemented the frameheader cache is incompatible with certain platforms with slightly different locking semantics inside dl_iterate_phdr. Therefore only enable it when it is turned on explicitly with a configure-time option. Differential Revision: https://reviews.llvm.org/D86163
-
Craig Topper authored
These instructions weren't in the initial version of MMX, but were added when SSE1 was introduced. We already have the intrinsic named correctly to include sse and the frontened header enforces sse. We have one place in the backend where we DAG combine to this intrinsic, but that's also qualified. So don't know of anything currently broken unless someone writes their own IR and doesn't set the sse feature.
-
Mehdi Amini authored
This changes the behavior of constructing MLIRContext to no longer load globally registered dialects on construction. Instead Dialects are only loaded explicitly on demand: - the Parser is lazily loading Dialects in the context as it encounters them during parsing. This is the only purpose for registering dialects and not load them in the context. - Passes are expected to declare the dialects they will create entity from (Operations, Attributes, or Types), and the PassManager is loading Dialects into the Context when starting a pipeline. This changes simplifies the configuration of the registration: a compiler only need to load the dialect for the IR it will emit, and the optimizer is self-contained and load the required Dialects. For example in the Toy tutorial, the compiler only needs to load the Toy dialect in the Context, all the others (linalg, affine, std, LLVM, ...) are automatically loaded depending on the optimization pipeline enabled. To adjust to this change, stop using the existing dialect registration: the global registry will be removed soon. 1) For passes, you need to override the method: virtual void getDependentDialects(DialectRegistry ®istry) const {} and registery on the provided registry any dialect that this pass can produce. Passes defined in TableGen can provide this list in the dependentDialects list field. 2) For dialects, on construction you can register dependent dialects using the provided MLIRContext: `context.getOrLoadDialect<DialectName>()` This is useful if a dialect may canonicalize or have interfaces involving another dialect. 3) For loading IR, dialect that can be in the input file must be explicitly registered with the context. `MlirOptMain()` is taking an explicit registry for this purpose. See how the standalone-opt.cpp example is setup: mlir::DialectRegistry registry; mlir::registerDialect<mlir::standalone::StandaloneDialect>(); mlir::registerDialect<mlir::StandardOpsDialect>(); Only operations from these two dialects can be in the input file. To include all of the dialects in MLIR Core, you can populate the registry this way: mlir::registerAllDialects(registry); 4) For `mlir-translate` callback, as well as frontend, Dialects can be loaded in the context before emitting the IR: context.getOrLoadDialect<ToyDialect>() -
MaheshRavishankar authored
LinalgDistribution options to allow more general distributions. Changing the signature of the callback to send in the ranges for all the parallel loops and expect a vector with the Value to use for the processor-id and number-of-processors for each of the parallel loops. Differential Revision: https://reviews.llvm.org/D86095
-
David Blaikie authored
Originally committed as be3ef93b. Reverted by b4bffdba due to bot failures: http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/17380/testReport/junit/LLVM/DebugInfo_X86/addr_tu_to_non_tu_ll/ http://45.33.8.238/win/22216/step_11.txt MacOS failure due to testing Split DWARF which isn't compatible with MachO. Windows failure due to testing type units which aren't enabled on Windows. Fix both of these by applying an explicit x86 linux triple to the test.
-
Zequan Wu authored
[Coverage] Adjust skipped regions only if {Prev,Next}TokLoc is in the same file as regions' {start, end}Loc Fix a bug if {Prev, Next}TokLoc is in different file from skipped regions' {start, end}Loc Differential Revision: https://reviews.llvm.org/D86116 -
Greg Clayton authored
Checking if an object file is in memory should use the ObjectFile::IsInMemory(), not test ObjectFile::BaseAddress(). ObjectFile::BaseAddress() is designed to be overridden by all classes and is for mach-o, ELF and COFF plug-ins. They find the header base adddress and return that as a section offset address. The default implementation of ObjectFile::BaseAddress() does try and make an Address() from the ObjectFile::m_memory_addr, but I switched it to a correct function call. Differential Revision: https://reviews.llvm.org/D86122
-
Sanjay Patel authored
-
Marius Brehler authored
Adds a call to mlir_check_all_link_libraries() to check all libraries linked into standalone-opt.
-
Eli Friedman authored
We probably want to introduce pseudo-instructions at some point, like we have for binary operations, but this seems okay for now. One thing I'm not sure about is whether we should be doing this as a DAGCombine instead of directly pattern-matching it. I don't see any big downside to doing it this way, though. Differential Revision: https://reviews.llvm.org/D85681
-
Eli Friedman authored
This isn't necessaary for ACLE, but could be useful in other situations. And the change is simple. Differential Revision: https://reviews.llvm.org/D85251
-
Eli Friedman authored
Without the "align" attribute, marking the argument dereferenceable is basically useless. See also D80166. Fixes https://bugs.llvm.org/show_bug.cgi?id=46876 . Differential Revision: https://reviews.llvm.org/D84992
-
Craig Topper authored
[X86] Don't call SemaBuiltinConstantArg from CheckX86BuiltinTileDuplicate if Argument is Type or Value Dependent. SemaBuiltinConstantArg has an early exit for that case that doesn't produce an error and doesn't update the APInt. We need to detect that case and not use the APInt value. While there delete the signature of CheckX86BuiltinTileArgumentsRange that takes a single Argument index to check. There's another version that takes an ArrayRef and single value is convertible to an ArrayRef.
-
Mehdi Amini authored
Reviewed By: nicolasvasilache, ftynse Differential Revision: https://reviews.llvm.org/D85042
-
Jessica Paquette authored
It's annoying to have to maintain multiple, nearly identical chains of if statements which all set the same attributes. Add a helper function, `addFlagsUsingAttrFn` which performs the attribute setting. Then, use wrappers for that function in `lowerCall` and `setArgFlags`. (Note that the flag-setting code in `setArgFlags` was missing the returned attribute. There's no selection for this yet, so no test. It's an example of the kind of thing this lets us avoid, though.) Differential Revision: https://reviews.llvm.org/D86159
-
Jessica Paquette authored
Similar to this commit: faf8065a Testcase is pretty much the same as test/CodeGen/AArch64/tailcall-explicit-sret.ll Except it uses i64 (since we don't handle the i1024 return values yet), and doesn't have indirect tail call testcases (because we can't translate those yet). Differential Revision: https://reviews.llvm.org/D86148
-
Siva Chandra Reddy authored
-