summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [profile] Sync up InstrProfData.inc (NFC)Vedant Kumar2017-04-151-6/+6
| | | | llvm-svn: 300383
* [Coverage] Use the new getInstrProfSectionName API (NFC)Vedant Kumar2017-04-151-1/+3
| | | | llvm-svn: 300382
* [ProfileData] Unify getInstrProf*SectionName helpersVedant Kumar2017-04-1510-169/+72
| | | | | | | | | | | | | | | | | | | | | | This is a version of D32090 that unifies all of the `getInstrProf*SectionName` helper functions. (Note: the build failures which D32090 would have addressed were fixed with r300352.) We should unify these helper functions because they are hard to use in their current form. E.g we recently introduced more helpers to fix section naming for COFF files. This scheme doesn't totally succeed at hiding low-level details about section naming, so we should switch to an API that is easier to maintain. This is not an NFC commit because it fixes llvm-cov's testing support for COFF files (this falls out of the API change naturally). This is an area where we lack tests -- I will see about adding one as a follow up. Testing: check-clang, check-profile, check-llvm. Differential Revision: https://reviews.llvm.org/D32097 llvm-svn: 300381
* Modules: Do not serialize #pragma pack stateDuncan P. N. Exon Smith2017-04-156-59/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The modules side of r299226, which serializes #pragma pack state, doesn't work well. The main purpose was to make -include and -include-pch match semantics (the PCH side). We also started serializing #pragma pack in PCMs, in the hopes of making modules and non-modules builds more consistent. But consider: $ cat a.h $ cat b.h #pragma pack(push, 2) $ cat module.modulemap module M { module a { header "a.h" } module b { header "b.h" } } $ cat t.cpp #include "a.h" #pragma pack(show) As of r299226, the #pragma pack(show) gives "2", even though we've only included "a.h". - With -fmodules-local-submodule-visibility, this is clearly wrong. We should get the default state (8 on x86_64). - Without -fmodules-local-submodule-visibility, this kind of matches how other things work (as if include-the-whole-module), but it's still really terrible, and it doesn't actually make modules and non-modules builds more consistent. This commit disables the serialization for modules, essentially a partial revert of r299226. Going forward: 1. Having this #pragma pack stuff escape is terrible design (or, more often, a horrible bug). We should prioritize adding warnings (maybe -Werror by default?). 2. If we eventually reintroduce this for modules, it should only apply to -fmodules-local-submodule-visibility, and it should be tracked on a per-submodule basis. llvm-svn: 300380
* Generalize SCEV's unit testing helper a bitSanjoy Das2017-04-141-10/+11
| | | | llvm-svn: 300379
* [Interpreter] Make a static func a lambda and remove always_inline.Davide Italiano2017-04-141-8/+5
| | | | | | | | The attribute was fairly dubious as: a) we shouldn't tell the compiler when to inline functions, b) GCC complains that the function may be not always inlinable. llvm-svn: 300377
* [InstCombine] MakeAnd/Or/Xor handling to reuse previous APInt computationsCraig Topper2017-04-141-36/+46
| | | | | | | | | | | | When checking if we should return a constant, we create some temporary APInts to see if we know all bits. But the exact computations we do are needed in several other locations in the same code. This patch moves them to named temporaries so we can reuse them. Ideally we'd write directly to KnownZero/One, but we currently seem to only write those variables after all the simplifications checks and I didn't want to change that with this patch. Differential Revision: https://reviews.llvm.org/D32094 llvm-svn: 300376
* [ARM/Emulation] Remove an unneeded comparison and simplify. NFCI.Davide Italiano2017-04-141-2/+2
| | | | | | | reg0 is always zero and comparison to an unsigned always yields true. llvm-svn: 300375
* Fix bot breakage from r300372Chris Bieneman2017-04-141-1/+1
| | | | | | Use #cmakedefine instead of #cmakedefine01 because the uses are ifndef instead of if. llvm-svn: 300374
* [Process/Utility] Remove dead code. NFCI.Davide Italiano2017-04-141-5/+0
| | | | llvm-svn: 300373
* [CMake] Support generating Config.hChris Bieneman2017-04-1412-263/+56
| | | | | | | | | | | | | | | | | | | Summary: This patch removes the hand maintained config files in favor of auto-generating the config file. We will still need to maintain the defines for the Xcode builds on Mac, but all CMake builds use the generated header instead. This will enable finer grained platform support tests and enable supporting LLDB on more platforms with less manual maintenance. I have only tested this patch on Darwin, and any help testing it out on other platforms would be greatly appreciated. I've probably messed something up somewhere. Reviewers: labath, zturner Reviewed By: labath Subscribers: krytarowski, emaste, srhines, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D31969 llvm-svn: 300372
* [ubsan] Don't check alignment if the alignment is 1Vedant Kumar2017-04-143-4/+20
| | | | | | | | | | | | | | If a pointer is 1-byte aligned, there's no use in checking its alignment. Somewhat surprisingly, ubsan can spend a significant amount of time doing just that! This loosely depends on D30283. Testing: check-clang, check-ubsan, and a stage2 ubsan build. Differential Revision: https://reviews.llvm.org/D30285 llvm-svn: 300371
* [ubsan] Reduce alignment checking of C++ object pointersVedant Kumar2017-04-148-206/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch teaches ubsan to insert an alignment check for the 'this' pointer at the start of each method/lambda. This allows clang to emit significantly fewer alignment checks overall, because if 'this' is aligned, so are its fields. This is essentially the same thing r295515 does, but for the alignment check instead of the null check. One difference is that we keep the alignment checks on member expressions where the base is a DeclRefExpr. There's an opportunity to diagnose unaligned accesses in this situation (as pointed out by Eli, see PR32630). Testing: check-clang, check-ubsan, and a stage2 ubsan build. Along with the patch from D30285, this roughly halves the amount of alignment checks we emit when compiling X86FastISel.cpp. Here are the numbers from patched/unpatched clangs based on r298160. ------------------------------------------ | Setup | # of alignment checks | ------------------------------------------ | unpatched, -O0 | 24326 | | patched, -O0 | 12717 | (-47.7%) ------------------------------------------ Differential Revision: https://reviews.llvm.org/D30283 llvm-svn: 300370
* [RDF] No longer ignore implicit defs or uses on any instructionsKrzysztof Parzyszek2017-04-141-23/+0
| | | | | | | This used to be a Hexagon-specific treatment, but is no longer needed since it's switched to subregister liveness tracking. llvm-svn: 300369
* [RDF] Correctly enumerate reg units for reg masksKrzysztof Parzyszek2017-04-141-3/+5
| | | | llvm-svn: 300368
* [IR] Make paramHasAttr to use arg indices instead of attr indicesReid Kleckner2017-04-1421-82/+114
| | | | | | | | | This avoids the confusing 'CS.paramHasAttr(ArgNo + 1, Foo)' pattern. Previously we were testing return value attributes with index 0, so I introduced hasReturnAttr() for that use case. llvm-svn: 300367
* [libFuzzer] more trophiesKostya Serebryany2017-04-141-0/+2
| | | | llvm-svn: 300366
* [WebAssembly] Improve readobj and nm support for wasmSam Clegg2017-04-1411-88/+289
| | | | | | | | | Now that the libObect support for wasm is better we can have readobj and nm produce more useful output too. Differential Revision: https://reviews.llvm.org/D31514 llvm-svn: 300365
* [InstCombine] (X != C1 && X != C2) --> (X | (C1 ^ C2)) != C2Sanjay Patel2017-04-142-46/+73
| | | | | | | | | | ...when C1 differs from C2 by one bit and C1 <u C2: http://rise4fun.com/Alive/Vuo And move related folds to a helper function. This reduces code duplication and will make it easier to remove the scalar-only restriction as a follow-up step. llvm-svn: 300364
* [InstCombine] Support folding a subtract with a constant LHS into a phi nodeCraig Topper2017-04-149-37/+50
| | | | | | | | | | | | We currently only support folding a subtract into a select but not a PHI. This fixes that. I had to fix an assumption in FoldOpIntoPhi that assumed the PHI node was always in operand 0. Now we pass it in like we do for FoldOpIntoSelect. But we still require some dancing to find the Constant when we create the BinOp or ConstantExpr. This is based code is similar to what we do for selects. Since I touched all call sites, this also renames FoldOpIntoPhi to foldOpIntoPhi to match coding standards. Differential Revision: https://reviews.llvm.org/D31686 llvm-svn: 300363
* [AMDGPU] set read_only access qualifier for pointersStanislav Mekhanoshin2017-04-142-3/+41
| | | | | | | | | | If a kernel's pointer argument is known to be readonly set access qualifier accordingly. This allows RT not to flush caches before dispatches. Differential Revision: https://reviews.llvm.org/D32091 llvm-svn: 300362
* [Test commit] Cleanup some whitespace in a test fileSam Clegg2017-04-141-2/+0
| | | | llvm-svn: 300361
* [InstCombine] Regenerate test checks using script. NFCCraig Topper2017-04-141-3/+4
| | | | llvm-svn: 300360
* [ELF] Remove unused member [NFC]Rui Ueyama2017-04-141-1/+0
| | | | | | | | Patch by Alexander Richardson. Differential Revision: https://reviews.llvm.org/D32077 llvm-svn: 300359
* [ubsan] Use the correct tool name in diagnosticsVedant Kumar2017-04-147-17/+30
| | | | | | | | | | | | | | | When using ASan and UBSan together, the common sanitizer tool name is set to "AddressSanitizer". That means that when a UBSan diagnostic is printed out, it looks like this: SUMMARY: AddressSanitizer: ... This can confuse users. Fix it so that we always use the correct tool name when printing out UBSan diagnostics. Differential Revision: https://reviews.llvm.org/D32066 llvm-svn: 300358
* [InstCombine] add/move tests for and/or-of-icmps equality folds; NFCSanjay Patel2017-04-144-111/+139
| | | | llvm-svn: 300357
* [clang-move] Create ClangMoveActionFactory on stackAlexander Shaposhnikov2017-04-141-4/+3
| | | | | | | | | | | This diff removes unnecessary using of unique_ptr with ClangMoveActionFactory (pico cleanup). NFC Test plan: make check-clang-tools Differential revision: https://reviews.llvm.org/D32063 llvm-svn: 300356
* [ValueTracking] Avoid undefined behavior in unittest by not making a named ↵Craig Topper2017-04-141-1/+1
| | | | | | | | | | | | ArrayRef from a std::initializer_list One of the ValueTracking unittests creates a named ArrayRef initialized by a std::initializer_list. The underlying array for an std::initializer_list is only guaranteed to have a lifetime as long as the initializer_list object itself. So this can leave the ArrayRef pointing at an array that no long exists. This fixes this to just create an explicit array instead of an ArrayRef. Differential Revision: https://reviews.llvm.org/D32089 llvm-svn: 300354
* [InstCombine] Refactor SimplifyUsingDistributiveLaws to more explicitly skip ↵Craig Topper2017-04-141-30/+33
| | | | | | | | | | | | | | code when LHS/RHS aren't BinaryOperators Currently this code always makes 2 or 3 calls to tryFactorization regardless of whether the LHS/RHS are BinaryOperators. We make 3 calls when both operands are BinaryOperators with the same opcode. Or surprisingly, when neither are BinaryOperators. This is because getBinOpsForFactorization returns Instruction::BinaryOpsEnd when the operand is not a BinaryOperator. If both LHS and RHS are not BinaryOperators then they both have an Opcode of Instruction::BinaryOpsEnd. When this happens we rely on tryFactorization to early out due to A/B/C/D being null. Similar behavior occurs for the other calls, we rely on getBinOpsForFactorization having made A/B or C/D null to get tryFactorization to early out. We also rely on these null checks to check the result of getIdentityValue and early out for it. This patches refactors this to pull these checks up to SimplifyUsingDistributiveLaws so we don't rely on BinaryOpsEnd as a sentinel or this A/B/C/D null behavior. I think this makes this code easier to reason about. Should also give a tiny performance improvement for cases where the LHS or RHS isn't a BinaryOperator. Differential Revision: https://reviews.llvm.org/D31913 llvm-svn: 300353
* [Profile] Make host tool aware of object format when quering prof section names Xinliang David Li2017-04-144-16/+42
| | | | | | Differential Revision: https://reviews.llvm.org/D32073 llvm-svn: 300352
* Update tests for the patch.Alexey Bataev2017-04-144-559/+576
| | | | llvm-svn: 300351
* Use range-for in a few placesSanjoy Das2017-04-141-15/+15
| | | | llvm-svn: 300350
* Rewrite SCEV Normalization using SCEVRewriteVisitor; NFCSanjoy Das2017-04-141-121/+57
| | | | | | | Removes all of the boilerplate, cache management etc. from ScalarEvolutionNormalization, and keeps only the interesting bits. llvm-svn: 300349
* Make SCEVRewriteVisitor smarter about when it trys to create SCEVsSanjoy Das2017-04-141-17/+41
| | | | | | | | | | | | This change really saves just one foldingset lookup, but makes SCEVRewriteVisitor "feature compatible" with the handwritten logic in ScalarEvolutionNormalization, so that I can change ScalarEvolutionNormalization to use SCEVRewriteVisitor in a next step. This is a non-functional change, but _may_ improve performance in some pathological cases, but that's unlikely. llvm-svn: 300348
* Removing a redundant, but harmless, %s; NFC.Aaron Ballman2017-04-141-1/+1
| | | | llvm-svn: 300347
* Add missing #includeSanjoy Das2017-04-141-0/+1
| | | | | | Again, caught by the modules build. llvm-svn: 300346
* [RDF] Switch RegisterAggr to a bit vector of register unitsKrzysztof Parzyszek2017-04-145-185/+168
| | | | | | | This avoids many complications related to the complex register aliasing schemes. llvm-svn: 300345
* [FunctionImport] assert(false) -> llvm_unreachable(). NFCI.Davide Italiano2017-04-141-1/+1
| | | | llvm-svn: 300344
* Increase the packet timeout for the jModulesInfo since it can take longer ↵Greg Clayton2017-04-141-0/+3
| | | | | | than the default 1 second timeout on some linux versions when many shared libraries are involved. llvm-svn: 300342
* Fixed to disassemble new packets and fixed the dumping of the 'x' packets.Greg Clayton2017-04-141-12/+41
| | | | llvm-svn: 300341
* [ObjC] Fix lifetime markers of loop variable in EmitObjCForCollectionStmt ↵Kuba Mracek2017-04-144-14/+13
| | | | | | | | | | [take 2] CodeGenFunction::EmitObjCForCollectionStmt currently emits lifetime markers for the loop variable in an inconsistent way: lifetime.start is emitted before the loop is entered, but lifetime.end is emitted inside the loop. AddressSanitizer uses these markers to track out-of-scope accesses to local variables, and we get false positives in Obj-C foreach loops (in the 2nd iteration of the loop). This patch keeps the loop variable alive for the whole loop by extending ForScope and registering the cleanup function inside EmitAutoVarAlloca. Differential Revision: https://reviews.llvm.org/D32029 llvm-svn: 300340
* Remove "#if 0"ed out assertSanjoy Das2017-04-141-5/+0
| | | | | | | | | | | It won't compile after the recent changes I've made, and I think keeping it in provides very little value. Instead I've added (in an earlier commit) a C++ unit test to check the Denormalize(Normalized(X)) == X property for specific instances of X, which is what the assert was trying to do anyway. llvm-svn: 300339
* Delete some unnecessary boilerplateSanjoy Das2017-04-141-47/+29
| | | | | | | | | | | | The PostIncTransform class was not pulling its weight, so delete it and use free functions instead. This also makes the use of `function_ref` more idiomatic. We were storing an instance of function_ref in the PostIncTransform class before, which was fine in that specific case, but the usage after this change is more obviously okay. llvm-svn: 300338
* [RDF] Refine propagation of reached uses in liveness computationKrzysztof Parzyszek2017-04-143-5/+63
| | | | llvm-svn: 300337
* Add missing #include for STLExtrasSanjoy Das2017-04-141-0/+1
| | | | | | | | | Looks like earlier I was relying on #include ordering in files that used ScalarEvolutionNormalization.h. Found thanks to the selfhost modules buildbot! llvm-svn: 300336
* [Hexagon] Fix a latent problem with interpreting live-in lane masksKrzysztof Parzyszek2017-04-141-5/+7
| | | | | | | A non-zero lane mask on a register with no subregister means that the whole register is live-in. It is equivalent to a full mask. llvm-svn: 300335
* Use range forSanjoy Das2017-04-141-3/+1
| | | | llvm-svn: 300334
* Simplify PostIncTransform further; NFCSanjoy Das2017-04-141-16/+19
| | | | | | | Instead of having two ways to check if an add recurrence needs to be normalized, just pass in one predicate to decide that. llvm-svn: 300333
* Add a unit test for SCEV NormalizationSanjoy Das2017-04-141-0/+63
| | | | llvm-svn: 300332
* Tighten the API for ScalarEvolutionNormalizationSanjoy Das2017-04-145-37/+58
| | | | llvm-svn: 300331
OpenPOWER on IntegriCloud