[mlir][vector] Canonicalize vector.extract and vector.broadcast to vector.shape_cast (#174452)
Based on the original PR
https://github.com/llvm/llvm-project/pull/140583, but without
vector.transpose -> vector.shape_cast.
This PR canonicalizes
%0 = vector.broadcast %arg0 : vector<4xi8> to vector<1x1x4xi8>
%2 = vector.extract %arg2[0] : vector<4xi8> from vector<1x4xi8>
to shape_cast. It was decided (see
https://github.com/llvm/llvm-project/pull/140583) that the
vector.transpose -> vector.shape_cast needs further consideration before
being added.
---------
Signed-off-by: James Newling <james.newling at gmail.com>
InjectTLIMappings: remove incompatible attributes from vector declarations. (#173206)
Some attributes (e.g., the signext attribute) are not supported on
vector types; adding them would cause the verifier pass to fail.
[Modules] Fix spurious errors about module input file changing after .pcm file was built. (#176537)
For incremental multi-process/multi-thread compilation utilizing a build
session fix errors like
> fatal error: file '/path/to/Frmwrk.framework/Headers/Header.h' has been modified since the module file '/path/to/ModuleCache.noindex/XXX/Frmwrk-YYY.pcm' was built: mtime changed (was aaa, now bbb)
Another symptom of the bug is when you check Frmwrk.pcm the header's
mtime is correct, so it is confusing where "was aaa" is even coming from.
The main problem is that in case of a signature mismatch
`ModuleManager::addModule` returns `OutOfDate` but keeps .pcm buffer in
`InMemoryModuleCache`. So if later on it tries to use such a module, it
would have an outdated buffer in `InMemoryModuleCache`. If another
process/thread happens to rebuild such module and write a new validation
timestamp, the original process would skip the input file validation and
would keep using the outdated .pcm buffer hitting errors about
unexpected input modifications.
[6 lines not shown]
[RISCV] Add ZZZ_ to some inline assembly vector register classes to sort them after VR/VRNoV0 in regclass enum. (#177087)
This prevents getCommonSubClass from finding them before VR/VRNoV0.
Fixes a crash reported post-commit in #171231. getCommonSubClass
returned one of these classes, but it doesn't have the same VTs as
VR/VRNoV0 leading to an assertion failure.
The subregister-undef-early-clobber.mir still ends up finding these
register classes in the InitUndef pass.
[orc-rt] Implement rotl / rotr, fix missing include in unit test. (#177305)
In e838f27e0f3 the EndianTest.cpp unittest was updated to avoid using
`llvm::rotl` function, but the corresponding `orc_rt::rotl` function had
not been implemented yet.
This commit implements orc_rt::rotl, orc_rt::rotr, and
orc_rt::has_single_bit by copying their definitions from the
corresponding LLVM header (llvm-project/llvm/include/llvm/ADT/bit.h).
Unit tests for these functions are also copied from their LLVM
counterparts.
Thanks to @jaredwy for spotting this!
[Flang][OpenMP][Offload] Modify MapInfoFinalization to handle attach mapping and 6.1's ref_* and attach map keywords
This PR is one of four required to implement the attach mapping semantics in Flang, alongside the
ref_ptr/ref_ptee/ref_ptr_ptee map modifiers and the attach(always/never/auto) modifiers.
This PR is the MapInfoFinalization changes required to support these features, it mainly deals with
applying the correct attach map type and manipulating the descriptor types maps for base address
and descriptor so that when we specify ref_ptr/ref_ptee we emit one of the two maps and when we
emit ref_ptr_ptee we emit our usual default maps. In all cases we add the "glue" of an new
attach map except in cases where a user has provided attach never. In cases where we are
provided an always, we apply the always map type to our attach maps.
It's important to note the runtime has a toggle for the auto map behaviour, which will flip the
attach behaviour to the newer semantics or the older semantics for backwards compatability (outside
the purview of this PR but good to mention).
hwpstate: Add CPPC enable tunable
The Framework 13 runs very hot the maximum frequency is possible. By
disabling CPPC (reverting to Cool`n'Quiet 2.0) we can use powerd to
limit the CPU frequency to 2200, thereby reducing the CPU temperature.
Some systems may run slower with CPPC enabled. See PR/292615 for that
bug.
Those experiencing either of these issues may add the following to
their loader.conf or device.hints to disable CPPC:
machdep.hwpstate_amd_cppc_enable="0"
PR: 292615
Reviewed by: lwhsu, olce
Differential revision: https://reviews.freebsd.org/D54803
[ELF] Set vna_flags to VER_FLG_WEAK if all references are weak
When all undefined references to a version are weak, set vna_flags to
VER_FLG_WEAK in the .gnu.version_r section. This enables glibc ld.so to
report a warning instead of an error when the required version is not
found at runtime, supporting optional dependencies.
Per https://sourceware.org/bugzilla/show_bug.cgi?id=24718#c20 ,
glibc rtld since 2.30 (BZ #24741) tolerates missing versioned symbols
when the runtime shared object defines the required version. With this
vna_flags VER_FLG_WEAK change, rtld can also tolerate a completely
missing version, printing a message like:
```
% LD_PRELOAD=c2.so ./a
./a: /tmp/t/v2/c2.so: weak version `v1' not found (required by /tmp/t/v2/b.so)
a
```
[5 lines not shown]
[IR] Update IRBuilder::createVectorSplice to allow variable offsets (#177178)
Following on from #174693, this updates IRBuilder to allow variable
offsets, and splits the createVectorSplice function into two functions
for left and right splices.
We could preserve the existing createVectorSplice API but given there's
only one LLVM-internal user of it in the loop vectorizer, and the notion
of a negative offset doesn't exist in the intrinsics anymore, I've
removed it. Happy to add it back if reviewers prefer though.
I've also added unit tests since createVectorSpliceLeft has no coverage
otherwise.
dtrace_sdt: Don't ignore the first stack frame in sdt probes.
The aframes argument to dtrace_probe_create gives the number of stack
frames that are ignored in stack(), the first frame of which is
`caller'.
This is for, e.g., profiler interrupts where the interrupt frame
itself isn't interesting; it's the code that was interrupted that was
interesting (hence profile_aframes = PROF_ARTIFICIAL_FRAMES is often
nonzero, or even several frames deep).
But for sdt, the direct caller is the interesting part -- when we
have something like:
foo()
{
...
bar();
...
[13 lines not shown]
[orc-rt] Update another unittest to use orc-rt/bit.h functions. (#177303)
Unit test was mistakenly using an `llvm::` function.
Thanks to @jaredwy for spotting this!
directory(3): caveats for seekdir.
- If the directory being read is altered, past telldir results are
(potentially) invalidated. Don't promise that they'll work.
- There is no way to detect failure. (It returns void, and while it
may set errno, the main failure path in the actual implementation
does not, so even setting errno to 0 beforehand doesn't work.)
Fix a typo elsewhere while passing through. Bump date.
[Flang][MLIR][OpenMP] Add distinct var_ptr_ptr_type to omp.map.info operations
This is a precursor patch to attach and ref_ptr/ptee mapping that I intend to upstream
over the next few weeks. The attach maps require both the type of the descriptor and
the pointed to data to calculate the appropriate offload/base pointers and size. In
the base case of ref_ptr_ptee all of this information can be gathered from the pointer
and pointee maps, but in cases where we have only one (i.e. ref_ptr/ref_ptee) we will
be missing one of the key elements required to create an corresponding attach map.
So, this PR basically adds the ability to ferry around the type of both var_ptr and
var_ptr_ptr as opposed to just var_ptr, then we can emit attach maps as seperate
map.info's that carry all the pre-requisite informaion for lowering to LLVM-IR. But,
otherwise it seems reasonable to have var_ptr_ptr mirror var_ptr in all aspects for
consistency.
[Flang][OpenMP][MLIR] Add attach and ref map type lowering to MLIR
This doesn't implement the functionality, just the relevant map type
lowering to MLIR's omp.map.info. The more complicated changes to
MapInfoFinalizationPass.cpp and OpenMPTOLLVMIRTranslation.cpp to support
attach map and the various ref/attach semantics will come in a subsequent
set of PRs. This just helps compartmentalize the changeset.