summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* Bugfix: SCEVExpander incorrectly marks increment operations as no-wrapSanjoy Das2015-02-239-10/+69
| | | | | | | | | | | | | | | | | | | | | When emitting the increment operation, SCEVExpander marks the operation as nuw or nsw based on the flags on the preincrement SCEV. This is incorrect because, for instance, it is possible that {-6,+,1} is <nuw> while {-6,+,1}+1 = {-5,+,1} is not. This change teaches SCEV to mark the increment as nuw/nsw only if it can explicitly prove that the increment operation won't overflow. Apart from the attached test case, another (more realistic) manifestation of the bug can be seen in Transforms/IndVarSimplify/pr20680.ll. NOTE: this change was landed with an incorrect commit message in rL230275 and was reverted for that reason in rL230279. This commit message is the correct one. Differential Revision: http://reviews.llvm.org/D7778 llvm-svn: 230280
* Revert 230275.Sanjoy Das2015-02-239-69/+10
| | | | | | | | 230275 got committed with an incorrect commit message due to a mixup on my side. Will re-land in a few moments with the correct commit message. llvm-svn: 230279
* Fix based on post-commit comment on D7816 & rL230177 - BUILD_VECTOR operand ↵Simon Pilgrim2015-02-231-4/+5
| | | | | | truncation was using the the BV's output scalar type instead of the input type. llvm-svn: 230278
* [X86] Teach how to custom lower double-to-half conversions under fast-math.Andrea Di Biagio2015-02-232-0/+67
| | | | | | | | | | | | | This patch teaches the backend how to expand a double-half conversion into a double-float conversion immediately followed by a float-half conversion. We do this only under fast-math, and if float-half conversions are legal for the target. Added test CodeGen/X86/fastmath-float-half-conversion.ll Differential Revision: http://reviews.llvm.org/D7832 llvm-svn: 230276
* Fix bug 22641Sanjoy Das2015-02-239-10/+69
| | | | | | | | | | | The bug was a result of getPreStartForExtend interpreting nsw/nuw flags on an add recurrence more strongly than is legal. {S,+,X}<nsw> implies S+X is nsw only if the backedge of the loop is taken at least once. Differential Revision: http://reviews.llvm.org/D7808 llvm-svn: 230275
* Fix invalid cast.Rafael Espindola2015-02-232-1/+17
| | | | | | | | Fixes PR22525. Patch by Ben Longbons with testcase by me. llvm-svn: 230271
* X86: Use a smaller 'mov' instruction for stack probe callsDavid Majnemer2015-02-233-7/+17
| | | | | | | | | | | | | Prologue emission, in some cases, requires calls to a stack probe helper function. The amount of stack to probe is passed as a register argument in the Win64 ABI but the instruction sequence used is pessimistic: it assumes that the number of bytes to probe is greater than 4 GB. Instead, select a more appropriate opcode depending on the number of bytes we are going to probe. llvm-svn: 230270
* X86: Use 'mov' instead of 'lea' in Win64 SEH prologues when possibleDavid Majnemer2015-02-233-6/+9
| | | | | | | 'mov' and 'lea' are equivalent when the displacement applied with 'lea' is zero. However, 'mov' should encode smaller. llvm-svn: 230269
* X86: Explain why we cannot use a 'mov' in a Win64 epilogueDavid Majnemer2015-02-231-0/+6
| | | | llvm-svn: 230268
* X86: Consistently use 'epilogue' instead of 'epilog'David Majnemer2015-02-231-1/+1
| | | | llvm-svn: 230267
* add newline for easier reading; NFCSanjay Patel2015-02-231-1/+1
| | | | llvm-svn: 230265
* [AsmPrinter] Access pointers to globals via pcrel GOT entriesBruno Cardoso Lopes2015-02-236-16/+346
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Front-ends could use global unnamed_addr to hold pointers to other symbols, like @gotequivalent below: @foo = global i32 42 @gotequivalent = private unnamed_addr constant i32* @foo @delta = global i32 trunc (i64 sub (i64 ptrtoint (i32** @gotequivalent to i64), i64 ptrtoint (i32* @delta to i64)) to i32) The global @delta holds a data "PC"-relative offset to @gotequivalent, an unnamed pointer to @foo. The darwin/x86-64 assembly output for this follows: .globl _foo _foo: .long 42 .globl _gotequivalent _gotequivalent: .quad _foo .globl _delta _delta: .long _gotequivalent-_delta Since unnamed_addr indicates that the address is not significant, only the content, we can optimize the case above by replacing pc-relative accesses to "GOT equivalent" globals, by a PC relative access to the GOT entry of the final symbol instead. Therefore, "delta" can contain a pc relative relocation to foo's GOT entry and we avoid the emission of "gotequivalent", yielding the assembly code below: .globl _foo _foo: .long 42 .globl _delta _delta: .long _foo@GOTPCREL+4 There are a couple of advantages of doing this: (1) Front-ends that need to emit a great deal of data to store pointers to external symbols could save space by not emitting such "got equivalent" globals and (2) IR constructs combined with this opt opens a way to represent GOT pcrel relocations by using the LLVM IR, which is something we previously had no way to express. Differential Revision: http://reviews.llvm.org/D6922 rdar://problem/18534217 llvm-svn: 230264
* InstrProf: Teach llvm-cov to show the max count instead of the lastJustin Bogner2015-02-232-6/+5
| | | | | | | | | | | | When multiple regions start on the same line, llvm-cov was just showing the count of the last one as the line count. This can be confusing and misleading for things like one-liner loops, where the count at the end isn't very interesting, or even "if" statements with an opening brace at the end of the line. Instead, use the maximum of all of the region start counts. llvm-svn: 230263
* Removing unused private field.Andrew Kaylor2015-02-231-3/+1
| | | | llvm-svn: 230259
* [X86][MMX] Fix test to reflect current codegenBruno Cardoso Lopes2015-02-231-2/+1
| | | | | | | This test failed in several buildbots, a bit unclear how that happen since this was the previous behavior before r230248. llvm-svn: 230258
* Second attempt to fix WinEHCatchDirector build failures.Andrew Kaylor2015-02-232-2/+1
| | | | llvm-svn: 230257
* Attempting to fix WinEHCatchDirector destructor related build failures.Andrew Kaylor2015-02-231-0/+1
| | | | llvm-svn: 230252
* Adding test for Windows EH frame variable remapping.Andrew Kaylor2015-02-231-0/+261
| | | | llvm-svn: 230250
* Remap frame variables for native Windows exception handling.Andrew Kaylor2015-02-235-577/+858
| | | | | | Differential Revision: http://reviews.llvm.org/D7770 llvm-svn: 230249
* Revert "[X86][MMX] Add MMX instructions to foldable tables"Bruno Cardoso Lopes2015-02-233-85/+6
| | | | | | This reverts commit r230226 since it breaks win buildbots. llvm-svn: 230248
* Revert "Revert "Raising minimum required CMake version to 2.8.12.2.""Chad Rosier2015-02-235-18/+8
| | | | | | This reverts commit r230240, which was an accidental commit. llvm-svn: 230246
* Rewrite the global merge pass to be subprogram agnostic for now.Eric Christopher2015-02-239-49/+29
| | | | | | | | | | | | | It was previously using the subtarget to get values for the global offset without actually checking each function as it was generating code. Go ahead and solidify the current behavior and make the existing FIXMEs more prominent. As a note the ARM backend previously had a thumb1 and non-thumb1 set of defaults. Only the former was tested so I've changed the behavior to only use that for now. llvm-svn: 230245
* Prevent hoisting fmul from THEN/ELSE to IF if there is fmsub/fmadd opportunity.Chad Rosier2015-02-2310-2/+134
| | | | | | | | | | | This patch adds the isProfitableToHoist API. For AArch64, we want to prevent a fmul from being hoisted in cases where it is more profitable to form a fmsub/fmadd. Phabricator Review: http://reviews.llvm.org/D7299 Patch by Lawrence Hu <lawrence@codeaurora.org> llvm-svn: 230241
* Revert "Raising minimum required CMake version to 2.8.12.2."Chad Rosier2015-02-235-8/+18
| | | | | | This reverts commit 247aed4710e8befde76da42b27313661dea7cf66. llvm-svn: 230240
* cmake: Don't do the libstdc++ version check when clang simulates MSVCReid Kleckner2015-02-231-5/+9
| | | | | | | | | | | | | If we're using clang-cl, that's a pretty good indication that we're going to use MSVC's STL. This simplifies the clang-cl ninja self-host configuration down to: CC=clang-cl CXX=clang-cl cmake .. -GNinja Modified version of zturner's patch: Differential Revision: http://reviews.llvm.org/D7824 llvm-svn: 230239
* InstSimplify: simplify 0 / X if nnan and nszMehdi Amini2015-02-234-18/+45
| | | | | From: Fiona Glaser <fglaser@apple.com> llvm-svn: 230238
* [mips] Honour -mno-odd-spreg for vector insert/extract when MSA is enabled.Daniel Sanders2015-02-233-5/+151
| | | | | | | | | | | | | | | | | | | Summary: -mno-odd-spreg prohibits the use of odd-numbered single-precision floating point registers. However, vector insert/extract was still using them when manipulating the subregisters of an MSA register. Fixed this by ensuring that insertion/extraction is only performed on even-numbered vector registers when -mno-odd-spreg is given. Reviewers: vmedic, sstankovic Reviewed By: sstankovic Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7672 llvm-svn: 230235
* Fix incorrect immediate size for AddrModeT2_i8s4 in rewriteT2FrameIndex.Bob Wilson2015-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The natural way to handle this addressing mode would be to say that it has 8 bits and gets scaled by 4, but since the MC layer is expecting the scaling to be already reflected in the immediate value, we have been setting the Scale to 1. That's fine, but then NumBits needs to be adjusted to reflect the effective increase in the range of the immediate. That adjustment was missing. The consequence is that the register scavenger can fail. The estimateRSStackSizeLimit() function in ARMFrameLowering.cpp correctly assumes that the AddrModeT2_i8s4 address mode can handle scaled offsets up to 1020. Under just the right circumstances, we fail to reserve space for the scavenger because it thinks that nothing will be needed. However, the overly pessimistic behavior in rewriteT2FrameIndex causes some frame indexes to be out of range and require scavenged registers, and so the scavenger asserts. Unfortunately I have not been able to come up with a testcase for this. I can only reproduce it on an internal branch where the frame layout and register allocation is slightly different than trunk. We really need a way to serialize MachineInstr-level IR to write reasonable tests for things like this. rdar://problem/19909005 llvm-svn: 230233
* Sync the __builtin_expects for our 3 quadratically probed hash table ↵Benjamin Kramer2015-02-233-15/+18
| | | | | | | | | | | | | | | | | | implementations. This assumes that a) finding the bucket containing the value is LIKELY b) finding an empty bucket is LIKELY c) growing the table is UNLIKELY I also switched the a) and b) cases for SmallPtrSet as we seem to use the set mostly more for insertion than for checking existence. In a simple benchmark consisting of 2^21 insertions of 2^20 unique pointers into a DenseMap or SmallPtrSet a few percent speedup on average, but nothing statistically significant. llvm-svn: 230232
* [X86] Add specific mtriple in order to appease builbotsBruno Cardoso Lopes2015-02-231-1/+1
| | | | llvm-svn: 230229
* [X86][MMX] Add MMX instructions to foldable tablesBruno Cardoso Lopes2015-02-233-6/+85
| | | | | | | | Teach the peephole optimizer to work with MMX instructions by adding entries into the foldable tables. This covers folding opportunities not handled during isel. llvm-svn: 230226
* [X86][MMX] Support folding loads in psll, psrl and psra intrinsicsBruno Cardoso Lopes2015-02-233-16/+29
| | | | llvm-svn: 230225
* [X86][MMX] Add tests for pslli, psrli and psrai intrinsicsBruno Cardoso Lopes2015-02-231-0/+145
| | | | | | | | Add tests to cover the RR form of the pslli, psrli and psrai intrinsics. In the next commit, the loads are going to be folded and the instructions use the RM form. llvm-svn: 230224
* AVX-512: recommitted 229837 + bugfix + testElena Demikhovsky2015-02-238-53/+137
| | | | llvm-svn: 230223
* restructured X86 scalar unary operation templatesElena Demikhovsky2015-02-231-164/+118
| | | | | | | I made the templates general, no need to define pattern separately for each instruction/intrinsic. Now only need to add r_Int pattern for AVX. llvm-svn: 230221
* [llvm-pdbdump] Remove unused variables.Benjamin Kramer2015-02-232-6/+1
| | | | llvm-svn: 230216
* Orc/JITSymbol.h requires not "Compiler.h" but "DataTypes.h" due to uint64_t.NAKAMURA Takumi2015-02-231-1/+1
| | | | llvm-svn: 230214
* AsmParser: Check ConstantExpr insertvalue operands for type correctnessDavid Majnemer2015-02-232-1/+15
| | | | llvm-svn: 230206
* [llvm-pdbdump] Fix builders again.Zachary Turner2015-02-232-12/+13
| | | | llvm-svn: 230205
* [llvm-pdbdump] Very minor code cleanup.Zachary Turner2015-02-2314-77/+21
| | | | | | | This just removes some dead enums as well as some debug flushes of stdout. llvm-svn: 230204
* [llvm-pdbdump] Add an option to dump full class definitions.Zachary Turner2015-02-2328-59/+688
| | | | | | | | | | | This adds the --class-definitions flag. If specified, when dumping types, instead of "class Foo" you will see the full class definition, with member functions, constructors, access specifiers. NOTE: Using this option can be very slow, as generating a full class definition requires accessing many different parts of the PDB. llvm-svn: 230203
* [Orc][Kaleidoscope] Tidy up the lazy_irgen tutorial, touch up a couple ofLang Hames2015-02-232-31/+46
| | | | | | comments in the fully_lazy tutorial to minimize the diff between the two. llvm-svn: 230202
* [Orc][Kaleidoscope] Remove dead AST map in SessionContext.Lang Hames2015-02-231-2/+1
| | | | llvm-svn: 230201
* Try to fix reST markup for an external link.Nico Weber2015-02-231-1/+1
| | | | llvm-svn: 230200
* Fix Makefile buildDavid Blaikie2015-02-231-1/+1
| | | | llvm-svn: 230197
* [orc] Add a trivial unit test to get the ball rollingDavid Blaikie2015-02-236-1/+61
| | | | | | | | | I made my best guess at the Makefile, since I don't have a make build. I'm not sure if it should be valid to add an empty list of things, but it seemed the sort of degenerate case. llvm-svn: 230196
* AsmParser: Call instructions can't have an alignmentDavid Majnemer2015-02-232-2/+19
| | | | llvm-svn: 230193
* AsmParser: Check ConstantExpr GEP operands for validityDavid Majnemer2015-02-222-2/+29
| | | | llvm-svn: 230188
* llvm-pdbdump: Fix gcc/clang buildDavid Majnemer2015-02-221-1/+1
| | | | llvm-svn: 230187
* [llvm-pdbdump] Fix a few compilation failures.Zachary Turner2015-02-222-3/+2
| | | | llvm-svn: 230186
OpenPOWER on IntegriCloud