oota-llvm.git
11 years agoSubtargetEmitter fix
Arnold Schwaighofer [Tue, 4 Jun 2013 22:15:41 +0000 (22:15 +0000)]
SubtargetEmitter fix

Don't output data if we are supposed to ignore the record.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183255 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix link.
Richard Smith [Tue, 4 Jun 2013 20:42:42 +0000 (20:42 +0000)]
Fix link.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183248 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSparc: No functionality change. Cleanup whitespaces, comment formatting etc.,
Venkatraman Govindaraju [Tue, 4 Jun 2013 18:33:25 +0000 (18:33 +0000)]
Sparc: No functionality change. Cleanup whitespaces, comment formatting etc.,

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183243 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIndVarSimplify: check if loop invariant expansion can trap
David Majnemer [Tue, 4 Jun 2013 17:51:58 +0000 (17:51 +0000)]
IndVarSimplify: check if loop invariant expansion can trap

IndVarSimplify is willing to move divide instructions outside of their
loop bodies if they are invariant of the loop.  However, it may not be
safe to expand them if we do not know if they can trap.

Instead, check to see if it is not safe to expand the instruction and
skip the expansion.

This fixes PR16041.

Testcase by Rafael Ávila de Espíndola.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183239 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: Fix crash in ARM backend inside of ARMConstantIslandPass
David Majnemer [Tue, 4 Jun 2013 17:46:15 +0000 (17:46 +0000)]
ARM: Fix crash in ARM backend inside of ARMConstantIslandPass

The ARM backend did not expect LDRBi12 to hold a constant pool operand.
Allow for LLVM to deal with the instruction similar to how it deals with
LDRi12.

This fixes PR16215.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183238 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove "-Wl,-seg1addr -Wl,0xE0000000" from link options.
Bob Wilson [Tue, 4 Jun 2013 15:26:37 +0000 (15:26 +0000)]
Remove "-Wl,-seg1addr -Wl,0xE0000000" from link options.

Specifying the load address for Darwin i386 dylibs was a performance
optimization for dyld that is not relevant for x86_64 or arm. We can just
remove this now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183230 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Swizzle texture/export instructions
Vincent Lejeune [Tue, 4 Jun 2013 15:04:53 +0000 (15:04 +0000)]
R600: Swizzle texture/export instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183229 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Add a test for r183108
Vincent Lejeune [Tue, 4 Jun 2013 15:03:35 +0000 (15:03 +0000)]
R600: Add a test for r183108

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183228 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSecond part of pr16069
Rafael Espindola [Tue, 4 Jun 2013 14:11:59 +0000 (14:11 +0000)]
Second part of pr16069

The problem this time seems to be a thinko. We were assuming that in the CFG

A
| \
|  B
| /
C

speculating the basic block B would cause only the phi value for the B->C edge
to be speculated. That is not true, the phi's are semantically in the edges, so
if the A->B->C path is taken, any code needed for A->C is not executed and we
have to consider it too when deciding to speculate B.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183226 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTypo: s/caes/cases/ in SimplifyCFG
Hans Wennborg [Tue, 4 Jun 2013 11:22:30 +0000 (11:22 +0000)]
Typo: s/caes/cases/ in SimplifyCFG

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183219 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPreserve const correctness.
Benjamin Kramer [Tue, 4 Jun 2013 09:09:15 +0000 (09:09 +0000)]
Preserve const correctness.

GCC complains about casting away const.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183216 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTest commit for user vmedic, to verify commit access. One line of comment is added...
Vladimir Medic [Tue, 4 Jun 2013 08:28:53 +0000 (08:28 +0000)]
Test commit for user vmedic, to verify commit access. One line of comment is added to MipsAsmParser.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183215 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[llvm-symbolizer] Avoid calling slow getSymbolSize for Mach-O files. Assume that...
Alexey Samsonov [Tue, 4 Jun 2013 07:57:38 +0000 (07:57 +0000)]
[llvm-symbolizer] Avoid calling slow getSymbolSize for Mach-O files. Assume that symbols with zero size are in fact large enough.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183213 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWe are now in 3.4 land. We don't need the 3.3 releaese notes in ToT anymore.
Bill Wendling [Tue, 4 Jun 2013 06:12:31 +0000 (06:12 +0000)]
We are now in 3.4 land. We don't need the 3.3 releaese notes in ToT anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183210 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIEEE-754R 5.7.2 General Operations is* operations (except for isCanonical).
Michael Gottesman [Tue, 4 Jun 2013 03:46:25 +0000 (03:46 +0000)]
IEEE-754R 5.7.2 General Operations is* operations (except for isCanonical).

