oota-llvm.git
14 years agoAdd AVX 256-bit unpack and interleave
Bruno Cardoso Lopes [Fri, 9 Jul 2010 21:20:35 +0000 (21:20 +0000)]
Add AVX 256-bit unpack and interleave

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

14 years agoFix small bug in isMoveInstr -> COPY translation
Jakob Stoklund Olesen [Fri, 9 Jul 2010 20:55:49 +0000 (20:55 +0000)]
Fix small bug in isMoveInstr -> COPY translation

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

14 years agoAutomatically fold COPY instructions into stack load/store.
Jakob Stoklund Olesen [Fri, 9 Jul 2010 20:43:13 +0000 (20:43 +0000)]
Automatically fold COPY instructions into stack load/store.

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

14 years agoFix a few tests
Jakob Stoklund Olesen [Fri, 9 Jul 2010 20:43:09 +0000 (20:43 +0000)]
Fix a few tests

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

14 years agoRemat uncoalescable COPY instrs
Jakob Stoklund Olesen [Fri, 9 Jul 2010 20:43:05 +0000 (20:43 +0000)]
Remat uncoalescable COPY instrs

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

14 years agoIn the presence of variable sized objects, allocate an emergency spill slot.
Jim Grosbach [Fri, 9 Jul 2010 20:27:06 +0000 (20:27 +0000)]
In the presence of variable sized objects, allocate an emergency spill slot.
rdar://8131327

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

14 years agoClarify what mysterious check means.
Bill Wendling [Fri, 9 Jul 2010 19:44:12 +0000 (19:44 +0000)]
Clarify what mysterious check means.

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

14 years agoAdd a target triple.
Dan Gohman [Fri, 9 Jul 2010 19:17:36 +0000 (19:17 +0000)]
Add a target triple.

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

14 years agoFix MachineLICM to actually visit inner loops.
Dan Gohman [Fri, 9 Jul 2010 18:49:45 +0000 (18:49 +0000)]
Fix MachineLICM to actually visit inner loops.

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

14 years agoStart the support for AVX instructions with 256-bit %ymm registers. A couple of
Bruno Cardoso Lopes [Fri, 9 Jul 2010 18:27:43 +0000 (18:27 +0000)]
Start the support for AVX instructions with 256-bit %ymm registers. A couple of
notes:
- The instructions are being added with dummy placeholder patterns using some 256
  specifiers, this is not meant to work now, but since there are some multiclasses
  generic enough to accept them,  when we go for codegen, the stuff will be already
  there.
- Add VEX encoding bits to support YMM
- Add MOVUPS and MOVAPS in the first round
- Use "Y" as suffix for those Instructions: MOVUPSYrr, ...
- All AVX instructions in X86InstrSSE.td will move soon to a new X86InstrAVX
  file.

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

14 years agoChange TII::foldMemoryOperand API to require the machine instruction to be
Jakob Stoklund Olesen [Fri, 9 Jul 2010 17:29:08 +0000 (17:29 +0000)]
Change TII::foldMemoryOperand API to require the machine instruction to be
inserted in a MBB, and return an already inserted MI.

This target API change is necessary to allow foldMemoryOperand to call
storeToStackSlot and loadFromStackSlot when folding a COPY to a stack slot
reference in a target independent way.

The foldMemoryOperandImpl hook is going to change in the same way, but I'll wait
until COPY folding is actually implemented. Most targets only fold copies and
won't need to specialize this hook at all.

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 16:51:20 +0000 (16:51 +0000)]
cache result of operator*

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

14 years agoremove useless cast and fix typos in comment
Gabor Greif [Fri, 9 Jul 2010 16:42:04 +0000 (16:42 +0000)]
remove useless cast and fix typos in comment

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 16:39:02 +0000 (16:39 +0000)]
cache result of operator*

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

