- Aug 25, 2021
-
-
Balazs Benics authored
This reverts commit 360ced3b.
-
Nicholas Guy authored
A single smov instruction is capable of moving from a vector register while performing the sign-extend during said move, rather than each step being performed by separate instructions. Differential Revision: https://reviews.llvm.org/D108633
-
Balazs Benics authored
Currently only `ConstantArrayType` is considered for flexible array members (FAMs) in `getStaticSize()`. However, `IncompleteArrayType` also shows up in practice as FAMs. This patch will ignore the `IncompleteArrayType` and return Unknown for that case as well. This way it will be at least consistent with the current behavior until we start modeling them accurately. I'm expecting that this will resolve a bunch of false-positives internally, caused by the `ArrayBoundV2`. Reviewed By: ASDenysPetrov Differential Revision: https://reviews.llvm.org/D105184
-
Jon Chesterfield authored
-
Jeremy Morse authored
InstrRefBasedLDV is marginally slower than VarlocBasedLDV when analysing optimised code -- however, it's much slower when analysing code compiled -O0. To avoid this: don't use instruction referencing for -O0 functions. In the "pure" case of unoptimised code, this won't really harm the debugging experience because most variables won't have been promoted off the stack, so can't go missing. It becomes more complicated when optimised code is inlined into functions marked optnone; however these are rare, and as -O0 doesn't run many optimisations there should be little damage to the debug experience as a result. I've taken the opportunity to refactor testing for instruction-referencing into a MachineFunction method, which seems the most appropriate place to put it. Differential Revision: https://reviews.llvm.org/D108585
-
Jon Chesterfield authored
Move most debug printing in rtl.cpp behind DP() macro Adjust the print output for gpu arch mismatch when the architectures match Convert an assert into graceful failure Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D108562
-
Joe Nash authored
Makes patterns added for gfx90a usable with the gfx10 versions of the insts. Reviewed By: rampitec Differential Revision: https://reviews.llvm.org/D108654 Change-Id: I86167bf6b4823f975f74ccb619bd6190331ba16b
-
Andrea Di Biagio authored
WriteIMulH reports an incorrect latency for RM variants of MULX.
-
Louis Dionne authored
We don't support any compiler that doesn't support C++14 constexpr when compiling in C++14 mode anymore, so we can just assume that we have C++14 extended constexpr when compiling in C++14 mode. This allows us to remove some workarounds for older compilers. Differential Revision: https://reviews.llvm.org/D108638
-
Florian Hahn authored
Support for peeling with multiple exit blocks was added in D63921/77bb3a48. So far it has only been enabled for loops where all non-latch exits are 'de-optimizing' exits (D63923). But peeling of multi-exit loops can be highly beneficial in other cases too, like if all non-latch exiting blocks are unreachable. The motivating case are loops with runtime checks, like the C++ example below. The main issue preventing vectorization is that the invariant accesses to load the bounds of B is conditionally executed in the loop and cannot be hoisted out. If we peel off the first iteration, they become dereferenceable in the loop, because they must execute before the loop is executed, as all non-latch exits are terminated with unreachable. This subsequently allows hoisting the loads and runtime checks out of the loop, allowing vectorization of the loop. int sum(std::vector<int> *A, std::vector<int> *B, int N) { int cost = 0; for (int i = 0; i < N; ++i) cost += A->at(i) + B->at(i); return cost; } This gives a ~20-30% increase of score for Geekbench5/HDR on AArch64. Note that this requires a follow-up improvement to the peeling cost model to actually peel iterations off loops as above. I will share that shortly. Also, peeling of multi-exits might be beneficial for exit blocks with other terminators, but I would like to keep the scope limited to known high-reward cases for now. I removed the option to disable peeling for multi-deopt exits because the code is more general now. Alternatively, the option could also be generalized, but I am not sure if there's much value in the option? Reviewed By: reames Differential Revision: https://reviews.llvm.org/D108108
-
Dawid Jurczak authored
This change fixes issue found by Markus: https://reviews.llvm.org/rG11338e998df1 Before this patch following code was transformed to memmove: for (int i = 15; i >= 1; i--) { p[i] = p[i-1]; sum += p[i-1]; } However load from p[i-1] is used not only by store to p[i] but also by sum computation. Therefore we cannot emit memmove in loop header. Differential Revision: https://reviews.llvm.org/D107964
-
Jan Kuehle authored
TypeScript 4.3 added a new "override" keyword for class members. This lets clang-format know about it, so it can format code using it properly. Reviewed By: krasimir Differential Revision: https://reviews.llvm.org/D108692
-
Peilin Guo authored
For ISD::EXTRACT_SUBVECTOR, its second operand must be a constant multiple of the known-minimum vector length of the result type. Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D107795
-
Jeremy Morse authored
Stack slot colouring adds "weight" to slots if a non-dbg-value instruction refers to it. This, unfortunately, means that DBG_PHI instructions can have an effect on codegen. The fix is very simple, replace isDebugValue with isDebugInstr. The regression test contains a scenario that reproduces this problem; I've represented both normal-debug mode and instr-ref debug mode instructions in comment lines prefixed with AAAAAA and BBBBBB, and un-comment them with sed to test that the two different modes produce the same behaviour. Differential Revision: https://reviews.llvm.org/D108627
-
River Riddle authored
This allows for using a different type when accessing a parameter than the one used for storage. This allows for returning parameters by reference, enables using more optimized/convient reference results, and more. Differential Revision: https://reviews.llvm.org/D108593
-
River Riddle authored
This allows for parsing strings that have escape sequences, which require constructing a string (as they can't be represented by looking at the Token contents directly). Differential Revision: https://reviews.llvm.org/D108589
-
River Riddle authored
This allows for iterating and interacting with the uses of a specific subset of results as opposed to just the full range. Differential Revision: https://reviews.llvm.org/D108586
-
Jean Perier authored
Use gettimeofday and localtime_r to implement DATE_AND_TIME intrinsic. The Windows version fallbacks to the "no date and time information available" defined by the standard (strings set to blanks and values to -HUGE). The implementation uses an ifdef between windows and the rest because from my tests, the SFINAE approach leads to undeclared name bogus errors with clang 8 that seems to ignore failure to instantiate is not an error for the function names (i.e., it understands it should not instantiate the version using gettimeofday if it is not there, but still yields an error that it is not declared on the spot where it is called in the uninstantiated version). Differential Revision: https://reviews.llvm.org/D108622
-
Jan Svoboda authored
Translation units with multiple direct modular dependencies trigger a non-deterministic ordering in `clang-scan-deps`. This boils down to usage of `std::unordered_map`, which gets replaced by `std::map` in this patch. Depends on D103526. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D103807
-
Rosie Sumpter authored
Differential Revision: https://reviews.llvm.org/D108644
-
Tres Popp authored
Differential Revision: https://reviews.llvm.org/D108570
-
LLVM GN Syncbot authored
-
Daniil Fukalov authored
1. Splitted out some parts of R600 target to separate modules/headers. 2. Reduced some include lists in headers. 3. Found and fixed issue with override `GCNTargetMachine::getSubtargetImpl()` and `R600TargetMachine::getSubtargetImpl()` had different return value type than base class. 4. Minor forward declarations cleanup. Reviewed By: foad Differential Revision: https://reviews.llvm.org/D108596
-
Jan Svoboda authored
The `ASTReader` populates `Module::PresumedModuleMapFile` only for top-level modules, not submodules. To avoid generating empty `-fmodule-map-file=` arguments, make discovered modules depend on top-level precompiled modules. The granularity of submodules is not important here. The documentation of `Module::PresumedModuleMapFile` says this field is non-empty only when building from preprocessed source. This means there can still be cases where the dependency scanner generates empty `-fmodule-map-file=` arguments. That's being addressed in separate patch: D108544. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D108647
-
serge-sans-paille authored
This environment variable has been standardized for reproducible builds. Setting it can help to have reproducible tests too, so keep it as part of the testing env when set. See https://reproducible-builds.org/docs/source-date-epoch/ Differential Revision: https://reviews.llvm.org/D108332
-
Jan Svoboda authored
In this patch, the dependency scanner starts collecting precompiled dependencies from all encountered submodules, not only from top-level modules. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D108540
-
Florian Mayer authored
In that case it is very likely that there will be a tag mismatch anyway. We handle the case that the pointer belongs to neither of the allocators by getting a nullptr from allocator.GetBlockBegin. Reviewed By: hctim, eugenis Differential Revision: https://reviews.llvm.org/D108383
-
Konstantin Schwarz authored
The sext_inreg_of_load combine did not have the isLegalOrBeforeLegalizer check, leading to the generation of potentially illegal G_SEXTLOADs when run after legalization. Reviewed By: foad Differential Revision: https://reviews.llvm.org/D108626
-
Jonas Hahnfeld authored
NVPTX does not allow dots in the identifier, so ptxas errors out with fatal : Parsing error near '.static': syntax error because it parses .static as a directive. Avoid this problem by using two underscores, similar to what OpenMP does for outlined functions. Differential Revision: https://reviews.llvm.org/D108456
-
Yi Kong authored
8ace1213 introduced a regression for code that explicitly ignores the -Wframe-larger-than= warning. Make sure we don't generate the warn-stack-size attribute for that case. Differential Revision: https://reviews.llvm.org/D108686
-
Douglas Yung authored
This should fix the test failure on the PS4 build bot.
-
Vang Thao authored
On some AMDGPU subtargets, copying to and from AGPR registers using another AGPR register is not possible. A intermediate VGPR register is needed for AGPR to AGPR copy. This is an issue when machine copy propagation forwards a COPY $agpr, replacing a COPY $vgpr which results in $agpr = COPY $agpr. It is removing a cross class copy that may have been optimized by previous passes and potentially creating an unoptimized cross class copy later on. To avoid this issue, check CrossCopyRegClass if a different register class will be needed for the copy. If so then avoid forwarding the copy when the destination does not match the desired register class and if the original copy already matches the desired register class. Issue seen while attempting to optimize another AGPR to AGPR issue: Live-ins: $agpr0 $vgpr0 = COPY $agpr0 $agpr1 = V_ACCVGPR_WRITE_B32 $vgpr0 $agpr2 = COPY $vgpr0 $agpr3 = COPY $vgpr0 $agpr4 = COPY $vgpr0 After machine-cp: $vgpr0 = COPY $agpr0 $agpr1 = V_ACCVGPR_WRITE_B32 $vgpr0 $agpr2 = COPY $agpr0 $agpr3 = COPY $agpr0 $agpr4 = COPY $agpr0 Machine-cp propagated COPY $agpr0 to replace $vgpr0 creating 3 AGPR to AGPR copys. Later this creates a cross-register copy from AGPR->VGPR->AGPR for each copy when the prior VGPR->AGPR copy was already optimal. Reviewed By: lkail, rampitec Differential Revision: https://reviews.llvm.org/D108011
-
Lang Hames authored
-
Lang Hames authored
-
Carl Ritson authored
-
Fangrui Song authored
The NS==0 condition used by D103717 missed a corner case: if the current copy does not have a hash suffix (e.g. weak_odr), a copy with value profiling (with a different CFG) may exist. This is super rare, but is possible with pre-inlining PGO instrumentation (which can make a weak_odr function inlines its callees differently, sometimes with value profiling while sometimes without). If the current copy with private profd is prevailing, the non-prevailing copy may get an undefined symbol if a caller inlining the non-prevailing function references its profd. If the other copy with non-private profd is prevailing, the current copy may cause a "relocation to discarded section" linker error. The fix is straightforward: just keep non-private profd in such a `DataReferencedByCode` case. With this change, a stage 2 (`-DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_BUILD_INSTRUMENTED=IR`) clang is 0.08% larger (172431496/172286720-1). `stat -c %s **/*.o | awk '{s+=$1}END{print s}' is 0.026% larger. The majority of D103717's benefits remains. Reviewed By: xur Differential Revision: https://reviews.llvm.org/D108432 -
Richard Smith authored
Previously when emitting a C++ guarded initializer, we tried to work out what the enclosing function would be used for and added it to the COMDAT containing the variable if we thought that doing so would be correct. But this was done from a context in which we didn't -- and realistically couldn't -- correctly infer how the enclosing function would be used. Instead, add the initialization function to a COMDAT from the code that creates it, in the case where it makes sense to do so: when we know that the one and only reference to the initialization function is in @llvm.global.ctors and that reference is in the same COMDAT. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D108680
-
Thomas Lively authored
-
Fangrui Song authored
This reverts commit f653beea. It broke Windows coverage-inline.cpp because link.exe has a limitation that external symbols in IMAGE_COMDAT_SELECT_ASSOCIATIVE don't work. It essentially dropped the previous size optimization for coverage because coverage doesn't rename comdat by default. Needs more investigation what we should do.
-
Rob Suderman authored
Includes the quantized version of average pool lowering to linalg dialect. This includes a lit test for the transform. It is not 100% correct as the multiplier / shift should be done in i64 however this is negligable rounding difference. Reviewed By: NatashaKnk Differential Revision: https://reviews.llvm.org/D108676
-