Specifically the following work was done:

1. If the operation was not implemented, I implemented it.

2. If the operation was already implemented, I just moved its location
in the APFloat header into the IEEE-754R 5.7.2 section. If the name was
incorrect, I put in a comment giving the true IEEE-754R name.

Also unittests have been added for all of the functions which did not
already have a unittest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183179 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSilencing an MSVC warning about mixing bool and unsigned int.
Aaron Ballman [Tue, 4 Jun 2013 01:03:03 +0000 (01:03 +0000)]
Silencing an MSVC warning about mixing bool and unsigned int.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183176 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSilencing an MSVC warning about */ being found outside of a comment.
Aaron Ballman [Tue, 4 Jun 2013 01:01:56 +0000 (01:01 +0000)]
Silencing an MSVC warning about */ being found outside of a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183175 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a defect in code-layout pass, improving Benchmarks/Olden/em3d/em3d by about 30%
Shuxin Yang [Tue, 4 Jun 2013 01:00:57 +0000 (01:00 +0000)]
Fix a defect in code-layout pass, improving Benchmarks/Olden/em3d/em3d by about 30%
(4.58s vs 3.2s on an oldish Mac Tower).

  The corresponding src is excerpted bellow. The lopp accounts for about 90% of execution time.
  --------------------
    cat -n test-suite/MultiSource/Benchmarks/Olden/em3d/make_graph.c
     90
     91         for (k=0; k<j; k++)
     92           if (other_node == cur_node->to_nodes[k]) break;

  The defective layout is sketched bellow, where the two branches need to swap.
  ------------------------------------------------------------------------
      L:
         ...
      if (cond) goto out-of-loop
      goto L

  While this code sequence is defective, I don't understand why it incurs 1/3 of
execution time. CPU-event-profiling indicates the poor laoyout dose not increase
in br-misprediction; it dosen't increase stall cycle at all, and it dosen't
prevent the CPU detect the loop (i.e. Loop-Stream-Detector seems to be working fine
as well)...

   The root cause of the problem is that the layout pass calls AnalyzeBranch()
with basic-block which is not updated to reflect its current layout.

rdar://13966341

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183174 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDelete dead safety check.
Nick Lewycky [Mon, 3 Jun 2013 23:15:20 +0000 (23:15 +0000)]
Delete dead safety check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183167 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplifyCFG: Do not transform PHI to select if doing so would be unsafe
David Majnemer [Mon, 3 Jun 2013 20:43:12 +0000 (20:43 +0000)]
SimplifyCFG: Do not transform PHI to select if doing so would be unsafe

PR16069 is an interesting case where an incoming value to a PHI is a
trap value while also being a 'ConstantExpr'.

We do not consider this case when performing the 'HoistThenElseCodeToIf'
optimization.

Instead, make our modifications more conservative if we detect that we
cannot transform the PHI to a select.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183152 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplifyCFG: Small cleanup, use ICmpInst::isEquality()
David Majnemer [Mon, 3 Jun 2013 20:39:50 +0000 (20:39 +0000)]
SimplifyCFG: Small cleanup, use ICmpInst::isEquality()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183151 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove dead code.
Rafael Espindola [Mon, 3 Jun 2013 19:42:57 +0000 (19:42 +0000)]
Remove dead code.

Thanks to Sean Silva for noticing it!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183148 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate RuntimeDyldELF::findOPDEntrySection the new relocation iterators.
Rafael Espindola [Mon, 3 Jun 2013 19:37:34 +0000 (19:37 +0000)]
Update RuntimeDyldELF::findOPDEntrySection the new relocation iterators.

