- Apr 17, 2019
-
-
Eric Christopher authored
The reversion apparently deleted the test/Transforms directory. Will be re-reverting again. llvm-svn: 358552
-
Eric Fiselier authored
llvm-svn: 358551
-
Aaron Smith authored
LLVM's wchar to UTF8 conversion routine expects an empty string to store the output. GetHostName() on Windows is sometimes called with a non-empty string which triggers an assert. The simple fix is to clear the output string before the conversion. llvm-svn: 358550
-
Peter Collingbourne authored
This makes the file more cross compilation friendly. llvm-svn: 358549
-
Eric Christopher authored
It's been on by default for 4 years and cleans up the pass hierarchy. llvm-svn: 358548
-
Rui Ueyama authored
parallelForEach is not reentrant. We use parallelForEach to call each section's writeTo(), so calling the same function within writeTo() is not safe. Fixes https://bugs.llvm.org/show_bug.cgi?id=41508 Differential Revision: https://reviews.llvm.org/D60757 llvm-svn: 358547
-
Eric Christopher authored
As it's causing some bot failures (and per request from kbarton). This reverts commit r358543/ab70da07. llvm-svn: 358546
-
Rui Ueyama authored
Patch by Nicholas Allegra. The Mach-O writer calculates the size of load commands multiple times. First, Util::assignAddressesToSections() (in MachONormalizedFileFromAtoms.cpp) calculates the size using headerAndLoadCommandsSize() (in MachONormalizedFileBinaryWriter.cpp), which creates a temporary MachOFileLayout for the NormalizedFile, only to retrieve its headerAndLoadCommandsSize. Later, writeBinary() (in MachONormalizedFileBinaryWriter.cpp) creates a new layout and uses the offsets from that layout to actually write out everything in the NormalizedFile. But the NormalizedFile changes between the first computation and the second. When Util::assignAddressesToSections is called, file.functionStarts is always empty because Util::addFunctionStarts has not yet been called. Yet MachOFileLayout decides whether to include a LC_FUNCTION_STARTS command based on whether file.functionStarts is nonempty. Therefore, the initial computation always omits it. Because padding for the __TEXT segment (to make its size a multiple of the page size) is added between the load commands and the first section, LLD still generates a valid binary as long as the amount of padding happens to be large enough to fit LC_FUNCTION_STARTS command, which it usually is. However, it's easy to reproduce the issue by adding a section of a precise size. Given foo.c: __attribute__((section("__TEXT,__foo"))) char foo[0xd78] = {0}; Run: clang -dynamiclib -o foo.dylib foo.c -fuse-ld=lld -install_name /usr/lib/foo.dylib otool -lvv foo.dylib This should produce: truncated or malformed object (offset field of section 1 in LC_SEGMENT_64 command 0 not past the headers of the file) This commit: - Changes MachOFileLayout to always assume LC_FUNCTION_STARTS is present for the initial computation, as long as generating LC_FUNCTION_STARTS is enabled. It would be slightly better to check whether there are actually any functions, since no LC_FUNCTION_STARTS will be generated if not, but it doesn't cause a problem if the initial computation is too high. - Adds a test. - Adds an assert in MachOFileLayout::writeSectionContent() that we are not writing section content into the load commands region (which would happen if the offset was calculated too low due to the initial load commands size calculation being too low). Adds an assert in MachOFileLayout::writeLoadCommands to validate a similar situation where two size-of-load-commands computations are expected to be equivalent. llvm-svn: 358545
-
Fangrui Song authored
Summary: When -gsplit-dwarf is used together with other -g options, in most cases the computed debug info level is decided by the last -g option, with one special case (see below). This patch drops that special case and thus makes it easy to reason about: // If a lower debug level -g comes after -gsplit-dwarf, in some cases // -gsplit-dwarf is cancelled. -gsplit-dwarf -g0 => 0 -gsplit-dwarf -gline-directives-only => DebugDirectivesOnly -gsplit-dwarf -gmlt -fsplit-dwarf-inlining => 1 -gsplit-dwarf -gmlt -fno-split-dwarf-inlining => 1 + split // If -gsplit-dwarf comes after -g options, with this patch, the net // effect is 2 + split for all combinations -g0 -gsplit-dwarf => 2 + split -gline-directives-only -gsplit-dwarf => 2 + split -gmlt -gsplit-dwarf -fsplit-dwarf-inlining => 2 + split -gmlt -gsplit-dwarf -fno-split-dwarf-inlining => 1 + split (before) 2 + split (after) The last case has been changed. In general, if the user intends to lower debug info level, place that -g option after -gsplit-dwarf. Some context: In gcc, the last of -gsplit-dwarf -g0 -g1 -g2 -g3 -ggdb[0-3] -gdwarf-* ... decides the debug info level (-gsplit-dwarf -gdwarf-* have level 2). It is a bit unfortunate that -gsplit-dwarf -gdwarf-* ... participate in the level computation but that is the status quo. Reviewers: dblaikie, echristo, probinson Reviewed By: dblaikie, probinson Subscribers: probinson, aprantl, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59923 llvm-svn: 358544
-
Kit Barton authored
This patch adds a basic loop fusion pass. It will fuse loops that conform to the following 4 conditions: 1. Adjacent (no code between them) 2. Control flow equivalent (if one loop executes, the other loop executes) 3. Identical bounds (both loops iterate the same number of iterations) 4. No negative distance dependencies between the loop bodies. The pass does not make any changes to the IR to create opportunities for fusion. Instead, it checks if the necessary conditions are met and if so it fuses two loops together. The pass has not been added to the pass pipeline yet, and thus is not enabled by default. It can be run stand alone using the -loop-fusion option. Phabricator: https://reviews.llvm.org/D55851 llvm-svn: 358543
-
Yi Kong authored
The generic version of comparesf2 defines __cmpsf2 alias for libgcc compatibility, but the ARM overlay is missing the alias. Differential Revision: https://reviews.llvm.org/D60805 llvm-svn: 358542
-
Marshall Clow authored
Add tests for stability to list::sort and forward_list::sort. Thanks to Jonathan Wakely for the notice llvm-svn: 358541
-
Sam McCall authored
Summary: Add to STLExtras a binary search function with a simple mental model: You provide a range and a predicate which is true above a certain point. bsearch() tells you that point. Overloads are provided for integers, iterators, and containers. This is more suitable than std:: alternatives in many cases: - std::binary_search only indicates presence/absence - upper_bound/lower_bound give you the opportunity to pick the wrong one - all of the options have confusing names and definitions when your predicate doesn't have simple "less than" semantics - all of the options require iterators - we plumb around a useless `value` parameter that should be a lambda capture The API is inspired by Go's standard library, but we add an extra parameter as well as some overloads and templates to show how clever C++ is. Reviewers: ilya-biryukov, gribozavr Subscribers: dexonsmith, kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60779 llvm-svn: 358540
-
Sanjay Patel authored
The scale can 1, 2, or 3. llvm-svn: 358539
-
Leonard Chan authored
llvm-svn: 358538
-
Douglas Yung authored
Modify test to use -S instead of -c so that it works when an external assembler is used that is not present. llvm-svn: 358537
-
Peter Collingbourne authored
With partitions, each partition should have the same build id. This means that the build id needs to be only computed once, otherwise we will end up with different build ids in each partition as a result of the file contents changing. This change moves the computation of the build id into Writer so that it only happens once. Differential Revision: https://reviews.llvm.org/D60342 llvm-svn: 358536
-
Mitch Phillips authored
Summary: CFA was setup incorrectly, as there is an 8-byte gap at the top of the stack for SP 16-byte alignment purposes. Reviewers: eugenis Reviewed By: eugenis Subscribers: kubamracek, javed.absar, #sanitizers, llvm-commits, pcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60798 llvm-svn: 358535
-
Marshall Clow authored
Fix list/forward_list implementations of remove_if and unique to deal with predicates that are part of the sequence passed in. We already do this for remove. llvm-svn: 358534
-
- Apr 16, 2019
-
-
Davide Italiano authored
llvm-svn: 358533
-
Robert Widmann authored
Summary: Metadata for a global variable is really a (GlobalVariable, Expression) tuple. Allow access to these, then allow retrieving the file, scope, and line for a DIVariable, whether global or local. This should be the last of the accessors required for uniform access to location and file information metadata. Reviewers: jberdine, whitequark, deadalnix Reviewed By: jberdine, whitequark Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60725 llvm-svn: 358532
-
Ali Tamur authored
llvm-svn: 358531
-
Alex Langford authored
This was updated in r356703 to use llvm::sys::RetryAfterSignal, which comes from llvm/Support/Errno.h. The header wasn't added, so it fails if you compile for arm64/aarch64. llvm-svn: 358530
-
Louis Dionne authored
llvm-svn: 358529
-
Davide Italiano authored
Summary: Saves some build times, and they're not part of the usual developer workflow. Reviewers: JDevlieghere, friss Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D60780 llvm-svn: 358528
-
Nick Desaulniers authored
Summary: The printOperand function takes a default parameter, for which there are zero call sites that explicitly pass such a parameter. As such, there is no case to support. This means that the method printVecModifiedImmediate is purly dead code, and can be removed. The eventual goal for some of these AsmPrinter refactoring is to have printOperand be a virtual method; making it easier to print operands from the base class for more generic Asm printing. It will help if all printOperand methods have the same function signature (ie. no Modifier argument when not needed). Reviewers: echristo, tra Reviewed By: echristo Subscribers: jholewinski, hiraditya, llvm-commits, craig.topper, srhines Tags: #llvm Differential Revision: https://reviews.llvm.org/D60727 llvm-svn: 358527
-
Simon Pilgrim authored
As discussed on PR41359, this patch renames the pair of shift-mask target feature functions to make their purposes more obvious. shouldFoldShiftPairToMask -> shouldFoldConstantShiftPairToMask preferShiftsToClearExtremeBits -> shouldFoldMaskToVariableShiftPair llvm-svn: 358526
-
Frederic Riss authored
In an effort to help new LLDB developers, we added checks and messaging around the selection of your codesigning identity on macOS. While helpful, it is not actually correct. It's perfectly valid to codesign with an identity that is not named lldb_codesign. Currently this fails the build. This patch keeps a warning that informs developers how to setup lldb_codesign and how to pass it to cmake, but it allows the build to proceed with a different identity. llvm-svn: 358525
-
Louis Dionne authored
llvm-svn: 358524
-
Sanjay Patel authored
This is 1 of the problems discussed in the post-commit thread for: rL355741 / http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190311/635516.html and filed as: https://bugs.llvm.org/show_bug.cgi?id=41101 Instcombine tries to canonicalize some of these cases (and there's room for improvement there independently of this patch), but it can't always do that because of extra uses. So we need to recognize these commuted operand patterns here in EarlyCSE. This is similar to how we detect commuted compares and commuted min/max/abs. Differential Revision: https://reviews.llvm.org/D60723 llvm-svn: 358523
-
Anton Afanasyev authored
Summary: Use llvm::json::Array.reserve() to optimize json output time. Here is motivation: https://reviews.llvm.org/D60609#1468941. In short: for the json array with ~32K entries, pushing back each entry takes ~4% of whole time compared to the method of preliminary memory reservation: (3995-3845)/3995 = 3.75%. Reviewers: lebedev.ri Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60792 llvm-svn: 358522
-
Nikita Popov authored
If a umul.with.overflow or smul.with.overflow operation cannot overflow, simplify it to a simple mul nuw / mul nsw. After the refactoring in D60668 this is just a matter of removing an explicit check against multiplications. Differential Revision: https://reviews.llvm.org/D60791 llvm-svn: 358521
-
Anton Afanasyev authored
Summary: Space reservation increases json lib performance for the arrays with large number of entries. Here is the example and discussion: https://reviews.llvm.org/D60609#1468941 Reviewers: lebedev.ri, sammccall Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60788 llvm-svn: 358520
-
Simon Pilgrim authored
This is a refactoring patch which should have all the functionality of the current code. Its goal is twofold: i. Cleanup and simplify the reordering code, and ii. Generalize reordering so that it will work for an arbitrary number of operands, not just 2. This is the second patch in a series of patches that will enable operand reordering across chains of operations. An example of this was presented in EuroLLVM'18 https://www.youtube.com/watch?v=gIEn34LvyNo . Committed on behalf of @vporpo (Vasileios Porpodas) Differential Revision: https://reviews.llvm.org/D59973 llvm-svn: 358519
-
Louis Dionne authored
Summary: I'm not sure what the problem was at the time, however I don't think this is necessary since buildit doesn't exist anymore. Instead of the workaround, the correct thing to do is to leave out the get_new_handler/set_new_handler definitions from libc++ when we're getting them from libc++abi. Reviewers: EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D60717 llvm-svn: 358518
-
Nikita Popov authored
Should be simplified to simple mul. llvm-svn: 358517
-
Simon Pilgrim authored
Improves codegen demonstrated by D60512 - instructions represented by X86ISD::PERMV/PERMV3 can never memory fold the operand used for their index register. This patch updates the 'isUseOfShuffle' helper into the more capable 'isFoldableUseOfShuffle' that recognises that the op is used for a X86ISD::PERMV/PERMV3 index mask and can't be folded - allowing us to use broadcast/subvector-broadcast ops to reduce the size of the mask constant pool data. Differential Revision: https://reviews.llvm.org/D60562 llvm-svn: 358516
-
Nikita Popov authored
If a constant shift amount is used, then only some of the LHS/RHS operand bits are demanded and we may be able to simplify based on that. InstCombineSimplifyDemanded already had the necessary support for that, we just weren't calling it with fshl/fshr as root. In particular, this allows us to relax some masked funnel shifts into simple shifts, as shown in the tests. Patch by Shawn Landden. Differential Revision: https://reviews.llvm.org/D60660 llvm-svn: 358515
-
Nikita Popov authored
Baseline tests for D60660. Patch by Shawn Landden. Differential Revision: https://reviews.llvm.org/D60688 llvm-svn: 358514
-
Sanjay Patel authored
Promoting the shift to the wider type should allow LEA. llvm-svn: 358513
-