summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* Reduce alignment of SmallVector<T> to the required amount, rather than ↵Richard Smith2012-08-223-104/+67
| | | | | | forcing 16-byte alignment. This fixes misaligned SmallVector accesses via ExtractValueInst's SmallVector data member. llvm-svn: 162331
* Add a few functions to TargetLibraryInfo as part of PR13574.Chad Rosier2012-08-212-0/+72
| | | | | | Patch by Weiming Zhao <weimingz@codeaurora.org>. llvm-svn: 162329
* MaximumSpanningTree::EdgeWeightCompare: Make this comparator actually be aRichard Smith2012-08-211-25/+28
| | | | | | strict weak ordering, and don't pass possibly-null pointers to dyn_cast. llvm-svn: 162314
* Fix misaligned access in MachO object file reader: despite containing anRichard Smith2012-08-211-0/+5
| | | | | | | | | | int64_t, Symbol64TableEntry is actually only stored with 4-byte alignment within the file. The usage of #pragma pack here is copied from the corresponding code in Support/Endian.h, so shouldn't introduce any new portability problems. llvm-svn: 162312
* Fix unaligned memory accesses when performing relocations in X86 JIT. There'sRichard Smith2012-08-211-4/+13
| | | | | | | no cost to using memcpy here: the fixed code is optimized by LLVM to perfect machine code. llvm-svn: 162311
* Don't pass a null pointer to cast<> in its unit tests.Richard Smith2012-08-211-3/+5
| | | | llvm-svn: 162310
* Don't bind a reference to a dereferenced null pointer (for return value of ↵Richard Smith2012-08-211-1/+2
| | | | | | WeakVH::operator*). llvm-svn: 162309
* [ms-inline asm] Do not report a Parser error when matching inline assembly.Chad Rosier2012-08-212-15/+27
| | | | llvm-svn: 162306
* Ignore the documentation-suggested location for compile_commands.jsonDavid Blaikie2012-08-211-0/+1
| | | | | | | | | | According to http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html it's suggested that compile_commands.json in the root of the LLVM source tree should be a symlink to the json file produced by your build system of choice. So here's a patch so it doesn't turn up in git status, etc. llvm-svn: 162305
* The presence of the empty file "foo" unfortunately does not improve LLVM in ↵David Blaikie2012-08-211-0/+0
| | | | | | | | any way. Thanks to Duncan Sands for catching this random file in code review. llvm-svn: 162304
* Remove unnecessary cast that was also unnecessarily casting away constness.David Blaikie2012-08-212-1/+1
| | | | | | | | | | Even looking at the revision history I couldn't quite piece together why this cast was ever written in the first place, but I assume it was because of some change in the inheritance, perhaps this function was reimplemented in a derived type & this caller was meant to get the base version (& it wasn't virtual)? llvm-svn: 162301
* Provide a portability macro for __builtin_trap.David Blaikie2012-08-211-0/+9
| | | | llvm-svn: 162300
* Fix macros arguments with an underscore, dot or dollar in them. This is basedRafael Espindola2012-08-212-1/+30
| | | | | | on a patch by Andy/PaX. I added the support for dot and dollar. llvm-svn: 162298
* [ms-inline asm] Expose the ErrorInfo from the MatchInstructionImpl. In general,Chad Rosier2012-08-212-5/+9
| | | | | | | | | this is the index of the operand that failed to match. Note: This may cause a buildbot failure due to an API mismatch in clang. Should recover with my next commit to clang. llvm-svn: 162295
* Formatting. No functional change.Chad Rosier2012-08-211-2/+2
| | | | llvm-svn: 162292
* Make the wording in of the "expected identifier" error in the .macro directiveRafael Espindola2012-08-212-2/+11
| | | | | | | consistent with the other "expected identifier" errors. Extracted from the Andy/PaX patch. I added the test. llvm-svn: 162291
* Pacify PVS-Studio by changing the type rather than doing a cast, a tweakDuncan Sands2012-08-211-1/+1
| | | | | | suggested by David Blaikie. llvm-svn: 162286
* Add support for the --param ssp-buffer-size= driver option.Chad Rosier2012-08-214-9/+19
| | | | | | PR9673 llvm-svn: 162284
* Use typedefs. Fix indentation. Extracted from the Andy/PaX patch.Rafael Espindola2012-08-211-5/+4
| | | | llvm-svn: 162283
* Remove unused variable. Extracted from the Andy/PaX patch.Rafael Espindola2012-08-211-2/+0
| | | | llvm-svn: 162282
* Fix typo. Extracted from the Andy/PaX patch.Rafael Espindola2012-08-211-1/+1
| | | | llvm-svn: 162281
* MCJIT: Tidy up the constructor.Jim Grosbach2012-08-213-13/+8
| | | | | | | | | The MCJIT doesn't need or want a TargetJITInfo. That's vestigal from the old JIT, so just remove it. rdar://12119347 llvm-svn: 162280
* PVS-Studio noticed that EmitVBR64 would perform undefined behaviour if theDuncan Sands2012-08-211-1/+3
| | | | | | | | | number of bits was bigger than 32. I checked every use of this function that I could find and it looks like the maximum number of bits is 32, so I've added an assertion checking this property, and a type cast to (hopefully) stop PVS-Studio from warning about this in the future. llvm-svn: 162277
* Add correct set of regression tests for r162094 commit.Tim Northover2012-08-211-33/+33
| | | | llvm-svn: 162276
* Port the global copy optimization from the SROA pass to InstCombine.Chandler Carruth2012-08-213-199/+181
| | | | | | | | | | This optimization is really just replacing allocas wholesale with globals, there is no scalarization. The underlying motivation for this patch is to simplify the SROA pass and focus it on splitting and promoting allocas. llvm-svn: 162271
* Fix up indentation and remove a couple else's after returns.Craig Topper2012-08-211-11/+12
| | | | llvm-svn: 162270
* [asan] add code to detect global initialization fiasco in C/C++. The ↵Kostya Serebryany2012-08-212-63/+207
| | | | | | sub-pass is off by default for now. Patch by Reid Watson. Note: this patch changes the interface between LLVM and compiler-rt parts of asan. The corresponding patch to compiler-rt will follow. llvm-svn: 162268
* Use uint16_t for tables of opcodes.Craig Topper2012-08-211-2/+2
| | | | llvm-svn: 162267
* Fix up indentation. No functional change.Craig Topper2012-08-211-61/+61
| | | | llvm-svn: 162264
* Add a couple llvm_unreachables. Add a message to several others.Craig Topper2012-08-211-8/+6
| | | | llvm-svn: 162263
* Replace a break with llvm_unreachable in the default case of a nested ↵Craig Topper2012-08-211-50/+18
| | | | | | switch. Condense code a bit. No functional change. llvm-svn: 162261
* Cleanup the scalar FMA3 definitions. Add patterns to fold loads with scalar ↵Craig Topper2012-08-211-44/+49
| | | | | | forms. llvm-svn: 162260
* Merge FMA3 instructions with and without patterns into single classes using ↵Craig Topper2012-08-211-38/+21
| | | | | | null_frag. llvm-svn: 162257
* revise debug output to avoid dangling pointerMichael Liao2012-08-211-1/+1
| | | | llvm-svn: 162256
* Add a missing def flag.Jakob Stoklund Olesen2012-08-212-5/+3
| | | | | | | | | | *** Bad machine code: Explicit definition marked as use *** - function: test_cos - basic block: BB#0 L.entry (0x7ff2a2024fd0) - instruction: VSETLNi32 %D11, %D11<undef>, %R0, 0, pred:14, pred:%noreg, %Q5<imp-use,kill>, %Q5<imp-def> - operand 0: %D11 llvm-svn: 162247
* Fix a quadratic algorithm in MachineBranchProbabilityInfo.Jakob Stoklund Olesen2012-08-204-13/+23
| | | | | | | | | | | | The getSumForBlock function was quadratic in the number of successors because getSuccWeight would perform a linear search for an already known iterator. This patch was originally committed as r161460, but reverted again because of assertion failures. Now that duplicate Machine CFG edges have been eliminated, this works properly. llvm-svn: 162233
* Don't add CFG edges for redundant conditional branches.Jakob Stoklund Olesen2012-08-203-4/+23
| | | | | | | | | | | | | IR that hasn't been through SimplifyCFG can look like this: br i1 %b, label %r, label %r Make sure we don't create duplicate Machine CFG edges in this case. Fix the machine code verifier to accept conditional branches with a single CFG edge. llvm-svn: 162230
* Clarify that duplicate edges are not allowed in the Machine CFG.Jakob Stoklund Olesen2012-08-201-0/+2
| | | | | | | | | | | | LLVM IR has labeled duplicate CFG edges, but since Machine CFG edges don't have labels, it doesn't make sense to allow duplicates. There is no way of telling what the edges mean. Duplicate CFG edges cause confusion when dealing with edge weights. It seems that code producing duplicate CFG edges usually does the wrong thing with edge weights. llvm-svn: 162227
* Add a verification pass after ExpandISelPseudos.Jakob Stoklund Olesen2012-08-201-1/+2
| | | | | | | This pass often has weird CFG hacks and hand-written MI building code that can go wrong in many ways. llvm-svn: 162224
* Add CFG checks to MachineVerifier.Jakob Stoklund Olesen2012-08-201-0/+40
| | | | | | | Verify that the predecessor and successor lists are consistent and free of duplicates. llvm-svn: 162223
* Use a SmallPtrSet to dedup successors in EmitSjLjDispatchBlock.Jakob Stoklund Olesen2012-08-201-3/+2
| | | | | | | The test case ARM/2011-05-04-MultipleLandingPadSuccs.ll was creating duplicate successor list entries. llvm-svn: 162222
* enable cross compilation with cmakeSebastian Pop2012-08-202-2/+8
| | | | | | | | | | | | | | | This patch allows us to use cmake to specify a cross compiler: target different than host. In particular, it moves LLVM_DEFAULT_TARGET_TRIPLE and TARGET_TRIPLE variables from cmake/config-ix.cmake to the toplevel CMakeLists.txt to make them available at configure time. Here is the command line that I have used to test my patches to create a Hexagon cross compiler hosted on x86: $ cmake -G Ninja -D LLVM_TARGETS_TO_BUILD:STRING=Hexagon -D TARGET_TRIPLE:STRING=hexagon-unknown-linux-gnu -D LLVM_DEFAULT_TARGET_TRIPLE:STRING=hexagon-unknown-linux-gnu -D LLVM_TARGET_ARCH:STRING=hexagon-unknown-linux-gnu .. $ ninja check llvm-svn: 162219
* enable Hexagon target from cmakeSebastian Pop2012-08-201-0/+2
| | | | | | The patch adds a missing case for the Hexagon target in cmake/config-ix.cmake. llvm-svn: 162218
* fix HexagonSubtarget parsing of -mv flagSebastian Pop2012-08-201-17/+16
| | | | llvm-svn: 162217
* fix a case where all operands of BUILD_VECTOR are undefinedMichael Liao2012-08-202-0/+12
| | | | llvm-svn: 162214
* Fix coding style violations in 162135 and 162136.Akira Hatanaka2012-08-204-49/+49
| | | | | | Patch by Petar Jovanovic. llvm-svn: 162213
* DataExtractor: Fix integer truncation issues in LEB128 extraction.Benjamin Kramer2012-08-202-3/+12
| | | | llvm-svn: 162201
* Forget to add testcase for r162195. Sorry.Stepan Dyatkovskiy2012-08-201-0/+10
| | | | llvm-svn: 162196
* Fixed DAGCombiner bug (found and localized by James Malloy):Stepan Dyatkovskiy2012-08-201-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DAGCombiner tries to optimise a BUILD_VECTOR by checking if it consists purely of get_vector_elts from one or two source vectors. If so, it either makes a concat_vectors node or a shufflevector node. However, it doesn't check the element type width of the underlying vector, so if you have this sequence: Node0: v4i16 = ... Node1: i32 = extract_vector_elt Node0 Node2: i32 = extract_vector_elt Node0 Node3: v16i8 = BUILD_VECTOR Node1, Node2, ... It will attempt to: Node0: v4i16 = ... NewNode1: v16i8 = concat_vectors Node0, ... Where this is actually invalid because the element width is completely different. This causes an assertion failure on DAG legalization stage. Fix: If output item type of BUILD_VECTOR differs from input item type. Make concat_vectors based on input element type and then bitcast it to the output vector type. So the case described above will transformed to: Node0: v4i16 = ... NewNode1: v8i16 = concat_vectors Node0, ... NewNode2: v16i8 = bitcast NewNode1 llvm-svn: 162195
* Remove FMA3 intrinsic instructions in favor of patterns.Craig Topper2012-08-202-94/+146
| | | | llvm-svn: 162194
OpenPOWER on IntegriCloud