This was missing from r182908. I didn't noticed it at the time because the MCJIT tests were
disabled when building with cmake on ppc64 (which I fixed in r183143).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183147 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEnable mcjit tests on ppc64 when building with cmake.
Rafael Espindola [Mon, 3 Jun 2013 19:17:21 +0000 (19:17 +0000)]
Enable mcjit tests on ppc64 when building with cmake.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183143 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add support for work item and work group intrinsics
Tom Stellard [Mon, 3 Jun 2013 17:40:18 +0000 (17:40 +0000)]
R600/SI: Add support for work item and work group intrinsics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183138 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add a calling convention for compute shaders
Tom Stellard [Mon, 3 Jun 2013 17:40:11 +0000 (17:40 +0000)]
R600/SI: Add a calling convention for compute shaders

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183137 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Custom lower i64 sign_extend
Tom Stellard [Mon, 3 Jun 2013 17:40:03 +0000 (17:40 +0000)]
R600/SI: Custom lower i64 sign_extend

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183136 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Adjust some instructions' out register class after ISel
Tom Stellard [Mon, 3 Jun 2013 17:39:58 +0000 (17:39 +0000)]
R600/SI: Adjust some instructions' out register class after ISel

This is necessary to avoid generating VGPR to SGPR copies in some
cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183135 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Handle REG_SEQUENCE in fitsRegClass()
Tom Stellard [Mon, 3 Jun 2013 17:39:54 +0000 (17:39 +0000)]
R600/SI: Handle REG_SEQUENCE in fitsRegClass()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183134 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Handle nodes with glue results correctly SITargetLowering::foldOperands()
Tom Stellard [Mon, 3 Jun 2013 17:39:50 +0000 (17:39 +0000)]
R600/SI: Handle nodes with glue results correctly SITargetLowering::foldOperands()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183133 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Fixup CopyToReg register class in PostprocessISelDAG()
Tom Stellard [Mon, 3 Jun 2013 17:39:46 +0000 (17:39 +0000)]
R600/SI: Fixup CopyToReg register class in PostprocessISelDAG()

The CopyToReg nodes will sometimes try to copy a value from a VGPR to an
SGPR.  This kind of copy is not possible, so we need to detect
VGPR->SGPR copies and do something else.  The current strategy is to
replace these copies with VGPR->VGPR copies and hope that all the users
of CopyToReg can accept VGPRs as arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183132 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add support for global loads
Tom Stellard [Mon, 3 Jun 2013 17:39:43 +0000 (17:39 +0000)]
R600/SI: Add support for global loads

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183131 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Rework MUBUF store instructions
Tom Stellard [Mon, 3 Jun 2013 17:39:37 +0000 (17:39 +0000)]
R600/SI: Rework MUBUF store instructions

The lowering of stores is now mostly handled in the tablegen files.  No
more BUFFER_STORE nodes I generated during legalization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183130 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: 3 op instructions have no write bit but the result are store in PV
Vincent Lejeune [Mon, 3 Jun 2013 15:56:12 +0000 (15:56 +0000)]
R600: 3 op instructions have no write bit but the result are store in PV

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183111 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: CALL_FS consumes a stack size entry
Vincent Lejeune [Mon, 3 Jun 2013 15:44:42 +0000 (15:44 +0000)]
R600: CALL_FS consumes a stack size entry

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183108 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: use capital letter for PV channel
Vincent Lejeune [Mon, 3 Jun 2013 15:44:35 +0000 (15:44 +0000)]
R600: use capital letter for PV channel

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183107 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Constraints input regs of interp_xy,_zw
Vincent Lejeune [Mon, 3 Jun 2013 15:44:16 +0000 (15:44 +0000)]
R600: Constraints input regs of interp_xy,_zw

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183106 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[asan] ASan Linux MIPS32 support (llvm part), patch by Jyun-Yan Y
Kostya Serebryany [Mon, 3 Jun 2013 14:46:56 +0000 (14:46 +0000)]
[asan] ASan Linux MIPS32 support (llvm part), patch by Jyun-Yan Y

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183104 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoX86: sub_xmm registers are 128 bits wide.
Ahmed Bougacha [Mon, 3 Jun 2013 14:42:40 +0000 (14:42 +0000)]
X86: sub_xmm registers are 128 bits wide.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183103 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCorrect handling invalid filename in llvm-symbolizer
Alexey Samsonov [Mon, 3 Jun 2013 14:12:39 +0000 (14:12 +0000)]
Correct handling invalid filename in llvm-symbolizer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183102 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIntroduce needsCleanup() for APFloat and APInt.
Manuel Klimek [Mon, 3 Jun 2013 13:03:05 +0000 (13:03 +0000)]
Introduce needsCleanup() for APFloat and APInt.

