- Jun 10, 2019
-
-
Nikola Prica authored
Variable's stack location can stretch longer than it should. If a variable is placed at the stack in a some nested basic block its range can be calculated to be up to the next occurrence of the variable's DBG_VALUE, or up to the end of the function, thus covering a basic blocks that should not be included in the variable’s location range. This happens because the DbgEntityHistoryCalculator ends register locations at the end of a basic block only if the variable’s location register has been changed throughout the function, which is not the case for the register used to reference stack objects. This patch also tries to produce a single value location if the location list builder managed to merge all the locations into one. Reviewers: aprantl, dstenb, jmorse Reviewed By: aprantl, dstenb, jmorse Subscribers: djtodoro, ivanbaev, asowda Tags: #debug-info Differential Revision: https://reviews.llvm.org/D61600 llvm-svn: 362923
-
Fangrui Song authored
e.g. glibc libc.so on riscv64 uses `OUTPUT_FORMAT(elf64-littleriscv)`. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D63070 llvm-svn: 362922
-
QingShan Zhang authored
This opportunity is found from spec 2017 557.xz_r. And it is used by the sha encrypt/decrypt. See sha-2/sha512.c static void store64(u64 x, unsigned char* y) { for(int i = 0; i != 8; ++i) y[i] = (x >> ((7-i) * 8)) & 255; } static u64 load64(const unsigned char* y) { u64 res = 0; for(int i = 0; i != 8; ++i) res |= (u64)(y[i]) << ((7-i) * 8); return res; } The load64 has been implemented by https://reviews.llvm.org/D26149 This patch is trying to implement the store pattern. Match a pattern where a wide type scalar value is stored by several narrow stores. Fold it into a single store or a BSWAP and a store if the targets supports it. Assuming little endian target: i8 *p = ... i32 val = ... p[0] = (val >> 0) & 0xFF; p[1] = (val >> 8) & 0xFF; p[2] = (val >> 16) & 0xFF; p[3] = (val >> 24) & 0xFF; > *((i32)p) = val; i8 *p = ... i32 val = ... p[0] = (val >> 24) & 0xFF; p[1] = (val >> 16) & 0xFF; p[2] = (val >> 8) & 0xFF; p[3] = (val >> 0) & 0xFF; > *((i32)p) = BSWAP(val); Differential Revision: https://reviews.llvm.org/D62897 llvm-svn: 362921 -
Craig Topper authored
[X86] When promoting i16 compare with immediate to i32, try to use sign_extend for eq/ne if the input is truncated from a type with enough sign its. Summary: Our default behavior is to use sign_extend for signed comparisons and zero_extend for everything else. But for equality we have the freedom to use either extension. If we can prove the input has been truncated from something with enough sign bits, we can use sign_extend instead and let DAG combine optimize it out. A similar rule is used by type legalization in LegalizeIntegerTypes. This gets rid of the movzx in PR42189. The immediate will still take 4 bytes instead of the 2 bytes plus 0x66 prefix a cmp di, 32767 would get, but it avoids a length changing prefix. Reviewers: RKSimon, spatel, xbolva00 Reviewed By: xbolva00 Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63032 llvm-svn: 362920
-
Craig Topper authored
Summary: We can only use the memory form of cvtss2sd under optsize due to a partial register update. So previously we were emitting 2 instructions for extload when optimizing for speed. Also due to a late optimization in preprocessiseldag we had to handle (fpextend (loadf32)) under optsize. This patch forces extload to expand so that it will always be in the (fpextend (loadf32)) form during isel. And when optimizing for speed we can just let each of those pieces select an instruction independently. Reviewers: spatel, RKSimon Reviewed By: RKSimon Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62710 llvm-svn: 362919
-
Vivek Pandya authored
This is fix for https://bugs.llvm.org/show_bug.cgi?id=41336 Reviewers: jdoerfert Reviewed by: jdoerfert Differential Revision: https://reviews.llvm.org/D63045 llvm-svn: 362918
-
Kai Luo authored
llvm-svn: 362917
-
Nico Weber authored
llvm-svn: 362916
-
Craig Topper authored
llvm-svn: 362915
-
Craig Topper authored
[X86] Convert f32/f64 FANDN/FAND/FOR/FXOR to vector logic ops and scalar_to_vector/extract_vector_elts to reduce isel patterns. Previously we did the equivalent operation in isel patterns with COPY_TO_REGCLASS operations to transition. By inserting scalar_to_vetors and extract_vector_elts before isel we can allow each piece to be selected individually and accomplish the same final result. I ideally we'd use vector operations earlier in lowering/combine, but that looks to be more difficult. The scalar-fp-to-i64.ll changes are because we have a pattern for using movlpd for store+extract_vector_elt. While an f64 store uses movsd. The encoding sizes are the same. llvm-svn: 362914
-
Nico Weber authored
This reverts commit f4fc01f8. It caused a 3-4x slowdown when doing thinlto links, PR42210. llvm-svn: 362913
-
David Bolvansky authored
Reviewers: craig.topper, spatel, RKSimon, bkramer Reviewed By: spatel Subscribers: javed.absar, lebedev.ri, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63004 llvm-svn: 362912
-
Roman Lebedev authored
A precondition 'x != 0' was forgotten by me: https://rise4fun.com/Alive/JFNP https://rise4fun.com/Alive/jHvL These 4 folds with non-constants could be re-enabled, but for now let's go for the simplest solution. https://bugs.llvm.org/show_bug.cgi?id=42198 llvm-svn: 362911
-
Roman Lebedev authored
[NFC][InstCombine] Revisit canonicalize-constant-low-bit-mask-and-icmp-s* tests in preparatio for PR42198. The `icmp sgt`/`icmp sle` variants are, too, miscompiles: https://rise4fun.com/Alive/JFNP https://rise4fun.com/Alive/jHvL A precondition 'x != 0' was forgotten by me. While ensuring test coverage for `-1`, also add test coverage for `0` mask. Mask `0` is allowed for all the folds, mask `-1` is allowed for all the folds with unsigned `icmp` pred. Constant mask `0` is missed though. https://bugs.llvm.org/show_bug.cgi?id=42198 llvm-svn: 362910
-
Sanjay Patel authored
This isn't the ideal fix (use FMF on the select), but it's still an improvement until we have better FMF propagation to selects and other FP math operators. I don't think there's much risk of regression from this change by not including the FMF on the fcmp any more. The nsz/nnan FMF should be the same on the fcmp and the fneg (fsub) because they have the same operand. This works around the most glaring FMF logical inconsistency cited in PR38086: https://bugs.llvm.org/show_bug.cgi?id=38086 llvm-svn: 362909
-
David Bolvansky authored
llvm-svn: 362908
-
- Jun 09, 2019
-
-
David Bolvansky authored
llvm-svn: 362907
-
David Bolvansky authored
llvm-svn: 362906
-
Nikita Popov authored
For PR42178. llvm-svn: 362905
-
Sanjay Patel authored
llvm-svn: 362904
-
Sanjay Patel authored
This is another step towards correcting our usage of fast-math-flags when applied on an fcmp. In this case, we are checking for 'nnan' on the fcmp itself rather than the operand of the fcmp. But I'm leaving that clause in until we're more confident that we can stop relying on fcmp's FMF. By using the more general "isKnownNeverNaN()", we gain a simplification shown on the tests with 'uitofp' regardless of the FMF on the fcmp (uitofp never produces a NaN). On the tests with 'fabs', we are now relying on the FMF for the call fabs instruction in addition to the FMF on the fcmp. This is a continuation of D62979 / rL362879. llvm-svn: 362903
-
Sanjay Patel authored
Opposite predicate for rL362742 / rL362879 / D62979 llvm-svn: 362902
-
Anton Afanasyev authored
This is the second part of the commit fixing PR38917 (hoisting partitially redundant machine instruction). Most of PRE (partitial redundancy elimination) and CSE work is done on LLVM IR, but some of redundancy arises during DAG legalization. Machine CSE is not enough to deal with it. This simple PRE implementation works a little bit intricately: it passes before CSE, looking for partitial redundancy and transforming it to fully redundancy, anticipating that the next CSE step will eliminate this created redundancy. If CSE doesn't eliminate this, than created instruction will remain dead and eliminated later by Remove Dead Machine Instructions pass. The third part of the commit is supposed to refactor MachineCSE, to make it more clear and to merge MachinePRE with MachineCSE, so one need no rely on further Remove Dead pass to clear instrs not eliminated by CSE. First step: https://reviews.llvm.org/D54839 Fixes llvm.org/PR38917 This is fixed recommit of r361356 after PowerPC64 multistage build failure. llvm-svn: 362901
-
Ayke van Laethem authored
Pointers that are in-bounds (either through dereferenceable_or_null or thorough a getelementptr inbounds) cannot be captured with a comparison against null. There is no way to construct a pointer that is still in bounds but also NULL. This helps safe languages that insert null checks before load/store instructions. Without this patch, almost all pointers would be considered captured even for simple loads. With this patch, an icmp with null will not be seen as escaping as long as certain conditions are met. There was a lot of discussion about this patch. See the Phabricator thread for detals. Differential Revision: https://reviews.llvm.org/D60047 llvm-svn: 362900
-
Ayke van Laethem authored
This patch adds Go bindings for atomic operations in LLVM. Differential Revision: https://reviews.llvm.org/D61034 llvm-svn: 362899
-
Jatin Bhateja authored
Reviewers: llvm-commits, jbhateja Reviewed By: jbhateja Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63055 llvm-svn: 362898
-
Simon Pilgrim authored
llvm-svn: 362897
-
Amara Emerson authored
A simple re-use of the immediate operand matcher and renderer functions. rdar://43795178 llvm-svn: 362896
-
Craig Topper authored
We emit a MOVSSmr and a COPY_TO_REGCLASS, but that's what we would get from selecting the store and extractelt independently. llvm-svn: 362895
-
Craig Topper authored
[X86] Mutate scalar fceil/ffloor/ftrunc/fnearbyint/frint into X86ISD::RNDSCALE during PreProcessIselDAG to cut down on number of isel patterns. Similar was done for vectors in r362535. Removes about 1200 bytes from the isel table. llvm-svn: 362894
-
Ayke van Laethem authored
Add bindings so that predicates on comparisons (icmp/fcmp) can be inspected from IR. Note: I considered adding Value.ICmpPredicate() etc. instead but Value.IntPredicate() seemed easier to read and matches the name of the returned type. (This change was also pushed two commits ago but accidentally had the wrong title and description.) Revision: https://reviews.llvm.org/D53884 llvm-svn: 362893
-
Ayke van Laethem authored
This reverts commit f675a60c. The commit had the wrong title/description. Sorry about the mess! llvm-svn: 362892
-
Ayke van Laethem authored
This is very useful for inspecting generated IR, there appears to be no other way to get the called function from a CallInst. Differential Revision: https://reviews.llvm.org/D52972 llvm-svn: 362891
-
Ayke van Laethem authored
This is very useful for inspecting generated IR, there appears to be no other way to get the called function from a CallInst. Revision: https://reviews.llvm.org/D52972 llvm-svn: 362890
-
Ayke van Laethem authored
After using ReplaceAllUsesWith on an instruction, it may be necessary to erase it even though it is dead. llvm-svn: 362889
-
Ayke van Laethem authored
Add a newline, which is missing according to go fmt. llvm-svn: 362888
-
Kristof Umann authored
Some minor formatting to make the file more readable. Added //===----------===// around the implementation of class methods and divided anonymous namespaces as per https://llvm.org/docs/CodingStandards.html#anonymous-namespaces llvm-svn: 362887
-
Roman Lebedev authored
llvm-svn: 362886
-
Alex Langford authored
I forgot to remove this when I removed GetCPPLanguageRuntime from Process llvm-svn: 362885
-
Alex Langford authored
Summary: Using llvm-style rtti gives us stronger guarantees around casting LanguageRuntimes. As discussed in D62755 Differential Revision: https://reviews.llvm.org/D62934 llvm-svn: 362884
-