- Dec 20, 2020
-
-
Roman Lebedev authored
Still boring, simply drop all edges to successors of DomBlock, and add an edge to to BB instead.
-
Roman Lebedev authored
And that exposes that a number of tests don't *actually* manage to maintain DomTree validity, which is inline with my observations. Once again, SimlifyCFG pass currently does not require/preserve DomTree by default, so this is effectively NFC.
-
Andrew Litteken authored
inputs. Extracted regions can have both inputs and outputs. In addition, the CodeExtractor removes inputs that are only used in llvm.assumes, and sunken allocas (values are used entirely in the extracted region as denoted by lifetime intrinsics). We also cannot combine sections that have different constants in the same structural location, and these constants will have to elevated to argument. This patch limits the extracted regions to those that only require inputs, and do not have any other special cases. We test that we do not outline the wrong constants in: test/Transforms/IROutliner/outliner-different-constants.ll test/Transforms/IROutliner/outliner-different-globals.ll test/Transforms/IROutliner/outliner-constant-vs-registers.ll We test that correctly outline in: test/Transforms/IROutliner/outlining-same-globals.ll test/Transforms/IROutliner/outlining-same-constants.ll test/Transforms/IROutliner/outlining-different-structure.ll Reviewers: paquette, plofti Differential Revision: https://reviews.llvm.org/D86977
-
Craig Topper authored
[X86] Teach assembler to accept vmsave/vmload/vmrun/invlpga/skinit with or without the fixed register operands These instructions read their inputs from fixed registers rather than using a modrm byte. We shouldn't require the user to list them when parsing assembly. This matches the GNU assembler. This patch adds InstAliases so we can accept either form. It also changes the printing code to use the form without registers. This will change the behavior of llvm-objdump, but should be consistent with binutils objdump. This also matches what we already do in LLVM for clzero and monitorx which also used fixed registers. I need to add and improve tests before this can be commited. The disassembler tests exist, but weren't checking the fixed register so they pass before and after this change. Fixes https://github.com/ClangBuiltLinux/linux/issues/1216 Differential Revision: https://reviews.llvm.org/D93524
-
Kazu Hirata authored
The last use of getInstTypePair with two parameters was removed on on Jan 9, 2015 in commit 33d7f9de. It seems to be unused since then.
-
Kazu Hirata authored
-
Juneyoung Lee authored
-
- Dec 19, 2020
-
-
Mark de Wever authored
-
Zakk Chen authored
Define vlxe/vsxe intrinsics and lower to vlxei<EEW>/vsxei<EEW> instructions. We work with @rogfer01 from BSC to come out this patch. Authored-by:
Roger Ferrer Ibanez <rofirrim@gmail.com> Co-Authored-by:
Zakk Chen <zakk.chen@sifive.com> Differential Revision: https://reviews.llvm.org/D93471
-
Kristof Beyls authored
The command line syntax is identical to the -mharden-sls= command line syntax for AArch64 targets. Differential Revision: https://reviews.llvm.org/D93221
-
Kristof Beyls authored
As a linker is allowed to clobber r12 on function calls, the code transformation that hardens indirect calls is not correct in case a linker does so. Similarly, the transformation is not correct when register lr is used. This patch makes sure that r12 or lr are not used for indirect calls when harden-sls-blr is enabled. Differential Revision: https://reviews.llvm.org/D92469
-
Kristof Beyls authored
To make sure that no barrier gets placed on the architectural execution path, each indirect call calling the function in register rN, it gets transformed to a direct call to __llvm_slsblr_thunk_mode_rN. mode is either arm or thumb, depending on the mode of where the indirect call happens. The llvm_slsblr_thunk_mode_rN thunk contains: bx rN <speculation barrier> Therefore, the indirect call gets split into 2; one direct call and one indirect jump. This transformation results in not inserting a speculation barrier on the architectural execution path. The mitigation is off by default and can be enabled by the harden-sls-blr subtarget feature. As a linker is allowed to clobber r12 on function calls, the above code transformation is not correct in case a linker does so. Similarly, the transformation is not correct when register lr is used. Avoiding r12/lr being used is done in a follow-on patch to make reviewing this code easier. Differential Revision: https://reviews.llvm.org/D92468
-
Kristof Beyls authored
The only non-trivial consideration in this patch is that the formation of TBB/TBH instructions, which is done in the constant island pass, does not understand the speculation barriers inserted by the SLSHardening pass. As such, when harden-sls-retbr is enabled for a function, the formation of TBB/TBH instructions in the constant island pass is disabled. Differential Revision: https://reviews.llvm.org/D92396
-
LLVM GN Syncbot authored
-
Kristof Beyls authored
Some processors may speculatively execute the instructions immediately following indirect control flow, such as returns, indirect jumps and indirect function calls. To avoid a potential miss-speculatively executed gadget after these instructions leaking secrets through side channels, this pass places a speculation barrier immediately after every indirect control flow where control flow doesn't return to the next instruction, such as returns and indirect jumps, but not indirect function calls. Hardening of indirect function calls will be done in a later, independent patch. This patch is implementing the same functionality as the AArch64 counter part implemented in https://reviews.llvm.org/D81400. For AArch64, returns and indirect jumps only occur on RET and BR instructions and hence the function attribute to control the hardening is called "harden-sls-retbr" there. On AArch32, there is a much wider variety of instructions that can trigger an indirect unconditional control flow change. I've decided to stick with the name "harden-sls-retbr" as introduced for the corresponding AArch64 mitigation. This patch implements this for ARM mode. A future patch will extend this to also support Thumb mode. The inserted barriers are never on the correct, architectural execution path, and therefore performance overhead of this is expected to be low. To ensure these barriers are never on an architecturally executed path, when the harden-sls-retbr function attribute is present, indirect control flow is never conditionalized/predicated. On targets that implement that Armv8.0-SB Speculation Barrier extension, a single SB instruction is emitted that acts as a speculation barrier. On other targets, a DSB SYS followed by a ISB is emitted to act as a speculation barrier. These speculation barriers are implemented as pseudo instructions to avoid later passes to analyze them and potentially remove them. The mitigation is off by default and can be enabled by the harden-sls-retbr subtarget feature. Differential Revision: https://reviews.llvm.org/D92395
-
Kazu Hirata authored
-
Jonas Devlieghere authored
This is a speculative fix when looking at the finalization code in Process. It tackles the following issues: - Adds synchronization to prevent races between threads. - Marks the process as finalized/invalid as soon as Finalize is called rather than at the end. - Simplifies the code by using only a single instance variable to track finalization. Differential revision: https://reviews.llvm.org/D93479
-
Tim Keith authored
We were only checking the restrictions of IMPLICIT NONE(EXTERNAL) when a procedure name is first encountered. But it can also happen with an existing symbol, e.g. if an external function's return type is declared before is it called. This change adds a check in that branch too. Differential Revision: https://reviews.llvm.org/D93552
-
Jacques Pienaar authored
Introduce CHECK modifiers that change the behavior of the CHECK directive. Also add a LITERAL modifier for cases where matching could end requiring escaping strings interpreted as regex where only literal/fixed string matching is desired (making the CHECK's more difficult to write/fragile and difficult to interpret).
-
Sam McCall authored
-
Aditya Kumar authored
Make the penalty for splitting a region more accurately reflect the cost of materializing all of the inputs/outputs to/from the region. This almost entirely eliminates code growth within functions which undergo splitting in key internal frameworks, and reduces the size of those frameworks between 2.6% to 3%. rdar://49167240 Patch by: Vedant Kumar(@vsk) Reviewers: hiraditya,rjf,t.p.northover Reviewed By: hiraditya,rjf Differential Revision: https://reviews.llvm.org/D59715
-
Sam McCall authored
There's an unfortunate collision between two features: - we implicitly cancel certain requests when the file changes, to avoid the queue getting clogged building old revisions to service stale requests - we "reparse-if-needed" by synthesizing a file change, e.g. on didSave We could explicitly mark these synthetic requests to avoid this, but looking for changes in file content clutters our APIs less and is arguably the correct thing to do in any case. Fixes https://github.com/clangd/clangd/issues/620
-
Akira Hatanaka authored
inserted when the original call had a 'returned' argument The code is testing whether the instruction BBI points to is the call that is paired up with the retainRV/claimRV call, but it doesn't work when the call has a 'returned' argument since GetArgRCIdentityRoot looks through 'returned' arguments. rdar://72485383
-
Kazushi (Jam) Marukawa authored
Support VM and VMP registers in copyPhysReg() function. Also add regression tests. Reviewed By: simoll Differential Revision: https://reviews.llvm.org/D93547
-
Sam McCall authored
Different cases were using a bunch of different variants of the printing policy. Each of these had something going for it, but the result was inconsistent. Goals: - single printing policy used (almost) everywhere - avoid unidiomatic tags like `class vector<class X>` - be informative and easy to understand For tags, the solution I wound up with is: we print only the outer tag and only in the simplest cases where this elaboration won't cause confusion. For example: - class X - enum Foo - vector<int> - X* This seems to strike a nice balance of providing plenty of info/context in common cases while never being confusing. Differential Revision: https://reviews.llvm.org/D93553
-
Harald van Dijk authored
We need to make sure not to emit R_X86_64_GOTPCRELX relocations for instructions that use a REX prefix. If a REX prefix is present, we need to instead use a R_X86_64_REX_GOTPCRELX relocation. The existing logic for CALL64m, JMP64m, etc. already handles this by checking the HasREX parameter and using it to determine which relocation type to use. Do this for all instructions that can use relaxed relocations. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D93561
-
Richard Smith authored
This doesn't actually work (any more?), and instead renders as a literal $Date$ on the website.
-
Fraser Cormack authored
-
Sanjay Patel authored
-
Richard Smith authored
-
Richard Smith authored
-
Richard Smith authored
support yet.
-
Richard Smith authored
-
Fraser Cormack authored
To support OpenCL, which typically uses SPIR as an IR, non-zero address spaces must be accounted for. This patch makes the RISC-V target assume no-op address space casts across the board, which effectively removes the need to support addrspacecast instructions in the backend. For a RISC-V implementation with different configurations or specialized address spaces where casts aren't no-ops, the function can be adjusted as required. Reviewed By: jrtc27 Differential Revision: https://reviews.llvm.org/D93536
-
Chih-Ping Chen authored
Patch by: Aditya Kumar. Differential Revision: https://reviews.llvm.org/D93559
-
Craig Topper authored
This patch adds two IR intrinsics for vsetvli instruction. One to set the vector length to a user specified value and one to set it to vlmax. The vlmax uses the X0 source register encoding. Clang builtins will follow in a separate patch Differential Revision: https://reviews.llvm.org/D92973
-
Fangrui Song authored
[TableGen] Fix D90844 introduced non-determinism due to iteration over a std::map over allocated object pointers 993eaf2d (D90844) is still wrong. The allocated const Record* pointers do not have an order guarantee so switching from DenseMap to std::map does not help. ProcModelMapTy = std::map<const Record*, unsigned> Sort the values instead.
-
Nikita Popov authored
-
Craig Topper authored
The default behavior for any_extend of a constant is to zero extend. This occurs inside of getNode rather than allowing type legalization to promote the constant which would sign extend. By using sign extend with getNode the constant will be sign extended. This gives a better chance for isel to find a simm5 immediate since all xlen bits are examined there. For instructions that use a uimm5 immediate, this change only affects constants >= 128 for i8 or >= 32768 for i16. Constants that large already wouldn't have been eligible for uimm5 and would need to use a scalar register. If the instruction isn't able to use simm5 or the immediate is too large, we'll need to materialize the immediate in a register. As far as I know constants with all 1s in the upper bits should materialize as well or better than all 0s. Longer term we should probably have a SEW aware PatFrag to ignore the bits above SEW before checking simm5. I updated about half the test cases in some tests to use a negative constant to get coverage for this. Reviewed By: evandro Differential Revision: https://reviews.llvm.org/D93487
-
Nikita Popov authored
MSSA DSE starts at a killing store, finds an earlier store and then checks that the earlier store is not read along any paths (without being killed first). However, it uses the memory location of the killing store for that, not the earlier store that we're attempting to eliminate. This has a number of problems: * Mismatches between what BasicAA considers aliasing and what DSE considers an overwrite (even though both are correct in isolation) can result in miscompiles. This is PR48279, which D92045 tries to fix in a different way. The problem is that we're using a location from a store that is potentially not executed and thus may be UB, in which case analysis results can be arbitrary. * Metadata on the killing store may be used to determine aliasing, but there is no guarantee that the metadata is valid, as the specific killing store may not be executed. Using the metadata on the earlier store is valid (it is the store we're removing, so on any execution where its removal may be observed, it must be executed). * The location is imprecise. For full overwrites the killing store will always have a location that is larger or equal than the earlier access location, so it's beneficial to use the earlier access location. This is not the case for partial overwrites, in which case either location might be smaller. There is some room for improvement here. Using the earlier access location means that we can no longer cache which accesses are read for a given killing store, as we may be querying different locations. However, it turns out that simply dropping the cache has no notable impact on compile-time. Differential Revision: https://reviews.llvm.org/D93523
-