This is needed in clang so one can check if the object needs the
destructor called after its memory was freed. This is useful when
creating many APInt/APFloat objects with placement new, where the
overhead of tracking the pointers for cleanup is significant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183100 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSparc: Add support for indirect branch and blockaddress in Sparc backend.
Venkatraman Govindaraju [Mon, 3 Jun 2013 05:58:33 +0000 (05:58 +0000)]
Sparc: Add support for indirect branch and blockaddress in Sparc backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183094 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Object/COFF] Fix Windows .lib name handling.
Rui Ueyama [Mon, 3 Jun 2013 00:27:03 +0000 (00:27 +0000)]
[Object/COFF] Fix Windows .lib name handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183091 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSparc: When storing 0, use %g0 directly in the store instruction instead of
Venkatraman Govindaraju [Mon, 3 Jun 2013 00:21:54 +0000 (00:21 +0000)]
Sparc: When storing 0, use %g0 directly in the store instruction instead of
       using two instructions (sethi and store).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183090 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSparc: Combine add/or/sethi instruction with restore if possible.
Venkatraman Govindaraju [Sun, 2 Jun 2013 21:48:17 +0000 (21:48 +0000)]
Sparc: Combine add/or/sethi instruction with restore if possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183088 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Object/COFF] Add dos_header, pe32{,plus}_header and data_directory.
Rui Ueyama [Sun, 2 Jun 2013 21:08:45 +0000 (21:08 +0000)]
[Object/COFF] Add dos_header, pe32{,plus}_header and data_directory.

Reviewers: Bigcheese

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D905

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183087 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhitespace.
Jim Grosbach [Sun, 2 Jun 2013 19:51:54 +0000 (19:51 +0000)]
Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183086 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSparc: Perform leaf procedure optimization by default
Venkatraman Govindaraju [Sun, 2 Jun 2013 02:24:27 +0000 (02:24 +0000)]
Sparc: Perform leaf procedure optimization by default

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183083 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTry to avoid "integer literal too big" warnings from older GCCs.
Benjamin Kramer [Sat, 1 Jun 2013 22:29:41 +0000 (22:29 +0000)]
Try to avoid "integer literal too big" warnings from older GCCs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183081 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhen determining the new index for an insertelement, we may not assume that an
Nick Lewycky [Sat, 1 Jun 2013 20:51:31 +0000 (20:51 +0000)]
When determining the new index for an insertelement, we may not assume that an
index greater than the size of the vector is invalid. The shuffle may be
shrinking the size of the vector. Fixes a crash!

Also drop the maximum recursion depth of the safety check for this
optimization to five.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183080 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSparc: Mark functions calling llvm.vastart and llvm.returnaddress intrinsics as non...
Venkatraman Govindaraju [Sat, 1 Jun 2013 20:42:48 +0000 (20:42 +0000)]
Sparc: Mark functions calling llvm.vastart and llvm.returnaddress intrinsics as non-leaf functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183079 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplifyCFG: Fix typo in comment for ComputeSpeculationCost
David Majnemer [Sat, 1 Jun 2013 19:43:23 +0000 (19:43 +0000)]
SimplifyCFG: Fix typo in comment for ComputeSpeculationCost

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183078 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove getRealLinkageName to a common place and remove all the duplicates of it.
Benjamin Kramer [Sat, 1 Jun 2013 17:51:14 +0000 (17:51 +0000)]
Move getRealLinkageName to a common place and remove all the duplicates of it.

