- Jan 21, 2022
-
-
Craig Topper authored
Use alignDown instead of &= ~7. Replace ResultBit with NLZ. (BitWidth - NLZ - NTZ == 8) so (BitWidth - NTZ - 8 == NLZ). Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D117804
-
Roman Lebedev authored
-
Evgeny Shulgin authored
Support C++20 consteval functions and C++2b if consteval for AST Matchers.
-
Tue Ly authored
Update the rounding logic for generic hypot function so that it will round correctly with all rounding modes. Reviewed By: sivachandra, zimmermann6 Differential Revision: https://reviews.llvm.org/D117590
-
Joseph Huber authored
This patch adds and exception to the nvlink wrapper tool to not pass empty cubin files to the nvlink job. If an empty file is passed to nvlink it will cause an error indicating that the file could not be opened. This would occur if the user tried to link object files that contained offloading code with a file that didnt. This will act as a workaround until the new OpenMP offloading driver becomes the default. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D117777
-
Sergei Grechanik authored
This commits explicitly states that negative values and values exceeding vector dimensions are allowed in vector.create_mask (but not in vector.constant_mask). These values are now truncated when canonicalizing vector.create_mask to vector.constant_mask. Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D116069
-
Alexandre Ganea authored
This patch adds support for the MSVC /HOTPATCH flag: https://docs.microsoft.com/sv-se/cpp/build/reference/hotpatch-create-hotpatchable-image?view=msvc-170&viewFallbackFrom=vs-2019 The flag is translated to a new -fms-hotpatch flag, which in turn adds a 'patchable-function' attribute for each function in the TU. This is then picked up by the PatchableFunction pass which would generate a TargetOpcode::PATCHABLE_OP of minsize = 2 (which means the target instruction must resolve to at least two bytes). TargetOpcode::PATCHABLE_OP is only implemented for x86/x64. When targetting ARM/ARM64, /HOTPATCH isn't required (instructions are always 2/4 bytes and suitable for hotpatching). Additionally, when using /Z7, we generate a 'hot patchable' flag in the CodeView debug stream, in the S_COMPILE3 record. This flag is then picked up by LLD (or link.exe) and is used in conjunction with the linker /FUNCTIONPADMIN flag to generate extra space before each function, to accommodate for live patching long jumps. Please see: https://github.com/llvm/llvm-project/blob/d703b922961e0d02a5effdd4bfbb23ad50a3cc9f/lld/COFF/Writer.cpp#L1298 The outcome is that we can finally use Live++ or Recode along with clang-cl. NOTE: It seems that MSVC cl.exe always enables /HOTPATCH on x64 by default, although if we did the same I thought we might generate sub-optimal code (if this flag was active by default). Additionally, MSVC always generates a .debug$S section and a S_COMPILE3 record, which Clang doesn't do without /Z7. Therefore, the following MSVC command-line "cl /c file.cpp" would have to be written with Clang such as "clang-cl /c file.cpp /HOTPATCH /Z7" in order to obtain the same result. Depends on D43002, D80833 and D81301 for the full feature. Differential Revision: https://reviews.llvm.org/D116511
-
Matt Arsenault authored
-
Matt Arsenault authored
Avoids a test diff with SDAG.
-
Matt Arsenault authored
-
Matt Arsenault authored
If the default mode is the fallback, this would fail since it would end up seeing the DAG failure message instead.
-
zijunzhao authored
Add tsan shared library on Android. Only build tsan when minSdkVersion is above 23. Reviewed By: danalbert, vitalybuka Differential Revision: https://reviews.llvm.org/D108394
-
Matt Arsenault authored
Emit an error if the return value is used on subtargets that do not support them. Previously we were falling back to the DAG on selection failure, where it would emit this error and then fail again.
-
Nikolas Klauser authored
Adopt LWG3645, which fixes the value categories of basic_string::resize_and_overwrite https://timsong-cpp.github.io/lwg-issues/3645 Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D116815
-
Roman Lebedev authored
-
Sam Clegg authored
Differential Revision: https://reviews.llvm.org/D117739
-
Nadav Rotem authored
This diff optimizes the sequence icmp-ugt(ashr,C_1) C_2. InstCombine already implements this optimization for sgt, and this patch adds support ugt. This patch adds the check for UGT. @craig.topper came up with the idea and proof: define i1 @src(i8 %x, i8 %y, i8 %c) { %cp1 = add i8 %c, 1 %i = shl i8 %cp1, %y %i.2 = ashr i8 %i, %y %cmp = icmp eq i8 %cp1, %i.2 ;Assume: C + 1 == (((C + 1) << y) >> y) call void @llvm.assume(i1 %cmp) ; uncomment for the sgt case %j = shl i8 %cp1, %y %j.2 = sub i8 %j, 1 %cmp2 = icmp ne i8 %j.2, 127 ;Assume (((c + 1 ) << y) - 1) != 127 call void @llvm.assume(i1 %cmp2) %s = ashr i8 %x, %y %r = icmp sgt i8 %s, %c ret i1 %r } define i1 @tgt(i8 %x, i8 %y, i8 %c) { %cp1 = add i8 %c, 1 %j = shl i8 %cp1, %y %j.2 = sub i8 %j, 1 %r = icmp sgt i8 %x, %j.2 ret i1 %r } declare void @llvm.assume(i1) This change is related to the optimizations in D117252. Differential Revision: https://reviews.llvm.org/D117365 -
Valentin Clement authored
kStridePosInDim is a duplicate of kDimStridePos and is not used. Just remove it. Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D117784
-
Fraser Cormack authored
This patch adds a variety of tests checking that we can match vector/scalar instructions against masked VP intrinsics when the splat is on the LHS. At this stage, we can't, despite us having ostensibly-commutable ISel patterns for them. The use of V0 as the mask operand interferes with the auto-generated ISel table.
-
Matt Arsenault authored
This code is not structured to handle the legacy buffer intrinsics and was miscompiling them.
-
Matt Arsenault authored
The struct/raw forms for the buffer atomics now work as expected. However, we're incorrectly handling the legacy form (which we probably shouldn't handle at all). We also are not diagnosing the use of the return value on gfx908. These will be addressed separately.
-
Matt Arsenault authored
This was inheriting the mesa behavior, and as far as I know nobody is using opencl kernels with amdpal. The isMesaKernel check was irrelevant because this property needs to be held for all functions.
-
Random06457 authored
When compiling with dwarf info, the mfix4300 flag introduced in https://reviews.llvm.org/D116238 can miss some occurrences of the vr4300 mulmul bug if a debug instruction happens to be between two `muls` instructions. This change skips debug instructions in order to fix the mulmul bug detection. Fixes https://github.com/llvm/llvm-project/issues/53094 Differential Revision: https://reviews.llvm.org/D117615
-
Lucas Prates authored
The GlobalISel combiner currently uses sign extension when manipulating the LHS constant when combining a sequence of the following sequence of machine instructions into a single constant: ``` %0:_(s32) = G_CONSTANT i32 <CONSTANT> %1:_(p0) = G_INTTOPTR %0:_(s32) %2:_(s64) = G_CONSTANT i64 <CONSTANT> %3:_(p0) = G_PTR_ADD %1:_, %2:_(s64) ``` This causes an issue when the bit width of the first contant and the target pointer size are different, as G_INTTOPTR has no sign extension semantics. This patch fixes this by capture an arbitrary precision in when matching the constant, allowing the matching function to correctly zero extend it. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D116941
-
Sjoerd Meijer authored
-
Philip Reames authored
-
Philip Reames authored
-
Sander de Smalen authored
This was intended to be fixed by D98856, but that only seemed to have the desired behaviour when compiling to assembly using `-S`, not when compiling into an object file or executable. Given that this was not the intention of D98856, this patch fixes the behaviour.
-
Adrian Prantl authored
-
Adrian Prantl authored
-
Philip Reames authored
-
Michael Kruse authored
When a Builder methods accepts multiple InsertPoints, when both point to the same position, inserting instructions at one position will "move" the other after the inserted position since the InsertPoint is pegged to the instruction following the intended InsertPoint. For instance, when creating a parallel region at Loc and passing the same position as AllocaIP, creating instructions at Loc will "move" the AllocIP behind the Loc position. To avoid this ambiguity, add an assertion checking this condition and fix the unittests. In case of AllocaIP, an alternative solution could be to implicitly split BasicBlock at InsertPoint, using the first as AllocaIP, the second for inserting the instructions themselves. However, this solution is specific to AllocaIP since AllocaIP will always have to be first. Hence, this is an argument to generally handling ambiguous InsertPoints as API sage error. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D117226
-
Nico Weber authored
-
- Jan 20, 2022
-
-
Nikita Popov authored
-
Mubashar Ahmad authored
Test fixed for the unaligned access warning.
-
Nikita Popov authored
-
Simon Pilgrim authored
AVX512 doesn't provide a ADDSUB instruction, but if we've built this from a build vector of scalar fsub/fadd elements we can still lower to blend(fsub,fadd)
-
Mircea Trofin authored
The tensorflow AOT compiler can cross-target, but it can't run on (for example) arm64. We added earlier support where the AOT-ed header and object would be built on a separate builder and then passed at build time to a build host where the AOT compiler can't run, but clang can be otherwise built. To simplify such scenarios given we now support more than one AOT-able case (regalloc and inliner), we make the AOT scenario centered on whether files are generated, case by case (this includes the "passed from a different builder" scenario). This means we shouldn't need an 'umbrella' LLVM_HAVE_TF_AOT, in favor of case by case control. A builder can opt out of an AOT case by passing that case's model path as `none`. Note that the overrides still take precedence. This patch controls conditional compilation with case-specific flags, which can be enabled locally, for the component where those are available. We still keep an overall flag for some tests. The 'development/training' mode is unchanged, because there the model is passed from the command line and interpreted. Differential Revision: https://reviews.llvm.org/D117752
-
Nikita Popov authored
Instead of constructing DebugVariables and looking up the order in the comparison function, compute the order upfront and then sort a vector of (order, instr). This improves compile-time by -0.4% geomean on CTMark ReleaseLTO-g. Differential Revision: https://reviews.llvm.org/D117575
-
Simon Pilgrim authored
This was supposed to ensure we're not generating 512-bit ADDSUB nodes, but cut+paste typos meant we weren't generating a full 512-bit pattern
-