summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [InstCombine] Use commutable matchers to reduce some code. NFCCraig Topper2017-04-251-4/+2
| | | | llvm-svn: 301294
* [LV] Remove redundant basic block splitGil Rapaport2017-04-251-3/+4
| | | | | | | | | | | This patch is part of D28975's breakdown. Genreating the control-flow to guard predicated instructions modified to only use SplitBlockAndInsertIfThen() for producing the if-then construct. Differential Revision: https://reviews.llvm.org/D32224 llvm-svn: 301293
* Update doc of the variadic version of getOrInsertFunctionSerge Guelton2017-04-251-1/+1
| | | | | | It no longer needs a null terminator. llvm-svn: 301292
* [CodeExtractor]: Fixup use refs of the old phi.Xinliang David Li2017-04-251-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D32468 llvm-svn: 301291
* Define __tls_get_addr as a hidden symbol even for ARM or MIPS.Rui Ueyama2017-04-251-5/+2
| | | | | | | | | | addIgnored defines a given symbol even if there is no existing symbol with the same name. So, even if libc provides __tls_get_addr, we should still be able to call addIgnored. Differential Revision: https://reviews.llvm.org/D32053 llvm-svn: 301290
* [ObjCARC] Do not sink an objc_retain past a clang.arc.use.Akira Hatanaka2017-04-253-9/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to do this to prevent a miscompile which sinks an objc_retain past an objc_release that releases the object objc_retain retains. This happens because the top-down and bottom-up traversals each determines the insert point for retain or release individually without knowing where the other instruction is moved. For example, when the following IR is fed to the ARC optimizer, the top-down traversal decides to insert objc_retain right before objc_release and the bottom-up traversal decides to insert objc_release right after clang.arc.use. (IR before ARC optimizer) %11 = call i8* @objc_retain(i8* %10) call void (...) @clang.arc.use(%0* %5) call void @llvm.dbg.value(...) call void @objc_release(i8* %6) This reverses the order of objc_release and objc_retain, which causes the object to be destructed prematurely. (IR after ARC optimizer) call void (...) @clang.arc.use(%0* %5) call void @objc_release(i8* %6) call void @llvm.dbg.value(...) %11 = call i8* @objc_retain(i8* %10) rdar://problem/30530580 llvm-svn: 301289
* [SimplifyLibCalls] Remove a cl::opt that's been `true` for a long time.Davide Italiano2017-04-251-5/+1
| | | | llvm-svn: 301288
* Add comments about Widnows .reloc section.Rui Ueyama2017-04-251-2/+42
| | | | llvm-svn: 301287
* Do not create temporary files in the main source tree.Rui Ueyama2017-04-251-2/+2
| | | | llvm-svn: 301286
* Placate MSVC's narrowing conversion unhappiness.Richard Smith2017-04-251-1/+1
| | | | llvm-svn: 301285
* [unittests] Derive Occupied from Unused when given.Michael Kruse2017-04-251-7/+9
| | | | | | | | | | | When both, OccupiedAndKnown and Unused are given, use the former only for the Known values. The relation Unused \union Occupied must always hold. This allows us to specify Known independently of Occupied. It is needed for an artificial test case in https://reviews.llvm.org/D32025. llvm-svn: 301284
* [unittests] Add postcondition to completeLifetime.Michael Kruse2017-04-251-0/+5
| | | | llvm-svn: 301283
* Export __progname even if a -dynamic-list is given.Rui Ueyama2017-04-252-5/+18
| | | | | | | | | | | | | | | | | BSD's __progname symbol is defined in crt1.o and linked against main executables. The libc expects that main executables export __progname symbol via .dynsym sections. In order to handle this case, we scan undefined symbols in DSOs and exported them by setting Sym->ExportDynamic to true. But it turned out that setting that variable is not enough to make sure that symbols are exported in all use cases. If a -dynamic-list option is given, all symbols not explicitly mentioned in a version script are hidden by default. That hides __progname symbol. This patch fixes the issue. Fixes https://bugs.llvm.org/show_bug.cgi?id=32703 llvm-svn: 301282
* Teach SCEV normalization to de/normalize non-affine add recsSanjoy Das2017-04-252-33/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change, SCEV Normalization would incorrectly normalize non-affine add recurrences. To work around this there was (still is) a check in place to make sure we only tried to normalize affine add recurrences. We recently found a bug in aforementioned check to bail out of normalizing non-affine add recurrences. However, instead of fixing the bailout, I have decided to teach SCEV normalization to work correctly with non-affine add recurrences, making the bailout unnecessary (I'll remove it in a subsequent change). I've also added some unit tests (which would have failed before this change). Reviewers: atrick, sunfish, efriedma Reviewed By: atrick Subscribers: mcrosier, mzolotukhin, llvm-commits Differential Revision: https://reviews.llvm.org/D32104 llvm-svn: 301281
* Name the C++ source files for two tests correctly.Sean Callanan2017-04-242-2/+2
| | | | llvm-svn: 301280
* Replace a binary .so with a text .s.Rui Ueyama2017-04-243-20/+11
| | | | | | | Since LLD is now able to take version scripts, we no longer have to keep a pre-generated binary file for a test. llvm-svn: 301279
* Remove a useless temporary variable.Rui Ueyama2017-04-241-2/+1
| | | | llvm-svn: 301278
* Fixed two bad Makefiles that might be breaking Linux.Sean Callanan2017-04-242-2/+2
| | | | llvm-svn: 301277
* InferAddressSpaces: Use reference arguments instead of pointersMatt Arsenault2017-04-241-15/+15
| | | | llvm-svn: 301276
* [Object] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-04-2412-189/+287
| | | | | | other minor fixes (NFC). llvm-svn: 301275
* Revert r301089 "[builtins] Implement emulated TLS on Windows."Hans Wennborg2017-04-242-222/+67
| | | | | | | | | | | | | | | | | | | | | This broke the self-host build on Windows (PR32777). Original commit message: > [builtins] Implement emulated TLS on Windows. > > Summary: > LLVM JIT needs to be able to use emulated TLS on all platforms, and this provides a reference one can compile to enable emutls for Linux/Mac/Windows. > > Reviewers: chh, howard.hinnant > > Reviewed By: chh > > Subscribers: mgorny, llvm-commits > > Differential Revision: https://reviews.llvm.org/D30787 llvm-svn: 301274
* [Expression parser] Return both types and variablesSean Callanan2017-04-248-258/+347
| | | | | | | | | | | | | | | | | | | | | Many times a user wants to access a type when there's a variable of the same name, or a variable when there's a type of the same name. Depending on the precise context, currently the expression parser can fail to resolve one or the other. This is because ClangExpressionDeclMap has logic to limit the amount of information it searches, and that logic sometimes cuts down the search prematurely. This patch removes some of those early exits. In that sense, this patch trades performance (early exit is faster) for correctness. I've also included two new test cases showing examples of this behavior – as well as modifying an existing test case that gets it wrong. llvm-svn: 301273
* [asan] Fix Windows global dead stripping testsReid Kleckner2017-04-242-4/+4
| | | | | | | Pass /Gw to clang-cl which is equivalent to -fdata-sections. This is now necessary. llvm-svn: 301272
* [modules ts] Diagnose 'export' declarations outside of a module interface.Richard Smith2017-04-249-13/+66
| | | | llvm-svn: 301271
* InferAddressSpaces: Remove redundant assertMatt Arsenault2017-04-241-1/+0
| | | | | | | This is just asserting all the operations are handled in the switch, which the unreachable already handles. llvm-svn: 301270
* [ARM, x86] add more vector tests for bool math; NFCSanjay Patel2017-04-242-0/+64
| | | | | | | | I'm proposing a fold for increment-of-sexted-bool in: https://reviews.llvm.org/D31944 ...so we need to know what happens in more cases like these. llvm-svn: 301269
* [git-llvm] Remove CR from middle of svn propget outputReid Kleckner2017-04-241-0/+2
| | | | llvm-svn: 301268
* Make getSlotAttributes return an AttributeSet instead of a wrapper listReid Kleckner2017-04-245-34/+20
| | | | | | | | Remove the temporary, poorly named getSlotSet method which did the same thing. Also remove getSlotNode, which is a hold-over from when we were dealing with AttributeSetNode* instead of AttributeSet. llvm-svn: 301267
* [Polly] [DependenceInfo] change WAR generation, Read will not block ReadSiddharth Bhat2017-04-244-30/+104
| | | | | | | | | | | | | | | | | | | | | Earlier, the call to buildFlow was: WAR = buildFlow(Write, Read, MustWrite, Schedule). This meant that Read could block another Read, since must-sources can block each other. Fixed the call to buildFlow to correctly compute Read. The resulting code needs to do some ISL juggling to get the output we want. Bug report: https://bugs.llvm.org/show_bug.cgi?id=32623 Reviewers: Meinersbur Tags: #polly Differential Revision: https://reviews.llvm.org/D32011 llvm-svn: 301266
* Mark a test as requiring a shell.Rafael Espindola2017-04-241-0/+1
| | | | llvm-svn: 301265
* Handle _LINK_ env string as command line parameters.Rui Ueyama2017-04-243-13/+16
| | | | | | | | | "_LINK_" environment varaible should be appended to the command line. https://msdn.microsoft.com/en-us/library/6y6t9esh.aspx Fixes https://bugs.llvm.org/show_bug.cgi?id=32756 llvm-svn: 301264
* [DWARF] Fix lookup in the abstract origins of inlined blocks/functionsSean Callanan2017-04-244-2/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LLDB uses clang::DeclContexts for lookups, and variables get put into the DeclContext for their abstract origin. (The abstract origin is a DWARF pointer that indicates the unique definition of inlined code.) When the expression parser is looking for variables, it locates the DeclContext for the current context. This needs to be done carefully, though, e.g.: __attribute__ ((always_inline)) void f(int a) { { int b = a * 2; } } void g() { f(3); } Here, if we're stopped in the inlined copy of f, we have to find the DeclContext corresponding to the definition of f – its abstract origin. Clang doesn't allow multiple functions with the same name and arguments to exist. It also means that any variables we see must be placed in the appropriate DeclContext. [Bug 1]: When stopped in an inline block, the function GetDeclContextDIEContainingDIE for that block doesn't properly construct a DeclContext for the abstract origin for inlined subroutines. That means we get duplicated function DeclContexts, but function arguments only get put in the abstract origin's DeclContext, and as a result when we try to look for them in nested contexts they aren't found. [Bug 2]: When stopped in an inline block, the DWARF (for space reasons) doesn't explicitly point to the abstract origin for that block. This means that the function GetClangDeclContextForDIE returns a different DeclContext for each place the block is inlined. However, any variables defined in the block have abstract origins, so they will only get placed in the DeclContext for their abstract origin. In this fix, I've introduced a test covering both of these issues, and fixed them. Bug 1 could be resolved simply by making sure we look up the abstract origin for inlined functions when looking up their DeclContexts on behalf of nested blocks. For Bug 2, I've implemented an algorithm that makes the DeclContext for a block be the containing DeclContext for the closest entity we would find during lookup that has an abstract origin pointer. That means that in the following situation: { // block 1 int a; { // block 2 int b; } } if we looked up the DeclContext for block 2, we'd find the block containing the abstract origin of b, and lookup would proceed correctly because we'd see b and a. However, in the situation { // block 1 int a; { // block 2 } } since there isn't anything to look up in block 2, we can't determine its abstract origin (and there is no such pointer in the DWARF for blocks). However, we can walk up the parent chain and find a, and its abstract origin lives in the abstract origin of block 1. So we simply say that the DeclContext for block 2 is the same as the DeclContext for block 1, which contains a. Lookups will return the same results. Thanks to Jim Ingham for review and suggestions. Differential revision: https://reviews.llvm.org/D32375 llvm-svn: 301263
* [git-llvm] Make `push` work on CRLF files with svn:eol-style=nativeReid Kleckner2017-04-241-7/+60
| | | | | | | | | | | | | | | | | | | | | | Summary: `git apply` on Windows doesn't work for files that SVN checks out as CRLF. There is no way to force SVN to check everything out with Unix line endings on Windows. Files with svn:eol-style=native will always come out with CRLF, breaking `git apply`, which wants Unix line endings. My workaround is to list all files with this property set in the change, and run `dos2unix` on them. SVN doesn't commit a massive line ending change because the svn:eol-style property indicates that these are text files. Tested on r301245. Reviewers: zturner, jlebar Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32452 llvm-svn: 301262
* [Modules] Fix test to wipe out the cache before using itBruno Cardoso Lopes2017-04-241-1/+1
| | | | | | | | | This should appease bots: http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental_check/35914 rdar://problem/31796737 llvm-svn: 301261
* [InstSimplify] use ConstantRange to simplify more and-of-icmpsSanjay Patel2017-04-245-302/+95
| | | | | | | | | | | | | We can simplify (and (icmp X, C1), (icmp X, C2)) to one of the icmps in many cases. I had to check some of these with Alive to prove to myself it's right, but everything seems to check out. Eg, the code in instcombine was completely ignoring predicates with mismatched signedness. Handling or-of-icmps would be a follow-up step. Differential Revision: https://reviews.llvm.org/D32143 llvm-svn: 301260
* Remove DefaultSoName.Rafael Espindola2017-04-245-31/+35
| | | | | | | | We can just use the existing SoName member variable. It now initially contains what was in DefaultSoName and is modified if the .so has an actual soname. llvm-svn: 301259
* [DAGCombiner] Use APInt::intersects to avoid tmp variable. NFCI.Simon Pilgrim2017-04-241-1/+3
| | | | llvm-svn: 301258
* [cfi] Fix wrong CMake condition for WIN32.Evgeniy Stepanov2017-04-241-1/+1
| | | | llvm-svn: 301257
* [asan] Remove asanwrapper from Android test harness.Evgeniy Stepanov2017-04-241-3/+2
| | | | | | It is only necessary for pre-L and creates problems on newer builds. llvm-svn: 301256
* AMDGPU: Slightly simplify prolog reserved register handlingMatt Arsenault2017-04-241-25/+27
| | | | | | | | | | | | | | Rely on MachineRegisterInfo's knowledge of used physical registers. Move flat_scratch initialization earlier, so the uses are visible when making these decisions. This will make it easier to add another reserved register at the end for the stack pointer rather than handling another special case. llvm-svn: 301254
* Cosmetic change.Galina Kistanova2017-04-241-0/+1
| | | | llvm-svn: 301253
* ProfileData: clean up some stale declarations (NFC)Saleem Abdulrasool2017-04-241-8/+0
| | | | | | These were removed in SVN r300381. Remove the declarations. llvm-svn: 301252
* [analyzer] Improve subscripting null arrays for catching null dereferences.Artem Dergachev2017-04-243-18/+23
| | | | | | | | | | | | | Array-to-pointer cast now works correctly when the pointer to the array is concrete, eg. null, which allows further symbolic calculations involving such values. Inlined defensive checks are now detected correctly when the resulting null symbol is being array-subscripted before dereference. Differential Revision: https://reviews.llvm.org/D32291 llvm-svn: 301251
* Remove a dead field. NFC.Vedant Kumar2017-04-242-8/+2
| | | | | | Suggested by Adam Folwarczny! llvm-svn: 301250
* [Coverage] Avoid null deref in skipRegionMappingForDecl (fixes PR32761)Vedant Kumar2017-04-242-0/+14
| | | | | | | | Patch by Adam Folwarczny! Differential Revision: https://reviews.llvm.org/D32406 llvm-svn: 301249
* Small addition on how to add a builder.Galina Kistanova2017-04-241-0/+1
| | | | llvm-svn: 301248
* [AMDGPU][mc][tests][NFC] Bulk ISA tests: update for Gfx7/Gfx8, add for Gfx9.Artem Tamazov2017-04-244-58050/+128900
| | | | llvm-svn: 301247
* Specify a target explicitly in libfuzzer driver flag testGeorge Karpenkov2017-04-241-1/+1
| | | | llvm-svn: 301246
* [Bitcode] Refactor attribute group writing to avoid getSlotAttributesReid Kleckner2017-04-245-56/+67
| | | | | | | | | | | | | | | | | Summary: That API creates a temporary AttributeList to carry an index and a single AttributeSet. We need to carry the index in addition to the set, because that is how attribute groups are currently encoded. NFC Reviewers: pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32262 llvm-svn: 301245
* Update profile during memory instrinsic optimizationTeresa Johnson2017-04-242-6/+19
| | | | | | | | | | | | | | | | Summary: Ensure that the new merge BB (which contains the rest of the original BB after the mem op being optimized) gets a profile frequency, in case there are additional mem ops later in the BB. Otherwise they get skipped as the merge BB looks cold. Reviewers: davidxl, xur Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32447 llvm-svn: 301244
OpenPOWER on IntegriCloud