Also simplify code a bit while there. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183076 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove object construction into [] so the temporary can be moved.
Benjamin Kramer [Sat, 1 Jun 2013 17:51:03 +0000 (17:51 +0000)]
Move object construction into [] so the temporary can be moved.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183075 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDenseMap: Move the key into place when we use the move version of operator[].
Benjamin Kramer [Sat, 1 Jun 2013 16:37:55 +0000 (16:37 +0000)]
DenseMap: Move the key into place when we use the move version of operator[].

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183074 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAPInt: Simplify code. No functionality change.
Benjamin Kramer [Sat, 1 Jun 2013 11:26:39 +0000 (11:26 +0000)]
APInt: Simplify code. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183073 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAPFloat: Use isDenormal instead of hand-rolled code to check for denormals.
Benjamin Kramer [Sat, 1 Jun 2013 11:26:33 +0000 (11:26 +0000)]
APFloat: Use isDenormal instead of hand-rolled code to check for denormals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183072 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDisable new legacy JIT test on ARM.
Tim Northover [Sat, 1 Jun 2013 10:24:11 +0000 (10:24 +0000)]
Disable new legacy JIT test on ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183071 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert r183069: "TMP: LEA64_32r fixing"
Tim Northover [Sat, 1 Jun 2013 10:23:46 +0000 (10:23 +0000)]
Revert r183069: "TMP: LEA64_32r fixing"

Very sorry, it was committed from the wrong branch by mistake.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183070 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTMP: LEA64_32r fixing
Tim Northover [Sat, 1 Jun 2013 10:21:54 +0000 (10:21 +0000)]
TMP: LEA64_32r fixing

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183069 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoX86: change MOV64ri64i32 into MOV32ri64
Tim Northover [Sat, 1 Jun 2013 09:55:14 +0000 (09:55 +0000)]
X86: change MOV64ri64i32 into MOV32ri64

The MOV64ri64i32 instruction required hacky MCInst lowering because it
was allocated as setting a GR64, but the eventual instruction ("movl")
only set a GR32. This converts it into a so-called "MOV32ri64" which
still accepts a (appropriate) 64-bit immediate but defines a GR32.
This is then converted to the full GR64 by a SUBREG_TO_REG operation,
thus keeping everyone happy.

This fixes a typo in the opcode field of the original patch, which
should make the legact JIT work again (& adds test for that problem).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183068 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Sparc] Generate correct code for leaf functions with stack objects
Venkatraman Govindaraju [Sat, 1 Jun 2013 04:51:18 +0000 (04:51 +0000)]
[Sparc] Generate correct code for leaf functions with stack objects

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183067 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemoved a comment above an include which is unnecessary and added a missing closing...
Michael Gottesman [Sat, 1 Jun 2013 00:48:24 +0000 (00:48 +0000)]
Removed a comment above an include which is unnecessary and added a missing closing @} for a doxygen comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183065 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdded method comments for getZero,getInf.
Michael Gottesman [Sat, 1 Jun 2013 00:44:29 +0000 (00:44 +0000)]
Added method comments for getZero,getInf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183064 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdated APFloat's comments to fit the LLVM style guide.
Michael Gottesman [Sat, 1 Jun 2013 00:44:05 +0000 (00:44 +0000)]
Updated APFloat's comments to fit the LLVM style guide.

Also added a few more method comments and performed some copy editing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183063 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake SubRegIndex size mandatory, following r183020.
Ahmed Bougacha [Fri, 31 May 2013 23:45:26 +0000 (23:45 +0000)]
Make SubRegIndex size mandatory, following r183020.

This also makes TableGen able to compute sizes/offsets of synthesized
indices representing tuples.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183061 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPrevent loop-unroll from making assumptions about undefined behavior.
Andrew Trick [Fri, 31 May 2013 23:34:46 +0000 (23:34 +0000)]
Prevent loop-unroll from making assumptions about undefined behavior.

