summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* typo; NFCSanjay Patel2015-09-111-1/+1
| | | | llvm-svn: 247454
* Use function attribute "stackrealign" to decide whether stackAkira Hatanaka2015-09-112-10/+2
| | | | | | | | | | | | | | | | | realignment should be forced. With this commit, we can now force stack realignment when doing LTO and do so on a per-function basis. Also, add a new cl::opt option "stackrealign" to CommandFlags.h which is used to force stack realignment via llc's command line. Out-of-tree projects currently using -force-align-stack to force stack realignment should make changes to attach the attribute to the functions in the IR. Differential Revision: http://reviews.llvm.org/D11814 llvm-svn: 247450
* [X86] Make sure startproc/endproc are pairedDavid Majnemer2015-09-111-1/+1
| | | | | | | | | | We used different conditions to determine if we should emit startproc vs endproc. Use the same condition to ensure that they will always be paired. This fixes PR24374. llvm-svn: 247435
* [IR] Print the label operands of a catchpad like an invokeReid Kleckner2015-09-111-1/+1
| | | | | | | | | | | | | The rest of the EH pads are fine, since they have at most one label and take fewer operands for the personality. Old catchpad vs. new: %5 = catchpad [i8* bitcast (i32 ()* @"\01?filt$0@0@main@@" to i8*)] to label %__except.ret.10 unwind label %catchendblock.9 ----- %5 = catchpad [i8* bitcast (i32 ()* @"\01?filt$0@0@main@@" to i8*)] to label %__except.ret.10 unwind label %catchendblock.9 llvm-svn: 247433
* [CodeGen] Refactor TLI/AtomicExpand interface to make LLSC explicit.Ahmed Bougacha2015-09-119-41/+53
| | | | | | | | | | | | | | | We used to have this magic "hasLoadLinkedStoreConditional()" callback, which really meant two things: - expand cmpxchg (to ll/sc). - expand atomic loads using ll/sc (rather than cmpxchg). Remove it, and, instead, introduce explicit callbacks: - bool shouldExpandAtomicCmpXchgInIR(inst) - AtomicExpansionKind shouldExpandAtomicLoadInIR(inst) Differential Revision: http://reviews.llvm.org/D12557 llvm-svn: 247429
* [CodeGen] Rename AtomicRMWExpansionKind to AtomicExpansionKind.Ahmed Bougacha2015-09-118-22/+21
| | | | | | This lets us generalize its usage to the other atomic instructions. llvm-svn: 247428
* [PR24785] Appease MSC18 to tweak optimizations.NAKAMURA Takumi2015-09-111-0/+8
| | | | | | | | | | This brings a warning. cl : Command line warning D9035: option 'Og-' has been deprecated and will be removed in a future release We should resolve PR11951 to remove this tweak. llvm-svn: 247427
* Add #include llvm-config.h to Locale.cpp which depends on LLVM_ON_WIN32.Yaron Keren2015-09-111-0/+1
| | | | | | | | | | Source code was assuming that llvm-config.h would be included somehow but up to r247253 that added #include "llvm/Support/Compiler.h" to StringRef.h the config file was not actually included. The inclusion of llvm-config.h caused a change of behaviour in tools/clang/test/Frontend/source-col-map.c: previously it would output the original UTF-8 but now it outputs <U+03B1>. llvm-svn: 247409
* PPCFrameLowering::emitEpilogue(): Avoid manipulating MBBI on iterator end.NAKAMURA Takumi2015-09-111-1/+1
| | | | | | It caused crash in MachineInstr::hasPropertyInBundle() since r247237. llvm-svn: 247395
* [opaque pointer type] Add textual IR support for explicit type parameter for ↵David Blaikie2015-09-112-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | global aliases update.py: import fileinput import sys import re alias_match_prefix = r"(.*(?:=|:|^)\s*(?:external |)(?:(?:private|internal|linkonce|linkonce_odr|weak|weak_odr|common|appending|extern_weak|available_externally) )?(?:default |hidden |protected )?(?:dllimport |dllexport )?(?:unnamed_addr |)(?:thread_local(?:\([a-z]*\))? )?alias" plain = re.compile(alias_match_prefix + r" (.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|addrspacecast|\[\[[a-zA-Z]|\{\{).*$)") cast = re.compile(alias_match_prefix + r") ((?:bitcast|inttoptr|addrspacecast)\s*\(.* to (.*?)(| addrspace\(\d+\) *)\*\)\s*(?:;.*)?$)") gep = re.compile(alias_match_prefix + r") ((?:getelementptr)\s*(?:inbounds)?\s*\((?P<type>.*), (?P=type)(?:\s*addrspace\(\d+\)\s*)?\* .*\)\s*(?:;.*)?$)") def conv(line): m = re.match(cast, line) if m: return m.group(1) + " " + m.group(3) + ", " + m.group(2) m = re.match(gep, line) if m: return m.group(1) + " " + m.group(3) + ", " + m.group(2) m = re.match(plain, line) if m: return m.group(1) + ", " + m.group(2) + m.group(3) + "*" + m.group(4) + "\n" return line for line in sys.stdin: sys.stdout.write(conv(line)) apply.sh: for name in "$@" do python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name" rm -f "$name.tmp" done The actual commands: From llvm/src: find test/ -name *.ll | xargs ./apply.sh From llvm/src/tools/clang: find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}" From llvm/src/tools/polly: find test/ -name *.ll | xargs ./apply.sh llvm-svn: 247378
* Fixed a bug that BranchProbability is not defined in BlockFrequency.cpp. NFC.Cong Hou2015-09-111-1/+0
| | | | llvm-svn: 247376
* AsmWriter: Avoid O(N^2) processing of metadataDuncan P. N. Exon Smith2015-09-111-6/+8
| | | | | | | | | | | | | | | | | | Fix embarrassing bugs I introduced to the `SlotTracker` in or around r235785. I had us iterating through every instruction in a function (and hitting a map in the LLVMContext) for every basic block in the function. While there, completely avoid the call to `SlotTracker::processFunctionMetadata()` from `SlotTracker::processFunction()` if we've speculatively done this already in `SlotTracker::processModule()` by checking `ShouldInitializeAllMetadata` (this wasn't an algorithmic problem, but it's touching the same line of code). Fixes PR24699. llvm-svn: 247372
* Revert "[InstCombineCalls] Use isKnownNonNullAt() to check nullness of ↵Mehdi Amini2015-09-111-1/+1
| | | | | | | | | | | | | | | passing arguments at callsite" This reverts commit r247356. Breaks test/Transforms/InstCombine/pr8547.ll with: Wrong types for attribute: byval inalloca nest noalias nocapture nonnull readnone readonly sret dereferenceable(1) dereferenceable_or_null(1) %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 nonnull %conv2) #0 LLVM ERROR: Broken function found, compilation aborted! From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 247371
* [libFuzzer] perform fewer crossover operations compared to plain mutationsKostya Serebryany2015-09-111-7/+8
| | | | llvm-svn: 247364
* Add .exe check to Execute to fix clang-modernize tests broken in r247358Reid Kleckner2015-09-101-0/+8
| | | | llvm-svn: 247361
* ScanDirForExecutable on Windows fails to find executables with the "exe" ↵Reid Kleckner2015-09-102-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | extension in name When the driver tries to locate a program by its name, e.g. a linker, it scans the paths provided by the toolchain using the ScanDirForExecutable function. If the lookup fails, the driver uses llvm::sys::findProgramByName. Unlike llvm::sys::findProgramByName, ScanDirForExecutable is not aware of file extensions. If the program has the "exe" extension in its name, which is very common on Windows, ScanDirForExecutable won't find it under the toolchain-provided paths. This patch changes the Windows version of the "`can_execute`" function called by ScanDirForExecutable to respect file extensions, similarly to llvm::sys::findProgramByName. Patch by Oleg Ranevskyy Reviewers: rnk Differential Revision: http://reviews.llvm.org/D12711 llvm-svn: 247358
* Pass BranchProbability/BlockMass by value instead of const& as they are ↵Cong Hou2015-09-1012-38/+36
| | | | | | small. NFC. llvm-svn: 247357
* [InstCombineCalls] Use isKnownNonNullAt() to check nullness of passing ↵Chen Li2015-09-101-1/+1
| | | | | | | | | | | | | | arguments at callsite Summary: This patch replaces isKnownNonNull() with isKnownNonNullAt() when checking nullness of passing arguments at callsite. In this way it can handle cases where the argument does not have nonnull attribute but has a dominating null check from the CFG. Reviewers: reames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12779 llvm-svn: 247356
* [InstCombineCalls] Use isKnownNonNullAt() to check nullness of gc.relocate ↵Chen Li2015-09-101-1/+1
| | | | | | | | | | | | | | return value Summary: This patch replaces isKnownNonNull() with isKnownNonNullAt() when checking nullness of gc.relocate return value. In this way it can handle cases where the relocated value does not have nonnull attribute but has a dominating null check from the CFG. Reviewers: reames Subscribers: llvm-commits, sanjoy Differential Revision: http://reviews.llvm.org/D12772 llvm-svn: 247353
* Remove gcc warning when comparing an unsigned var for >= 0Filipe Cabecinhas2015-09-101-1/+1
| | | | llvm-svn: 247352
* [WinEH] Push and pop EBP for 32-bit funcletsReid Kleckner2015-09-101-7/+10
| | | | | | | | The Win32 EH runtime caller does not preserve EBP, even though it does preserve the CSRs (EBX, ESI, EDI) for us. The result was that each finally funclet call would leave the frame pointer off by 12 bytes. llvm-svn: 247348
* AMDGPU: Simplify debug printingMatt Arsenault2015-09-103-13/+8
| | | | llvm-svn: 247345
* AMDGPU: Use StringRef valueMatt Arsenault2015-09-101-1/+1
| | | | llvm-svn: 247344
* [SPARC] Switch to the Machine Scheduler.James Y Knight2015-09-102-1/+6
| | | | | | | | | | | | | The (mostly-deprecated) SelectionDAG-based ILPListDAGScheduler scheduler was making poor scheduling decisions, causing high register pressure and extraneous register spills. Switching to the newer machine scheduler generates better code -- even without there being a machine model defined for SPARC yet. (Actually committing the test changes too, this time, unlike r247315) llvm-svn: 247343
* Fix SEH state numbering algorithm to handle cleanupendpadsReid Kleckner2015-09-101-4/+9
| | | | | | | WinEHPrepare's new coloring algorithm really expects to see cleanupendpads now, so Clang will start emitting them soon. llvm-svn: 247341
* [LV] Relax Small Size Reduction Type RequirementMatthew Simpson2015-09-101-6/+14
| | | | | | | | | | | | | This patch enables small size reductions in which the source types are smaller than the reduction type (e.g., computing an i16 sum from the values in an i8 array). The previous behavior was to only allow small size reductions if the source types and reduction type were the same. The change accounts for the fact that the existing sign- and zero-extend instructions in these cases should still be included in the cost model. Differential Revision: http://reviews.llvm.org/D12770 llvm-svn: 247337
* [RuntimeDyld] Support non-zero addends for the MachO X86_64 SUBTRACTOR reloc.Lang Hames2015-09-101-2/+6
| | | | | | This functionality was accidentally left out of r247119. llvm-svn: 247336
* [RuntimeDyld] Fix a bug in debugging output: all sections should be dumpedLang Hames2015-09-101-2/+13
| | | | | | | | | | | before any relocations have been applied, and again after all relocations have been applied. Previously each section was dumped before and after relocations targetting it were applied, but this only shows the impact of relocations that point to other symbols in the same section. llvm-svn: 247335
* Add an explicit 'inline' specifier to these static functions. GCC isChandler Carruth2015-09-101-14/+14
| | | | | | | | warning on them having always_inline attribute for reasons I don't fully understand -- static functions are just as inlinable as inline functions in terms of linkage. llvm-svn: 247334
* Revert "[SPARC] Switch to the Machine Scheduler."James Y Knight2015-09-102-6/+1
| | | | | | | | This reverts commit r247315. Accidentally omitted test changes; will resubmit full change shortly. llvm-svn: 247328
* [IR] Conservatively mark 'catchpad' as accessing memoryDavid Majnemer2015-09-101-0/+2
| | | | | | | | The exact semantics of 'catchpad' are really in the hands of the personality routine so we shouldn't assume that they have no side effects. llvm-svn: 247322
* [libFuzzer] refactor the code to allow building libFuzzer on platforms that ↵Kostya Serebryany2015-09-102-17/+65
| | | | | | don't have dfsan and don't support weak functions llvm-svn: 247321
* [SPARC] Switch to the Machine Scheduler.James Y Knight2015-09-102-1/+6
| | | | | | | | | | | The (mostly-deprecated) SelectionDAG-based ILPListDAGScheduler scheduler was making poor scheduling decisions, causing high register pressure and extraneous register spills. Switching to the newer machine scheduler generates better code -- even without there being a machine model defined for SPARC yet. llvm-svn: 247315
* [SCEV] Consistently Handle Expressions That Cannot Be DividedMatthew Simpson2015-09-101-36/+26
| | | | | | | | | | | | | | | | This patch addresses the issue of SCEV division asserting on some input expressions (e.g., non-affine expressions) and quietly giving up on others. When giving up, we set the quotient to be equal to zero and the remainder to be equal to the numerator. With this patch, we always quietly give up when we cannot perform the division. This patch also adds a test case for DependenceAnalysis that previously caused an assertion. Differential Revision: http://reviews.llvm.org/D11725 llvm-svn: 247314
* [MergeFuncs] Fix callsite attributes in thunk generationJF Bastien2015-09-101-1/+9
| | | | | | | | | | | | | | | | This change correctly sets the attributes on the callsites generated in thunks. This makes sure things such as sret, sext, etc. are correctly set, so that the call can be a proper tailcall. Also, the transfer of attributes in the replaceDirectCallers function appears to be unnecessary, but until this is confirmed it will remain. Author: jrkoenig Reviewers: dschuff, jfb Subscribers: llvm-commits, nlewycky Differential revision: http://reviews.llvm.org/D12581 llvm-svn: 247313
* [SimplifyCFG] Use known bits to eliminate dead switch defaultsPhilip Reames2015-09-101-3/+9
| | | | | | | | | | | | This is a follow up to http://reviews.llvm.org/D11995 implementing the suggestion by Hans. If we know some of the bits of the value being switched on, we know that the maximum number of unique cases covers the unknown bits. This allows to eliminate switch defaults for large integers (i32) when most bits in the value are known. Note that I had to make the transform contingent on not having any dead cases. This is conservatively correct with the old code, but required for the new code since we might have a dead case which varies one of the known bits. Counting that towards our number of covering cases would be bad. If we do have dead cases, we'll eliminate them first, then revisit the possibly dead default. Differential Revision: http://reviews.llvm.org/D12497 llvm-svn: 247309
* Debug Info: Allow a DIModule to appear as the scope of other entities.Adrian Prantl2015-09-101-0/+2
| | | | llvm-svn: 247304
* [libFuzzer] add two more variants of FuzzerDriver for convenienceKostya Serebryany2015-09-102-20/+39
| | | | llvm-svn: 247300
* [WinEH] Fix single-block cleanup coloringJoseph Tremoulet2015-09-101-8/+9
| | | | | | | | | | | | | | | | | | Summary: The coloring code in WinEHPrepare queues cleanuprets' successors with the correct color (the parent one) when it sees their cleanuppad, and so later when iterating successors knows to skip processing cleanuprets since they've already been queued. This latter check was incorrectly under an 'else' condition and so inadvertently was not kicking in for single-block cleanups. This change sinks the check out of the 'else' to fix the bug. Reviewers: majnemer, andrew.w.kaylor, rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12751 llvm-svn: 247299
* Re-commit r247216: "Fix Clang-tidy misc-use-override warnings, other minor ↵Hans Wennborg2015-09-104-58/+58
| | | | | | | | | fixes" Except the changes that defined virtual destructors as =default, because that ran into problems with GCC 4.7 and overriding methods that weren't noexcept. llvm-svn: 247298
* Fix an undefined behavior introduces in r247234Steven Wu2015-09-101-1/+1
| | | | llvm-svn: 247296
* 80-cols; NFCSanjay Patel2015-09-101-4/+4
| | | | llvm-svn: 247295
* use range-based for loop; NFCISanjay Patel2015-09-101-2/+2
| | | | llvm-svn: 247294
* use range-based for loop; NFCISanjay Patel2015-09-101-2/+2
| | | | llvm-svn: 247293
* fix typo; NFCSanjay Patel2015-09-101-1/+1
| | | | llvm-svn: 247287
* Fix PR 24724 - The implicit register verifier shouldn't assume certain operandAlex Lorenz2015-09-101-39/+16
| | | | | | | | | | order. The implicit register verifier in the MIR parser should only check if the instruction's default implicit operands are present in the instruction. It should not check the order in which they occur. llvm-svn: 247283
* AVX512: Implemented encoding and intrinsics forIgor Breger2015-09-101-52/+109
| | | | | | | | | vextracti64x4 ,vextracti64x2, vextracti32x8, vextracti32x4, vextractf64x4, vextractf64x2, vextractf32x8, vextractf32x4 Added tests for intrinsics and encoding. Differential Revision: http://reviews.llvm.org/D11802 llvm-svn: 247276
* There is a trunc(lshr (zext A), Cst) optimization in InstCombineCasts thatJakub Kuderski2015-09-101-0/+20
| | | | | | | | | | | removes cast by performing the lshr on smaller types. However, currently there is no trunc(lshr (sext A), Cst) variant. This patch add such optimization by transforming trunc(lshr (sext A), Cst) to ashr A, Cst. Differential Revision: http://reviews.llvm.org/D12520 llvm-svn: 247271
* [ADT] Rewrite the StringRef::find implementation to be simpler, clearer,Chandler Carruth2015-09-101-16/+23
| | | | | | | | | | | | | | | | and tremendously less reliant on the optimizer to fix things. The code is always necessarily looking for the entire length of the string when doing the equality tests in this find implementation, but it previously was needlessly re-checking the size each time among other annoyances. By writing this so simply an ddirectly in terms of memcmp, it also is about 8x faster in a debug build, which in turn makes FileCheck about 2x faster in 'ninja check-llvm'. This saves about 8% of the time for FileCheck-heavy parts of the test suite like the x86 backend tests. llvm-svn: 247269
* [DAGCombine] Truncate BUILD_VECTOR operators if necessary when constant ↵Silviu Baranga2015-09-101-11/+25
| | | | | | | | | | | | | | | | | | | | | folding vectors Summary: The BUILD_VECTOR node will truncate its operators to match the type. We need to take this into account when constant folding - we need to perform a truncation before constant folding the elements. This is because the upper bits can change the result, depending on the operation type (for example this is the case for min/max). This change also adds a regression test. Reviewers: jmolloy Subscribers: jmolloy, llvm-commits Differential Revision: http://reviews.llvm.org/D12697 llvm-svn: 247265
OpenPOWER on IntegriCloud