- Apr 16, 2022
-
-
Bill Wendling authored
-
Mogball authored
LICM is refactored into a utility that is application on any region. The implementation is moved to Transform/Utils.
-
Richard Smith authored
-
Pavel Kosov authored
Updated MipsInstPrinter to print absolute hex offsets for branch instructions. It is necessary to make the llvm-objdump output close to the gnu objdump output. This implementation is based on the implementation for RISC-V. OS Laboratory. Huawei Russian Research Institute. Saint-Petersburg Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D123764
-
Vitaly Buka authored
It's still disabled by default at compile time. Reviewed By: kstoimenov Differential Revision: https://reviews.llvm.org/D123875
-
Peter Klausler authored
Prior to this patch, the semantics utility GetExpr() will crash unconditionally if it encounters a typed expression in the parse tree that has not been set by expression semantics. This is the right behavior when called from lowering, by which time it is known that the program had no fatal user errors, since it signifies a fatal internal error. However, prior to lowering, in the statement semantics checking code, a more nuanced test should be used before crashing -- specifically, we should not crash in the face of a missing typed expression when in error recovery mode. Getting this right requires GetExpr() and its helper class to have access to the semantics context, so that it can check AnyFatalErrors() before crashing. So this patch touches nearly all of its call sites. Differential Revision: https://reviews.llvm.org/D123873
-
Richard Smith authored
We still require these functions to be declared before they can be used, but don't instantiate their definitions unless their addresses are taken. Instead, code generation, constant evaluation, and static analysis are given direct knowledge of their effect. This change aims to reduce various costs associated with these functions -- per-instantiation memory costs, compile time and memory costs due to creating out-of-line copies and inlining them, code size at -O0, and so on -- so that they are not substantially more expensive than a cast. Most of these improvements are very small, but I measured a 3% decrease in -O0 object file size for a simple C++ source file using the standard library after this change. We now automatically infer the `const` and `nothrow` attributes on these now-builtin functions, in particular meaning that we get a warning for an unused call to one of these functions. In C++20 onwards, we disallow taking the addresses of these functions, per the C++20 "addressable function" rule. In earlier language modes, a compatibility warning is produced but the address can still be taken. The same infrastructure is extended to the existing MSVC builtin `__GetExceptionInfo`, which is now only recognized in namespace `std` like it always should have been. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D123345
-
Florian Hahn authored
With opaque pointers, the stored value and address can be the same. Previously the code in VPWidenMemoryInstructionRecipe::onlyFirstLaneDemanded incorrectly considers stores with matching store and pointer operands as only demanding the first lane, causing a crash.
-
Chih-Ping Chen authored
specifying DW_AT_trampoline as a string. Also update the signature of DIBuilder::createFunction to reflect this addition. Differential Revision: https://reviews.llvm.org/D123697
-
Johannes Doerfert authored
This reverts commit 0d7f81e3, it caused the AMDGPU tests that use the Attributor to fail.
-
Lang Hames authored
-
River Riddle authored
Fix variable naming convention and cleanup a clang-tidy warning.
-
River Riddle authored
This technique results in an explosion in compile time, resulting from a huge number of std::tuple/concat instatiations. This technique is replaced by simpler metaprogramming and results in a signficant reduction in compile time. A local debug/asan build saw a 4x speed up in the processing of ArithmeticOps.h.inc, and given the nature of this change every dialect should see similar reductions in compile time. Differential Revision: https://reviews.llvm.org/D123360
-
Johannes Doerfert authored
-
Johannes Doerfert authored
When we run the CGSCC pass we should only invest time on the SCC. We can initialize AAs with information from the module slice but we should not update those AAs.
-
Johannes Doerfert authored
-
Johannes Doerfert authored
-
Lang Hames authored
Adds support for pointer encodings commonly used in large/static models, including non-pcrel, sdata/udata8, indirect, and omit. Also refactors pointer-encoding handling to consolidate error generation inside common functions, rather than callees of those functions.
-
Arthur Eubanks authored
-
Arjun P authored
Previously this checked if the entire symbolic numerator was divisible by the denominator, which is never the case when this function is called. Fixed this to check only the non-const coefficients in the numerator, which was what was intended and documented. Reviewed By: Groverkss Differential Revision: https://reviews.llvm.org/D123592
-
Bill Wendling authored
A randomized structure needs to use a designated or default initializer. Using a non-designated initializer will result in values being assigned to the wrong fields. Differential Revision: https://reviews.llvm.org/D123763
-
LLVM GN Syncbot authored
-
Thomas Raoux authored
extract was incorrectly folded when the source was coming from a broadcast that was both adding new rank and broadcasting the inner dimension. Differential Revision: https://reviews.llvm.org/D123867
-
Alexandre Ganea authored
When using LLVM_INTEGRATED_CRT_ALLOC, fix compiling with the latest snmalloc at ToT (https://github.com/microsoft/snmalloc).
-
Xiang Li authored
The target profile option(/T) decide the shader model when compile hlsl. The format is shaderKind_major_minor like ps_6_1. The shader model is saved as llvm::Triple is clang/llvm like dxil-unknown-shadermodel6.1-hull. The main job to support the option is translating ps_6_1 into shadermodel6.1-pixel. That is done inside tryParseProfile at HLSL.cpp. To integrate the option into clang Driver, a new DriverMode DxcMode is created. When DxcMode is enabled, OSType for TargetTriple will be forced into Triple::ShaderModel. And new ToolChain HLSLToolChain will be created when OSType is Triple::ShaderModel. In HLSLToolChain, ComputeEffectiveClangTriple is overridden to call tryParseProfile when targetProfile option is set. To make test work, Fo option is added and .hlsl is added for active -xhlsl. Reviewed By: beanz Differential Revision: https://reviews.llvm.org/D122865 Patch by: Xiang Li <python3kgae@outlook.com>
-
Arjun P authored
When the sample value is zero, everything is the same except that failure to pivot does not imply emptiness. So, leave it to the user to mark as empty if necessary, if they know the sample value is strictly negative. This is needed for an upcoming symbolic lexmin heuristic. Reviewed By: Groverkss Differential Revision: https://reviews.llvm.org/D123604
-
William S. Moses authored
-
Eli Friedman authored
In D123649, I got the formula for getFlexibleArrayInitChars slightly wrong: the flexible array elements can be contained in the tail padding of the struct. Fix the formula to account for that. With the fixed formula, we run into another issue: in some cases, we were emitting extra padding for flexible arrray initializers. Fix CGExprConstant so it uses a packed struct when necessary, to avoid this extra padding. Differential Revision: https://reviews.llvm.org/D123826
-
Zequan Wu authored
-
rdzhabarov authored
Differential Revision: https://reviews.llvm.org/D123868
-
Zequan Wu authored
-
Johannes Doerfert authored
Certain applications crashed for us with the AMDGPU backend. While this is not a proper fix it allows us to compile the code for now. I left a TODO for someone that understands DWARF. Differential Revision: https://reviews.llvm.org/D123717
-
Johannes Doerfert authored
The original code relied on the fact that we needed a bitcast instruction (for non constant base objects). With opaque pointers there might not be a bitcast. Always check if reordering is required instead. Fixes: https://github.com/llvm/llvm-project/issues/54896 Differential Revision: https://reviews.llvm.org/D123694
-
William S. Moses authored
-
Aaron Ballman authored
Given the declaration: typedef void func_t(unsigned); __attribute__((noreturn)) func_t func; we would incorrectly determine that `func` had no prototype because the `noreturn` attribute would convert the underlying type directly into a FunctionProtoType, but the declarator for `func` itself was not one for a function with a prototype. This adds an additional check for when the declarator is a type representation for a function with a prototype.
-
Zequan Wu authored
-
Mogball authored
Changes the algorithm of LICM to support graph regions (no guarantee of topologically sorted order). Also fixes an issue where ops with recursive side effects and regions would not be hoisted if any nested ops used operands that were defined within the nested region. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D122465
-
Fangrui Song authored
Legacy PM for optimization pipeline was deprecated in 13.0.0 and Clang dropped legacy PM support in D123609. This change removes legacy PM passes for PGO so that downstream projects won't be able to use it. It seems appropriate to start removing such "add-on" features like instrumentations, before we remove more stuff after 15.x is branched. I have checked many LLVM users and only ldc[1] uses the legacy PGO pass. [1]: https://github.com/ldc-developers/ldc/issues/3961 Reviewed By: davidxl Differential Revision: https://reviews.llvm.org/D123834
-
William S. Moses authored
Operation clone is currently faulty. Suppose you have a block like as follows: ``` (%x0 : i32) { %x1 = f(%x0) return %x1 } ``` The test case we have is that we want to "unroll" this, in which we want to change this to compute `f(f(x0))` instead of just `f(x0)`. We do so by making a copy of the body at the end of the block and set the uses of the argument in the copy operations with the value returned from the original block. This is implemented as follows: 1) map to the block arguments to the returned value (`map[x0] = x1`). 2) clone the body Now for this small example, this works as intended and we get the following. ``` (%x0 : i32) { %x1 = f(%x0) %x2 = f(%x1) return %x2 } ``` This is because the current logic to clone `x1 = f(x0)` first looks up the arguments in the map (which finds `x0` maps to `x1` from the initialization), and then sets the map of the result to the cloned result (`map[x1] = x2`). However, this fails if `x0` is not an argument to the op, but instead used inside the region, like below. ``` (%x0 : i32) { %x1 = f() { yield %x0 } return %x1 } ``` This is because cloning an op currently first looks up the args (none), sets the map of the result (`map[%x1] = %x2`), and then clones the regions. This results in the following, which is clearly illegal: ``` (%x0 : i32) { %x1 = f() { yield %x0 } %x2 = f() { yield %x2 } return %x2 } ``` Diving deeper, this is partially due to the ordering (how this PR fixes it), as well as how region cloning works. Namely it will first clone with the mapping, and then it will remap all operands. Since the ordering above now has a map of `x0 -> x1` and `x1 -> x2`, we end up with the incorrect behavior here. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D122531 -
Peter Klausler authored
When a procedure pointer or procedure dummy argument has a defined interface, the rank of the pointer (or dummy) is the rank of the interface. Also tweak code discovered in shape analysis when investigating this problam so that it returns a vector of emptied extents rather than std::nullopt when the extents are not scope-invariant, so that the rank can at least be known. Differential Revision: https://reviews.llvm.org/D123727
-