Fixes rdar:14036816, PR16130.

There is an opportunity to compute precise trip counts for 'or'
expressions and multi-exit loops.
rdar:14038809: Optimize trip count computation for multi-exit loops.

To do this we need to record the fact that ExitLimit assumes NSW. When
it does not we can safely assume that the loop trip count is the
minimum ExitLimt across all subexpressions and loop exits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183060 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTemporarily Revert "X86: change MOV64ri64i32 into MOV32ri64" as it
Eric Christopher [Fri, 31 May 2013 23:30:45 +0000 (23:30 +0000)]
Temporarily Revert "X86: change MOV64ri64i32 into MOV32ri64" as it
seems to have caused PR16192 and other JIT related failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183059 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConst-ify some printing and dumping code for DIEValues.
Eric Christopher [Fri, 31 May 2013 22:50:40 +0000 (22:50 +0000)]
Const-ify some printing and dumping code for DIEValues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183057 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for adding the contents of a StringRef to the MD5 hash.
Eric Christopher [Fri, 31 May 2013 22:34:56 +0000 (22:34 +0000)]
Add support for adding the contents of a StringRef to the MD5 hash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183054 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConvert more unsigned char -> uint8_t.
Eric Christopher [Fri, 31 May 2013 22:34:52 +0000 (22:34 +0000)]
Convert more unsigned char -> uint8_t.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183053 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix comment.
Eric Christopher [Fri, 31 May 2013 22:34:48 +0000 (22:34 +0000)]
Fix comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183052 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove "unsigned char" -> "uint8_t".
Eric Christopher [Fri, 31 May 2013 22:34:34 +0000 (22:34 +0000)]
Move "unsigned char" -> "uint8_t".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183051 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLoopVectorize: Change API call to get the backedge taken count
Arnold Schwaighofer [Fri, 31 May 2013 21:48:56 +0000 (21:48 +0000)]
LoopVectorize: Change API call to get the backedge taken count

Use ScalarEvolution's getBackedgeTakenCount API instead of getExitCount since
that is really what we want to know. Using the more specific getExitCount was
safe because we made sure that there is only one exiting block.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183047 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLoop Strength Reduce: Scaling factor cost.
Quentin Colombet [Fri, 31 May 2013 21:29:03 +0000 (21:29 +0000)]
Loop Strength Reduce: Scaling factor cost.

Account for the cost of scaling factor in Loop Strength Reduce when rating the
formulae. This uses a target hook.

The default implementation of the hook is: if the addressing mode is legal, the
scaling factor is free.

<rdar://problem/13806271>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183045 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse just a ArrayRef<uint8_t> to store both hex string and binary data.
Rafael Espindola [Fri, 31 May 2013 21:03:51 +0000 (21:03 +0000)]
Use just a ArrayRef<uint8_t> to store both hex string and binary data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183043 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRename COFFYaml.h to COFFYAML.h for consistency.
Rafael Espindola [Fri, 31 May 2013 20:38:27 +0000 (20:38 +0000)]
Rename COFFYaml.h to COFFYAML.h for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183042 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove union to fix build in c++03.
Rafael Espindola [Fri, 31 May 2013 20:35:58 +0000 (20:35 +0000)]
Remove union to fix build in c++03.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183041 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't allocate temporary string for section data.
Rafael Espindola [Fri, 31 May 2013 20:26:44 +0000 (20:26 +0000)]
Don't allocate temporary string for section data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183040 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLoopVectorize: PHIs with only outside users should prevent vectorization
Arnold Schwaighofer [Fri, 31 May 2013 19:53:50 +0000 (19:53 +0000)]
LoopVectorize: PHIs with only outside users should prevent vectorization

We check that instructions in the loop don't have outside users (except if
they are reduction values). Unfortunately, we skipped this check for
if-convertable PHIs.

Fixes PR16184.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183035 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoNVPTX: Don't even create a regalloc if we're not going to use it.
Benjamin Kramer [Fri, 31 May 2013 19:21:58 +0000 (19:21 +0000)]
NVPTX: Don't even create a regalloc if we're not going to use it.