14 years ago--- Reverse-merging r107947 into '.':
Bob Wilson [Fri, 9 Jul 2010 16:37:18 +0000 (16:37 +0000)]
--- Reverse-merging r107947 into '.':
U    utils/TableGen/FastISelEmitter.cpp
--- Reverse-merging r107943 into '.':
U    test/CodeGen/X86/fast-isel.ll
U    test/CodeGen/X86/fast-isel-loads.ll
U    include/llvm/Target/TargetLowering.h
U    include/llvm/Support/PassNameParser.h
U    include/llvm/CodeGen/FunctionLoweringInfo.h
U    include/llvm/CodeGen/CallingConvLower.h
U    include/llvm/CodeGen/FastISel.h
U    include/llvm/CodeGen/SelectionDAGISel.h
U    lib/CodeGen/LLVMTargetMachine.cpp
U    lib/CodeGen/CallingConvLower.cpp
U    lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
U    lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
U    lib/CodeGen/SelectionDAG/FastISel.cpp
U    lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
U    lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
U    lib/CodeGen/SelectionDAG/InstrEmitter.cpp
U    lib/CodeGen/SelectionDAG/TargetLowering.cpp
U    lib/Target/XCore/XCoreISelLowering.cpp
U    lib/Target/XCore/XCoreISelLowering.h
U    lib/Target/X86/X86ISelLowering.cpp
U    lib/Target/X86/X86FastISel.cpp
U    lib/Target/X86/X86ISelLowering.h

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 16:31:08 +0000 (16:31 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 16:26:41 +0000 (16:26 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 16:22:36 +0000 (16:22 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 16:17:52 +0000 (16:17 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 16:08:33 +0000 (16:08 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 16:01:21 +0000 (16:01 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 15:53:42 +0000 (15:53 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 15:52:36 +0000 (15:52 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 15:40:10 +0000 (15:40 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 15:25:42 +0000 (15:25 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 15:25:09 +0000 (15:25 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 15:01:36 +0000 (15:01 +0000)]
cache result of operator*

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

14 years agocache result of operator* (found by inspection)
Gabor Greif [Fri, 9 Jul 2010 14:48:08 +0000 (14:48 +0000)]
cache result of operator* (found by inspection)

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

14 years agofix clang selfhost issue (shadowing)
Gabor Greif [Fri, 9 Jul 2010 14:46:49 +0000 (14:46 +0000)]
fix clang selfhost issue (shadowing)

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 14:36:49 +0000 (14:36 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 14:29:14 +0000 (14:29 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 14:28:41 +0000 (14:28 +0000)]
cache result of operator*

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

14 years agocache result of operator*
Gabor Greif [Fri, 9 Jul 2010 14:18:23 +0000 (14:18 +0000)]
cache result of operator*

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

14 years agocache operator*'s result (in multiple functions)
Gabor Greif [Fri, 9 Jul 2010 14:02:13 +0000 (14:02 +0000)]
cache operator*'s result (in multiple functions)

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

14 years agorefactor type expressions and cache operator*'s result
Gabor Greif [Fri, 9 Jul 2010 14:00:56 +0000 (14:00 +0000)]
refactor type expressions and cache operator*'s result

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

14 years agodo not repeatedly dereference use_iterator
Gabor Greif [Fri, 9 Jul 2010 13:17:13 +0000 (13:17 +0000)]
do not repeatedly dereference use_iterator

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

14 years agodo not repeatedly dereference use_iterator
Gabor Greif [Fri, 9 Jul 2010 12:23:50 +0000 (12:23 +0000)]
do not repeatedly dereference use_iterator

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

14 years agotwo more cases of reuse result of operator*, found by inspection
Gabor Greif [Fri, 9 Jul 2010 10:42:13 +0000 (10:42 +0000)]
two more cases of reuse result of operator*, found by inspection

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

14 years agoanother case of reuse result of operator*, it is expensive to recompute
Gabor Greif [Fri, 9 Jul 2010 10:32:31 +0000 (10:32 +0000)]
another case of reuse result of operator*, it is expensive to recompute

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

14 years agoreuse result of operator*, it is expensive to recompute
Gabor Greif [Fri, 9 Jul 2010 09:50:51 +0000 (09:50 +0000)]
reuse result of operator*, it is expensive to recompute

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

14 years agoAdded a support for inserting new MBBs into the numbering.
Lang Hames [Fri, 9 Jul 2010 09:19:23 +0000 (09:19 +0000)]
Added a support for inserting new MBBs into the numbering.

Unlike insertMachineInstrInMaps this does not guarantee live intervals will
remain correct. The caller will need to manually update intervals to account
for the changes made to the CFG.

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

14 years agoAvoid creating %physreg:subidx operands in SimpleRegisterCoalescing::RemoveCopyByComm...
Jakob Stoklund Olesen [Fri, 9 Jul 2010 05:56:21 +0000 (05:56 +0000)]
Avoid creating %physreg:subidx operands in SimpleRegisterCoalescing::RemoveCopyByCommutingDef.

This fixes PR7602.

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

14 years agoDeal with a few remaining spots that assume physical registers have live intervals.
Jakob Stoklund Olesen [Fri, 9 Jul 2010 04:35:38 +0000 (04:35 +0000)]
Deal with a few remaining spots that assume physical registers have live intervals.

This fixes PR7601.

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

14 years agoMerge VEX enums with other x86 enum forms. Also fix all checks of which VEX
Bruno Cardoso Lopes [Fri, 9 Jul 2010 01:56:45 +0000 (01:56 +0000)]
Merge VEX enums with other x86 enum forms. Also fix all checks of which VEX
fields to use.

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

14 years agoFix test to be less sensitive of regalloc accidents
Jakob Stoklund Olesen [Fri, 9 Jul 2010 01:32:11 +0000 (01:32 +0000)]
Fix test to be less sensitive of regalloc accidents

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

14 years agoFix broken isCopy handling in TrimLiveIntervalToLastUse.
Jakob Stoklund Olesen [Fri, 9 Jul 2010 01:27:21 +0000 (01:27 +0000)]
Fix broken isCopy handling in TrimLiveIntervalToLastUse.

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

14 years agoHandle COPY in VirtRegRewriter.
Jakob Stoklund Olesen [Fri, 9 Jul 2010 01:27:19 +0000 (01:27 +0000)]
Handle COPY in VirtRegRewriter.

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

14 years agoFix the memoperand offsets in code generated for va_start.
Dan Gohman [Fri, 9 Jul 2010 01:06:48 +0000 (01:06 +0000)]
Fix the memoperand offsets in code generated for va_start.

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

14 years agoThese changes should have accompanied r107943.
Dan Gohman [Fri, 9 Jul 2010 00:59:16 +0000 (00:59 +0000)]
These changes should have accompanied r107943.

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

14 years agohave the mc lowering process handle a few tail call forms, lowering them to
Chris Lattner [Fri, 9 Jul 2010 00:49:41 +0000 (00:49 +0000)]
have the mc lowering process handle a few tail call forms, lowering them to
jumps where possible and turning the TAILCALL marker in the instruction
asm string into a proper comment.

This eliminates a FIXME and is on the path to finishing:
rdar://7639610 - eliminate encoding and asm info for TAILJMPd TAILJMPr TAILJMPn, etc.

However, I can't eliminate the encodings for these instructions because the JIT
still exists and has its own copy of the encoder, sigh.

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

14 years agoPrint "dregpair" NEON operands with a space between them, for readability and
Bob Wilson [Fri, 9 Jul 2010 00:47:20 +0000 (00:47 +0000)]
Print "dregpair" NEON operands with a space between them, for readability and
consistency with other instructions that have lists of register operands.

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

14 years agoRe-apply bottom-up fast-isel, with fixes. Be very careful to avoid emitting
Dan Gohman [Fri, 9 Jul 2010 00:39:23 +0000 (00:39 +0000)]
Re-apply bottom-up fast-isel, with fixes. Be very careful to avoid emitting
a DBG_VALUE after a terminator, or emitting any instructions before an EH_LABEL.

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

14 years agoFactor out x86 segment override prefix encoding, and also use it for VEX
Bruno Cardoso Lopes [Fri, 9 Jul 2010 00:38:14 +0000 (00:38 +0000)]
Factor out x86 segment override prefix encoding, and also use it for VEX

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

14 years agoReenable DAG combining for vector shuffles. It looks like it was temporarily
Bob Wilson [Fri, 9 Jul 2010 00:38:12 +0000 (00:38 +0000)]
Reenable DAG combining for vector shuffles.  It looks like it was temporarily
disabled and then never turned back on again.  Adjust some tests, one because
this change avoids an unnecessary instruction, and the other to make it
continue testing what it was intended to test.

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

14 years agoreject pseudo instructions early in the encoder.
Chris Lattner [Fri, 9 Jul 2010 00:17:50 +0000 (00:17 +0000)]
reject pseudo instructions early in the encoder.

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

14 years agoRemove trailing whitespaces from file
Bruno Cardoso Lopes [Fri, 9 Jul 2010 00:07:19 +0000 (00:07 +0000)]
Remove trailing whitespaces from file

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

14 years agoChange LEA to have 5 operands for its memory operand, just
Chris Lattner [Thu, 8 Jul 2010 23:46:44 +0000 (23:46 +0000)]
Change LEA to have 5 operands for its memory operand, just
like all other instructions, even though a segment is not
allowed.  This resolves a bunch of gross hacks in the
encoder and makes LEA more consistent with the rest of the
instruction set.

No functionality change.

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

14 years agoReverting r107918 and r107919. Radar 8063111.
Stuart Hastings [Thu, 8 Jul 2010 23:25:39 +0000 (23:25 +0000)]
Reverting r107918 and r107919.  Radar 8063111.

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

14 years agoRevert "Fix broken isCopy handling in TrimLiveIntervalToLastUse"
Jakob Stoklund Olesen [Thu, 8 Jul 2010 22:52:47 +0000 (22:52 +0000)]
Revert "Fix broken isCopy handling in TrimLiveIntervalToLastUse"

This reverts commit 107921. It broke the clang self host.

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

14 years agoadd some long-overdue enums to refer to the parts of the 5-operand
Chris Lattner [Thu, 8 Jul 2010 22:41:28 +0000 (22:41 +0000)]
add some long-overdue enums to refer to the parts of the 5-operand
X86 memory operand.

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

14 years agoRelax assertion. In optimized code, it is possible that first instruction is coming...
Devang Patel [Thu, 8 Jul 2010 22:39:20 +0000 (22:39 +0000)]
Relax assertion. In optimized code, it is possible that first instruction is coming from a inlined function.
This fixes PR7596 .

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

14 years agoExtension of r107506. Make sure that we don't mark a function as having a call
Bill Wendling [Thu, 8 Jul 2010 22:38:02 +0000 (22:38 +0000)]
Extension of r107506. Make sure that we don't mark a function as having a call
if the inline ASM doesn't need a stack frame.

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

14 years agoFix broken isCopy handling in TrimLiveIntervalToLastUse
Jakob Stoklund Olesen [Thu, 8 Jul 2010 22:30:38 +0000 (22:30 +0000)]
Fix broken isCopy handling in TrimLiveIntervalToLastUse

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

14 years agoRemember the VR64 register class
Jakob Stoklund Olesen [Thu, 8 Jul 2010 22:30:35 +0000 (22:30 +0000)]
Remember the VR64 register class

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

14 years agoFix decl/def debug info for template functions. Radar 8063111.
Stuart Hastings [Thu, 8 Jul 2010 22:28:59 +0000 (22:28 +0000)]
Fix decl/def debug info for template functions.  Radar 8063111.

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

14 years agoRework segment prefix emission code to handle segments
Chris Lattner [Thu, 8 Jul 2010 22:28:12 +0000 (22:28 +0000)]
Rework segment prefix emission code to handle segments
in memory operands at the same type as hard coded segments.
This fixes problems where we'd emit the segment override after
the REX prefix on instructions like:
mov %gs:(%rdi), %rax

This fixes rdar://8127102.  I have several cleanup patches coming
next.

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

14 years agointroduce a new X86II::getMemoryOperandNo method, which
Chris Lattner [Thu, 8 Jul 2010 22:27:06 +0000 (22:27 +0000)]
introduce a new X86II::getMemoryOperandNo method, which
returns the start of the memory operand for an instruction.

Introduce a new "X86AddrSegment" enum to reduce # magic numbers
referring to X86 memory operand layout.

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

14 years agoSwitch SPU calling convention (function arguments)
Kalle Raiskila [Thu, 8 Jul 2010 21:15:22 +0000 (21:15 +0000)]
Switch SPU calling convention (function arguments)
to a Tablegen implementation.

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

14 years agoTest case for r107843. Radar 8152866.
Stuart Hastings [Thu, 8 Jul 2010 20:31:05 +0000 (20:31 +0000)]
Test case for r107843.  Radar 8152866.

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

14 years agoRevert some unneeded parts of the change in r107886 for the
Kevin Enderby [Thu, 8 Jul 2010 20:30:44 +0000 (20:30 +0000)]
Revert some unneeded parts of the change in r107886 for the
.weak_def_can_be_hidden directive.  Chris pointed out that the MCAsmInfo.h/.cpp
chunks aren't needed for this until the compiler starts generating these.  And
when that happens it will be more convenient for it to be a bool than a const
char*.

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

14 years agoCheck for FiniteOnlyFPMath as well.
Evan Cheng [Thu, 8 Jul 2010 20:12:24 +0000 (20:12 +0000)]
Check for FiniteOnlyFPMath as well.

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

14 years agoReuse DIEInteger for 1. This is frequently used while emitting an attribute using...
Devang Patel [Thu, 8 Jul 2010 20:10:35 +0000 (20:10 +0000)]
Reuse DIEInteger for 1. This is frequently used while emitting an attribute using dwarf::DW_FORM_flag form.

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

14 years agoTeach the x86 floating point stackifier to handle COPY instructions.
Jakob Stoklund Olesen [Thu, 8 Jul 2010 19:46:30 +0000 (19:46 +0000)]
Teach the x86 floating point stackifier to handle COPY instructions.

This pass runs before COPY instructions are passed to copyPhysReg, so we simply
translate COPY to the proper pseudo instruction. Note that copyPhysReg does not
handle floating point stack copies.

Once COPY is used everywhere, this can be cleaned up a bit, and most of the
pseudo instructions can be removed.

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

14 years agoImplement X86InstrInfo::copyPhysReg
Jakob Stoklund Olesen [Thu, 8 Jul 2010 19:46:25 +0000 (19:46 +0000)]
Implement X86InstrInfo::copyPhysReg

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

14 years agoThe NEONPreAllocPass should never have to assign fixed registers anymore.
Bob Wilson [Thu, 8 Jul 2010 17:45:26 +0000 (17:45 +0000)]
The NEONPreAllocPass should never have to assign fixed registers anymore.
This pass can go away entirely soon.

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

14 years agoFor big-endian systems, VLD2/VST2 with 32-bit vector elements will swap the
Bob Wilson [Thu, 8 Jul 2010 17:44:00 +0000 (17:44 +0000)]
For big-endian systems, VLD2/VST2 with 32-bit vector elements will swap the
words within the 64-bit D registers.  Use VLD1/VST1 with 64-bit elements
instead.

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

14 years agoAfter r107880, findSurvivorReg() no longer needs to be public.
Jim Grosbach [Thu, 8 Jul 2010 17:27:23 +0000 (17:27 +0000)]
After r107880, findSurvivorReg() no longer needs to be public.

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

14 years agoAdded the darwin .weak_def_can_be_hidden directive.
Kevin Enderby [Thu, 8 Jul 2010 17:22:42 +0000 (17:22 +0000)]
Added the darwin .weak_def_can_be_hidden directive.

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

14 years agoonly dereference iterator once in the loop
Gabor Greif [Thu, 8 Jul 2010 16:56:18 +0000 (16:56 +0000)]
only dereference iterator once in the loop
(by caching the result we save a potentially expensive dereference)

also use typedefs to shorten type declarations

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

14 years agoClean up a comment.
Bob Wilson [Thu, 8 Jul 2010 16:54:45 +0000 (16:54 +0000)]
Clean up a comment.

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

14 years agoremove unneeded parens
Gabor Greif [Thu, 8 Jul 2010 16:52:57 +0000 (16:52 +0000)]
remove unneeded parens

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

14 years agoClean up scavengeRegister() a bit to prefer available regs, which allows
Jim Grosbach [Thu, 8 Jul 2010 16:49:26 +0000 (16:49 +0000)]
Clean up scavengeRegister() a bit to prefer available regs, which allows
the simplification of frame index register scavenging to not have to check
for available registers directly and instead just let scavengeRegister()
handle it.

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

14 years agoConvert EXTRACT_SUBREG to COPY when emitting machine instrs.
Jakob Stoklund Olesen [Thu, 8 Jul 2010 16:40:22 +0000 (16:40 +0000)]
Convert EXTRACT_SUBREG to COPY when emitting machine instrs.

EXTRACT_SUBREG no longer appears as a machine instruction. Use COPY instead.

Add isCopy() checks in many places using isMoveInstr() and isExtractSubreg().
The isMoveInstr hook will be removed later.

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

14 years agoRemove references to INSERT_SUBREG after de-SSA.
Jakob Stoklund Olesen [Thu, 8 Jul 2010 16:40:15 +0000 (16:40 +0000)]
Remove references to INSERT_SUBREG after de-SSA.

Fix X86InstrInfo::convertToThreeAddressWithLEA to generate COPY instead of
INSERT_SUBREG.

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

14 years agoUse std::vector rather than SmallVector here because SmallVector
Duncan Sands [Thu, 8 Jul 2010 13:06:08 +0000 (13:06 +0000)]
Use std::vector rather than SmallVector here because SmallVector
causes some versions of gcc to crash when building LLVM.

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

14 years agoMerge the duplicated iabs optimization in DAGCombiner and let it detected a few more...
Benjamin Kramer [Thu, 8 Jul 2010 12:09:56 +0000 (12:09 +0000)]
Merge the duplicated iabs optimization in DAGCombiner and let it detected a few more idioms.

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

14 years agoDo not use std::stack because it causes obscure failures when
Duncan Sands [Thu, 8 Jul 2010 11:54:27 +0000 (11:54 +0000)]
Do not use std::stack because it causes obscure failures when
compiled with MSVC 2010 (PR7367).  Instead use a SmallVector.

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

14 years agoTeach instcombine to transform
Benjamin Kramer [Thu, 8 Jul 2010 11:39:10 +0000 (11:39 +0000)]
Teach instcombine to transform
(X >s -1) ? C1 : C2 and (X <s  0) ? C2 : C1
into ((X >>s 31) & (C2 - C1)) + C1, avoiding the conditional.

This optimization could be extended to take non-const C1 and C2 but we better
stay conservative to avoid code size bloat for now.

for
int sel(int n) {
     return n >= 0 ? 60 : 100;
}

we now generate
  sarl  $31, %edi
  andl  $40, %edi
  leal  60(%rdi), %eax

instead of
  testl %edi, %edi
  movl  $60, %ecx
  movl  $100, %eax
  cmovnsl %ecx, %eax

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

14 years agoTweak some docs now that the default build is called Debug+Asserts.
Duncan Sands [Thu, 8 Jul 2010 08:27:18 +0000 (08:27 +0000)]
Tweak some docs now that the default build is called Debug+Asserts.

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

14 years agoA slight reworking of the custom patterns for x86-64 tpoff codegen and
Eric Christopher [Thu, 8 Jul 2010 07:36:46 +0000 (07:36 +0000)]
A slight reworking of the custom patterns for x86-64 tpoff codegen and
correct the testcase for valid assembly.

Needs more tests.

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

14 years agor107852 is only safe with -enable-unsafe-fp-math to account for +0.0 == -0.0.
Evan Cheng [Thu, 8 Jul 2010 06:01:49 +0000 (06:01 +0000)]
r107852 is only safe with -enable-unsafe-fp-math to account for +0.0 == -0.0.

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

14 years agoAdd TargetInstrInfo::copyPhysReg hook and use it from LowerSubregs.
Jakob Stoklund Olesen [Thu, 8 Jul 2010 05:01:41 +0000 (05:01 +0000)]
Add TargetInstrInfo::copyPhysReg hook and use it from LowerSubregs.

This target hook is intended to replace copyRegToReg entirely, but for now it
calls copyRegToReg.

Any remaining calls to copyRegToReg wil be replaced by COPY instructions.

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

14 years agoOptimize some vfp comparisons to integer ones. This patch implements the simplest...
Evan Cheng [Thu, 8 Jul 2010 02:08:50 +0000 (02:08 +0000)]
Optimize some vfp comparisons to integer ones. This patch implements the simplest case when the following conditions are met:
1. The arguments are f32.
2. The arguments are loads and they have no uses other than the comparison.
3. The comparison code is EQ or NE.

e.g.
        vldr.32 s0, [r1]
        vldr.32 s1, [r0]
        vcmpe.f32       s1, s0
        vmrs    apsr_nzcv, fpscr
beq     LBB0_2
=>
        ldr     r1, [r1]
        ldr     r0, [r0]
        cmp     r0, r1
        beq     LBB0_2

More complicated cases will be implemented in subsequent patches.

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

14 years agoChanges to ARM tail calls, mostly cosmetic.
Dale Johannesen [Thu, 8 Jul 2010 01:18:23 +0000 (01:18 +0000)]
Changes to ARM tail calls, mostly cosmetic.
Add explicit testcases for tail calls within the same module.
Duplicate some code to humor those who think .w doesn't apply on ARM.
Leave this disabled on Thumb1, and add some comments explaining why it's hard
and won't gain much.

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

14 years agoRevert 107840 107839 107813 107804 107800 107797 107791.
Dan Gohman [Thu, 8 Jul 2010 01:00:56 +0000 (01:00 +0000)]
Revert 107840 107839 107813 107804 107800 107797 107791.
Debug info intrinsics win for now.

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

14 years agoWhen processing frame index virtual registers, consider all available registers
Jim Grosbach [Thu, 8 Jul 2010 00:38:54 +0000 (00:38 +0000)]
When processing frame index virtual registers, consider all available registers
(if there are any) and use the one which remains available for the longest
rather than just using the first one. This should help enable better re-use
of the loaded frame index values. rdar://7318760

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

14 years agoFix the second half of PR7437: scalarrepl wasn't preserving
Chris Lattner [Thu, 8 Jul 2010 00:27:05 +0000 (00:27 +0000)]
Fix the second half of PR7437: scalarrepl wasn't preserving
address spaces when SRoA'ing memcpy's.

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

14 years agoDon't forward-declare registers for static allocas, which we'll
Dan Gohman [Wed, 7 Jul 2010 23:52:58 +0000 (23:52 +0000)]
Don't forward-declare registers for static allocas, which we'll
prefer to materialize as local constants. This fixes the clang
bootstrap abort.

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

14 years agoFix -fast-isel-abort to check the right instruction.
Dan Gohman [Wed, 7 Jul 2010 23:47:25 +0000 (23:47 +0000)]
Fix -fast-isel-abort to check the right instruction.

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

14 years agouse PrintEscapedString to handle attribute section with escapes in it,
Chris Lattner [Wed, 7 Jul 2010 23:16:37 +0000 (23:16 +0000)]
use PrintEscapedString to handle attribute section with escapes in it,
PR7399.  The asm parser already handles this.  This is of dubious
utility (see the PR) but the asmprinter was clearly broken here.

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