summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [X86] Use VPERMB/VPERMI2B for v32i8 shuffle lowering if VBMI and VLX are ↵Craig Topper2017-12-212-143/+252
| | | | | | supported. llvm-svn: 321248
* [X86] Add avx512vbmi command lines to vector-shuffle-256-v32.llCraig Topper2017-12-211-211/+372
| | | | llvm-svn: 321247
* [WebAssembly] Remove unneeded sub-directorySam Clegg2017-12-215-4/+4
| | | | | | | | | This is the only wasm def (and likely likely will be for the foreseeable) file so no need for a sub-directory Differential Revision: https://reviews.llvm.org/D41476 llvm-svn: 321246
* [WebAssmebly] Fix references to weak aliasesSam Clegg2017-12-213-12/+13
| | | | | | | | Corresponding LLVM change: https://reviews.llvm.org/D41472 Differential Revision: https://reviews.llvm.org/D41473 llvm-svn: 321244
* Revert "Expose a TargetMachine::getTargetTransformInfo function"Sanjoy Das2017-12-2129-84/+89
| | | | | | This reverts commit r321234. It breaks the -DBUILD_SHARED_LIBS=ON build. llvm-svn: 321243
* [WebAssembly] Fix local references to weak aliasesSam Clegg2017-12-214-35/+74
| | | | | | | | | | | | | | | | When weak aliases are used with in same translation unit we need to be able to directly reference to alias and not just the thing it is aliases. We do this by defining both a wasm import and a wasm export in this case that result in a single Symbol. This change is a partial revert of rL314245. A corresponding lld change address the previous issues we had with this. See: https://github.com/WebAssembly/tool-conventions/issues/34 Differential Revision: https://reviews.llvm.org/D41472 llvm-svn: 321242
* [WebAssembly] Improve weak alias tests casesSam Clegg2017-12-213-28/+114
| | | | | | | | | | | Based on: https://github.com/WebAssembly/tool-conventions/issues/34 Currently weak-alias-overide.ll exhibits incorrect behaviour in that call_direct() calls the wrong function. Differential Revision: https://reviews.llvm.org/D41460 llvm-svn: 321241
* Pass an InputFile to the InputSection constructor.Rafael Espindola2017-12-215-15/+14
| | | | | | | This simplifies toRegularSection and reduces the noise in a followup patch. llvm-svn: 321240
* Fix for PR32990Erich Keane2017-12-216-27/+138
| | | | | | | | | This fixes the bug in https://bugs.llvm.org/show_bug.cgi?id=32990. Patch By: zahiraam Differential Revision: https://reviews.llvm.org/D39063 llvm-svn: 321239
* Convert a few more InputFiles to references.Rafael Espindola2017-12-213-48/+48
| | | | | | | We use null files in sections to represent linker created sections, so ObjFile<ELFT> is never null. llvm-svn: 321238
* Reverting a file that snuck in with r321229 by accident.Aaron Ballman2017-12-211-1/+1
| | | | llvm-svn: 321237
* [SimplifyCFG] Avoid quadratic on a predecessors number behavior in ↵Michael Zolotukhin2017-12-213-25/+19
| | | | | | | | | | | | | | | | | | | | | | instruction sinking. If a block has N predecessors, then the current algorithm will try to sink common code to this block N times (whenever we visit a predecessor). Every attempt to sink the common code includes going through all predecessors, so the complexity of the algorithm becomes O(N^2). With this patch we try to sink common code only when we visit the block itself. With this, the complexity goes down to O(N). As a side effect, the moment the code is sunk is slightly different than before (the order of simplifications has been changed), that's why I had to adjust two tests (note that neither of the tests is supposed to test SimplifyCFG): * test/CodeGen/AArch64/arm64-jumptable.ll - changes in this test mimic the changes that previous implementation of SimplifyCFG would do. * test/CodeGen/ARM/avoid-cpsr-rmw.ll - in this test I disabled common code sinking by a command line flag. llvm-svn: 321236
* Detemplate createCommentSection.Rafael Espindola2017-12-215-25/+21
| | | | | | | It was only templated so it could create a dummy section header that was immediately parsed back. llvm-svn: 321235
* Expose a TargetMachine::getTargetTransformInfo functionSanjoy Das2017-12-2129-89/+84
| | | | | | | | | | | | | | | | | | | | | | | Summary: This makes the TargetMachine interface a bit simpler. We still need the std::function in TargetIRAnalysis to avoid having to add a dependency from Analysis to Target. See discussion: http://lists.llvm.org/pipermail/llvm-dev/2017-December/119749.html I avoided adding all of the backend owners to this review since the change is simple, but let me know if you feel differently about this. Reviewers: echristo, MatzeB, hfinkel Reviewed By: hfinkel Subscribers: jholewinski, jfb, arsenm, dschuff, mcrosier, sdardis, nemanjai, nhaehnle, javed.absar, sbc100, jgravelle-google, aheejin, kbarton, llvm-commits Differential Revision: https://reviews.llvm.org/D41464 llvm-svn: 321234
* Attempt to pacify 4.8.5 with makeArrayRefReid Kleckner2017-12-211-1/+1
| | | | llvm-svn: 321233
* [ubsan] Diagnose noreturn functions which return (compiler-rt)Vedant Kumar2017-12-213-4/+24
| | | | | | | | This is paired with the clang change: https://reviews.llvm.org/D40698 Differential Revision: https://reviews.llvm.org/D40700 llvm-svn: 321232
* [ubsan] Diagnose noreturn functions which returnVedant Kumar2017-12-218-19/+135
| | | | | | | | | | | | | | | | | | Diagnose 'unreachable' UB when a noreturn function returns. 1. Insert a check at the end of functions marked noreturn. 2. A decl may be marked noreturn in the caller TU, but not marked in the TU where it's defined. To diagnose this scenario, strip away the noreturn attribute on the callee and insert check after calls to it. Testing: check-clang, check-ubsan, check-ubsan-minimal, D40700 rdar://33660464 Differential Revision: https://reviews.llvm.org/D40698 llvm-svn: 321231
* [Driver] Ensure no overlap between trapping & recoverable sanitizers. NFC.Vedant Kumar2017-12-212-0/+4
| | | | | | | This is NFC because in EmitCheck(), -fsanitize-trap=X overrides -fsanitize-recover=X. llvm-svn: 321230
* Reverting r321223 and its follow-up commit because of failing bots due to ↵Aaron Ballman2017-12-2018-1996/+1980
| | | | | | Misc/ast-dump-color.cpp. llvm-svn: 321229
* Silence a -Wreorder warning from r321223.Aaron Ballman2017-12-201-2/+2
| | | | llvm-svn: 321228
* [clangd-fuzzer] Update ClangdLSPServer constructor call.Matt Morehouse2017-12-201-1/+2
| | | | | | Build was broken by r321092. llvm-svn: 321226
* [orc][cmake] Check if 8 byte atomics require libatomic for unittestSimon Dardis2017-12-201-1/+6
| | | | | | | | | | | | | rL319838 introduced SymbolStringPool which uses 8 byte atomics for reference counters. On systems which do not support such atomics natively such as MIPS32, explicitly add libatomic as one of the libraries for SymbolStringPool's unittest. Reviewers: lhames, beanz Differential Revision: https://reviews.llvm.org/D41010 llvm-svn: 321225
* [ARM] Optimize {s,u}{add,sub}.with.overflow.Joel Galenson2017-12-203-2/+207
| | | | | | | | The AArch64 backend contains code to optimize {s,u}{add,sub}.with.overflow during SelectionDAG. This commit ports that code to the ARM backend. Differential revision: https://reviews.llvm.org/D35635 llvm-svn: 321224
* Add a printing policy to the ASTDumper.Aaron Ballman2017-12-2017-1979/+1995
| | | | | | This allows you to dump C++ code that spells bool instead of _Bool, leaves off the elaborated type specifiers when printing struct or class names, and other C-isms. llvm-svn: 321223
* Fix an assertion failure regression in isDesignatorAtObjectEnd forAlex Lorenz2017-12-202-1/+23
| | | | | | | | | | | | | | __builtin_object_size with incomplete array type in struct The commit r316245 introduced a regression that causes an assertion failure when Clang tries to cast an IncompleteArrayType to a PointerType when evaluating __builtin_object_size. rdar://36094951 Differential Revision: https://reviews.llvm.org/D41405 llvm-svn: 321222
* [Hexagon] Use ArrayRef member functions instead of custom onesKrzysztof Parzyszek2017-12-201-19/+10
| | | | llvm-svn: 321221
* [Hexagon] Allow construction of HVX vector predicatesKrzysztof Parzyszek2017-12-2011-170/+408
| | | | | | Handle BUILD_VECTOR of boolean values. llvm-svn: 321220
* Use dyn_cast instead of dyn_cast_or_null.Rafael Espindola2017-12-202-2/+2
| | | | | | There should be no null sections in InputSections. llvm-svn: 321219
* [Hexagon] Legalize vector elements to i32 in buildVector32/64Krzysztof Parzyszek2017-12-201-15/+22
| | | | llvm-svn: 321218
* Do not generate an empty switch statement as it causes MSVC to issue ↵Aaron Ballman2017-12-201-4/+7
| | | | | | diagnostics about switch statements without case or default labels. llvm-svn: 321217
* clang-format. NFC.Rafael Espindola2017-12-201-5/+5
| | | | llvm-svn: 321216
* bpf: add support for objdump -print-imm-hexYonghong Song2017-12-202-5/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for 'objdump -print-imm-hex' for imm64, operand imm and branch target. If user programs encode immediate values as hex numbers, such an option will make it easy to correlate asm insns with source code. This option also makes it easy to correlate imm values with insn encoding. There is one changed behavior in this patch. In old way, we print the 64bit imm as u64: O << (uint64_t)Op.getImm(); and the new way is: O << formatImm(Op.getImm()); The formatImm is defined in llvm/MC/MCInstPrinter.h as format_object<int64_t> formatImm(int64_t Value) So the new way to print 64bit imm is i64 type. If a 64bit value has the highest bit set, the old way will print the value as a positive value and the new way will print as a negative value. The new way is consistent with x86_64. For the code (see the test program): ... if (a == 0xABCDABCDabcdabcdULL) ... x86_64 objdump, with and without -print-imm-hex, looks like: 48 b8 cd ab cd ab cd ab cd ab movabsq $-6067004223159161907, %rax 48 b8 cd ab cd ab cd ab cd ab movabsq $-0x5432543254325433, %rax Signed-off-by: Yonghong Song <yhs@fb.com> llvm-svn: 321215
* PR35705: Fix Chapter 9 example code for API changes to DIBuilderDavid Blaikie2017-12-203-4/+7
| | | | llvm-svn: 321214
* [X86] Refactor DomainReassignment pass to make the Closure class not stores ↵Craig Topper2017-12-201-78/+89
| | | | | | | | | | | | references to the main data structures of the pass itself Multiple Closure objects can be created and stored for a single function. It's not a good idea to devote so many fields of it to storing pointers and references to global data structures of the pass. The closure class should only store the things needed to represent the closure itself. This patch refactors many of the methods of Closure to belong to the pass object and to pass around a reference to the current Closure. The Closure class gains a few simple methods to add instructions and edges, and to return iterators to edges and instructions Differential Revision: https://reviews.llvm.org/D41327 llvm-svn: 321213
* TableGen: Allow setting SDNodeProperties on intrinsicsMatt Arsenault2017-12-2014-82/+166
| | | | | | | | | | | | | | | | | Allows preserving MachineMemOperands on intrinsics through selection. For reasons I don't understand, this is a static property of the pattern and the selector deliberately goes out of its way to drop if not present. Intrinsics already inherit from SDPatternOperator allowing them to be used directly in instruction patterns. SDPatternOperator has a list of SDNodeProperty, but you currently can't set them on the intrinsic. Without SDNPMemOperand, when the node is selected any memory operands are always dropped. Allowing setting this on the intrinsics avoids needing to introduce another equivalent target node just to have SDNPMemOperand set. llvm-svn: 321212
* [libfuzzer] Fix UB when calculating Log(0) in StackDepthStepFunction().Max Moroz2017-12-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: __builtin_clz used for Log calculation returns an undefined result when argument is 0. I noticed that issue when was testing some fuzzers: ``` /src/libfuzzer/FuzzerTracePC.h:282:33: runtime error: shift exponent 450349 is too large for 32-bit type 'uint32_t' (aka 'unsigned int') #0 0x43d83f in operator() /src/libfuzzer/FuzzerTracePC.h:283:33 #1 0x43d83f in void fuzzer::TracePC::CollectFeatures<fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*)::$_1>(fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*)::$_1) const /src/libfuzzer/FuzzerTracePC.h:290 #2 0x43cbd4 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/libfuzzer/FuzzerLoop.cpp:445:7 #3 0x43e5f1 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) /src/libfuzzer/FuzzerLoop.cpp:706:5 #4 0x43e9e1 in fuzzer::Fuzzer::Loop(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) /src/libfuzzer/FuzzerLoop.cpp:739:3 #5 0x432f8c in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:754:6 #6 0x42ee18 in main /src/libfuzzer/FuzzerMain.cpp:20:10 #7 0x7f17ffeb182f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) #8 0x407838 in _start (/out/rotate_fuzzer+0x407838) Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D41457 llvm-svn: 321211
* [ICP] Expose unconditional call promotion interfaceMatthew Simpson2017-12-208-101/+210
| | | | | | | | | | | | | | | | | | | | | | | This patch modifies the indirect call promotion utilities by exposing and using an unconditional call promotion interface. The unconditional promotion interface (i.e., call promotion without creating an if-then-else) can be used if it's known that an indirect call has only one possible callee. The existing conditional promotion interface uses this unconditional interface to promote an indirect call after it has been versioned and placed within the "then" block. A consequence of unconditional promotion is that the fix-up operations for phi nodes in the normal destination of invoke instructions are changed. This is necessary because the existing implementation assumed that an invoke had been versioned, creating a "merge" block where a return value bitcast could be placed. In the new implementation, the edge between a promoted invoke's parent block and its normal destination is split if needed to add a bitcast for the return value. If the invoke is also versioned, the phi node merging the return value of the promoted and original invoke instructions is placed in the "merge" block. Differential Revision: https://reviews.llvm.org/D40751 llvm-svn: 321210
* [X86] Remove zext from vXi32 to vXi64 on indices of gather/scatter ↵Craig Topper2017-12-202-0/+62
| | | | | | | | instructions if we can prove the pre-extended value is positive. Gather/scatter can implicitly sign extend from i32->i64 on indices. So if we know the sign bit of the input to a zext is 0 we can use the implicit extension. llvm-svn: 321209
* DAG: Tolerate non-MemSDNodes for OPC_RecordMemRefMatt Arsenault2017-12-201-8/+24
| | | | | | | | | | | | | | | | | | | | When intrinsics are allowed to have mem operands, there are two ways this can happen. First is an intrinsic that is marked has having a mem operand, but is not handled by getTgtMemIntrinsic. The second way can occur even for intrinsics which do not have a mem operand. It seems the selector table does some kind of sorting based on the opcode, and the mem ref recording can happen in the same scope for intrinsics that both do and do not have mem refs. I haven't been able to figure out exactly why this happens (although it happens even with the matcher optimizations disabled). I'm not sure if it's worth trying to avoid hitting this for these nodes since I think it's still reasonable to handle this in case getTgtMemIntrinic is not implemented. llvm-svn: 321208
* Improve the test for r320216. NFC.Warren Ristow2017-12-202-11/+59
| | | | | | Patch by Matthew Voss! llvm-svn: 321207
* [opt-viewer] Also demangle indirect-call promotion targetsAdam Nemet2017-12-201-1/+1
| | | | llvm-svn: 321206
* [PowerPC] Added an assert to make sure that the MBBI iterator is valid.Stefan Pintilie2017-12-201-3/+3
| | | | | | | | | | The function createTailCallBranchInstr assumes that the iterator MBBI is valid. However, only one use of MBBI is guarded in the function. Fix this by adding an assert. Differential Revision: https://reviews.llvm.org/D41358 llvm-svn: 321205
* [DAG] Fix condition on overlapping store check.Nirav Dave2017-12-201-2/+2
| | | | | | | Prevent overlapping store elision when overlapping store is pre-inc/dec as analysis is wrong in these cases. llvm-svn: 321204
* [hwasan] Implement -fsanitize-recover=hwaddress.Evgeniy Stepanov2017-12-209-82/+252
| | | | | | | | | | | | Summary: Very similar to AddressSanitizer, with the exception of the error type encoding. Reviewers: kcc, alekseyshl Subscribers: cfe-commits, kubamracek, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D41417 llvm-svn: 321203
* [AMDGPU, AsmParser] Enable the mnemonic spell corrector.Matt Arsenault2017-12-203-7/+70
| | | | | | Patch by Dmitry Venikov llvm-svn: 321202
* Add support for ObjectFormat to TargetSpecificAttrErich Keane2017-12-204-55/+65
| | | | | | | | | | | | | | | | Looking through the code, I saw a FIXME on IFunc to switch it to a target specific attribute. In looking through it, i saw that the no-longer-appropriately-named TargetArch didn't support ObjectFormat checking. This patch changes the name of TargetArch to TargetSpecific (since it checks much more than just Arch), makes "Arch" optional, adds support for ObjectFormat, better documents the TargetSpecific type, and changes IFunc over to a TargetSpecificAttr. Differential Revision: https://reviews.llvm.org/D41303 llvm-svn: 321201
* [X86] Implement the fusing of MUL+SUBADD to FMSUBADDCraig Topper2017-12-202-98/+67
| | | | | | | | | | This patch turns shuffles of fadd/fsub with fmul into fmsubadd. Patch by Dmitry Venikov Differential Revision: https://reviews.llvm.org/D40335 llvm-svn: 321200
* Pass a InputFile reference to the Lazy constructor. NFC.Rafael Espindola2017-12-201-4/+4
| | | | llvm-svn: 321199
* Use a reference to a file in the LazyArchive symbol.Rafael Espindola2017-12-203-8/+8
| | | | | | It is never null. llvm-svn: 321198
* [PGO] Function section hotness prefix should look at all blocksTeresa Johnson2017-12-204-44/+84
| | | | | | | | | | | | | | | | | | | | Summary: The function section prefix for PGO based layout (e.g. hot/unlikely) should look at the hotness of all blocks not just the entry BB. A function with a cold entry but a very hot loop should be placed in the hot section, for example, so that it is located close to other hot functions it may call. For SamplePGO it was already looking at the branch weights on calls, and I made that code conditional on whether this is SamplePGO since it was essentially a noop for instrumentation PGO anyway. Reviewers: davidxl Subscribers: eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D41395 llvm-svn: 321197
OpenPOWER on IntegriCloud