Fixes a leak found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183031 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[APFloat] Added a unittest for APFloat::getZero.
Michael Gottesman [Fri, 31 May 2013 18:43:34 +0000 (18:43 +0000)]
[APFloat] Added a unittest for APFloat::getZero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183028 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoModify how the formulae are rated in Loop Strength Reduce.
Quentin Colombet [Fri, 31 May 2013 17:20:29 +0000 (17:20 +0000)]
Modify how the formulae are rated in Loop Strength Reduce.
Namely, check if the target allows to fold more that one register in the
addressing mode and if yes, adjust the cost accordingly.

Prior to this commit, reg1 + scale * reg2 accesses were artificially preferred
to reg1 + reg2 accesses. Indeed, the cost model wrongly assumed that reg1 + reg2
needs a temporary register for the computation, whereas it was correctly
estimated for reg1 + scale * reg2.

<rdar://problem/13973908>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183021 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a way to define the bit range covered by a SubRegIndex.
Ahmed Bougacha [Fri, 31 May 2013 17:08:36 +0000 (17:08 +0000)]
Add a way to define the bit range covered by a SubRegIndex.

NOTE: If this broke your out-of-tree backend, in *RegisterInfo.td, change
the instances of SubRegIndex that have a comps template arg to use the
ComposedSubRegIndex class instead.

In TableGen land, this adds Size and Offset attributes to SubRegIndex,
and the ComposedSubRegIndex class, for which the Size and Offset are
computed by TableGen. This also adds an accessor in MCRegisterInfo, and
Size/Offsets for the X86 and ARM subreg indices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183020 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUnit test for SCEV fix r182989, PR16130.
Andrew Trick [Fri, 31 May 2013 16:42:41 +0000 (16:42 +0000)]
Unit test for SCEV fix r182989, PR16130.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183017 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove useless code from transitioning to new EH scheme
Kai Nacke [Fri, 31 May 2013 16:30:36 +0000 (16:30 +0000)]
Remove useless code from transitioning to new EH scheme

Removes all uses of the variable UsesNewEH. Simply return false in case that no
resume instructions were found.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183016 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: permit upper-case BE/LE on setend instruction
Tim Northover [Fri, 31 May 2013 15:58:45 +0000 (15:58 +0000)]
ARM: permit upper-case BE/LE on setend instruction

Patch by Amaury de la Vieuville.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183012 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: add fstmx and fldmx instructions for assembly
Tim Northover [Fri, 31 May 2013 15:55:51 +0000 (15:55 +0000)]
ARM: add fstmx and fldmx instructions for assembly

These instructions are deprecated oddities, but we still need to be able to
disassemble (and reassemble) them if and when they're encountered.

Patch by Amaury de la Vieuville.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183011 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify multiplications by vectors whose elements are powers of 2.
Rafael Espindola [Fri, 31 May 2013 14:27:15 +0000 (14:27 +0000)]
Simplify multiplications by vectors whose elements are powers of 2.

Patch by Andrea Di Biagio.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183005 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: fix VEXT encoding corner case
Tim Northover [Fri, 31 May 2013 13:47:25 +0000 (13:47 +0000)]
ARM: fix VEXT encoding corner case

The disassembly of VEXT instructions was too lax in the bits checked. This
fixes the case where the instruction affects Q-registers but a misaligned lane
was specified (should be UNDEFINED).

Patch by Amaury de la Vieuville

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183003 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[SystemZ] Don't use LOAD and STORE REVERSED for volatile accesses
Richard Sandiford [Fri, 31 May 2013 13:25:22 +0000 (13:25 +0000)]
[SystemZ] Don't use LOAD and STORE REVERSED for volatile accesses

Unlike most -- hopefully "all other", but I'm still checking -- memory
instructions we support, LOAD REVERSED and STORE REVERSED may access
the memory location several times.  This means that they are not suitable
for volatile loads and stores.

This patch is a prerequisite for better atomic load and store support.
The same principle applies there: almost all memory instructions we
support are inherently atomic ("block concurrent"), but LOAD REVERSED
and STORE REVERSED are exceptions.

Other instructions continue to allow volatile operands.  I will add
positive "allows volatile" tests at the same time as the "allows atomic
load or store" tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183002 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[NVPTX] Re-enable support for virtual registers in the final output
Justin Holewinski [Fri, 31 May 2013 12:14:49 +0000 (12:14 +0000)]
[NVPTX] Re-enable support for virtual registers in the final output

Now that 3.3 is branched, we are re-enabling virtual registers to help
iron out bugs before the next release. Some of the post-RA passes do
not play well with virtual registers, so we disable them for now. The
needed functionality of the PrologEpilogInserter pass is copied to a
new backend-specific NVPTXPrologEpilog pass.

The test for this commit is not breaking the existing tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182998 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[msan] Handle mixed track-origins and keep-going settings (llvm part).
Evgeniy Stepanov [Fri, 31 May 2013 12:04:29 +0000 (12:04 +0000)]
[msan] Handle mixed track-origins and keep-going settings (llvm part).

Before this change, each module defined a weak_odr global __msan_track_origins
with a value of 1 if origin tracking is enabled, 0 if disabled. If there are
modules with different values, any of them may win. If 0 wins, and there is at
least one module with 1, the program will most likely crash.

With this change, __msan_track_origins is only emitted if origin tracking is
on. Then runtime library detects if there is at least one module with origin
tracking, and enables runtime support for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182997 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoX86: change MOV64ri64i32 into MOV32ri64
Tim Northover [Fri, 31 May 2013 09:57:13 +0000 (09:57 +0000)]
X86: change MOV64ri64i32 into MOV32ri64

The MOV64ri64i32 instruction required hacky MCInst lowering because it was
allocated as setting a GR64, but the eventual instruction ("movl") only set a
GR32. This converts it into a so-called "MOV32ri64" which still accepts a
(appropriate) 64-bit immediate but defines a GR32. This is then converted to
the full GR64 by a SUBREG_TO_REG operation, thus keeping everyone happy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182991 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd links to the System z architecture manual and ABI
Richard Sandiford [Fri, 31 May 2013 09:14:54 +0000 (09:14 +0000)]
Add links to the System z architecture manual and ABI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182990 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix ScalarEvolution::ComputeExitLimitFromCond for 'or' conditions.
Andrew Trick [Fri, 31 May 2013 06:43:25 +0000 (06:43 +0000)]
Fix ScalarEvolution::ComputeExitLimitFromCond for 'or' conditions.

Fixes PR16130 - clang produces incorrect code with loop/expression at -O2.

This is a 2+ year old bug that's now holding up the release. It's a
case where we knowingly made aggressive assumptions about undefined
behavior. These assumptions are wrong when SCEV is computing a
subexpression that does not directly control the branch. With this
fix, we avoid making assumptions in those cases but still optimize the
common case. SCEV's trip count computation for exits controlled by
'or' expressions is now analagous to the trip count computation for
loops with multiple exits. I had already fixed the multiple exit case
to be conservative.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182989 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[mips] Big-endian code generation for atomic instructions.
Akira Hatanaka [Fri, 31 May 2013 03:25:44 +0000 (03:25 +0000)]
[mips] Big-endian code generation for atomic instructions.

Patch by Jyun-Yan You.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182984 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix wrong comment. Null is not acceptable.
Matt Arsenault [Fri, 31 May 2013 01:40:30 +0000 (01:40 +0000)]
Fix wrong comment. Null is not acceptable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182979 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReapply with r182909 with a fix to the calculation of the new indices for
Nick Lewycky [Fri, 31 May 2013 00:59:42 +0000 (00:59 +0000)]
Reapply with r182909 with a fix to the calculation of the new indices for
insertelement instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182976 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove debug print added in r182949.
Ahmed Bougacha [Thu, 30 May 2013 23:46:47 +0000 (23:46 +0000)]
Remove debug print added in r182949.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182973 91177308-0d34-0410-b5e6-96231b3b80d8