Commit Graph

9619 Commits

Author SHA1 Message Date
Bob Wilson
49c283fd3f Revert all my SSAUpdater patches. The PHI placement algorithm is not correct
(what was I thinking?) and there's also a problem with LCSSA.  I'll try again
later with fixes.

--- Reverse-merging r100263 into '.':
U    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100177 into '.':
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100148 into '.':
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100147 into '.':
U    include/llvm/Transforms/Utils/SSAUpdater.h
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100131 into '.':
G    include/llvm/Transforms/Utils/SSAUpdater.h
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100130 into '.':
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100126 into '.':
G    include/llvm/Transforms/Utils/SSAUpdater.h
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100050 into '.':
D    test/Transforms/GVN/2010-03-31-RedundantPHIs.ll
--- Reverse-merging r100047 into '.':
G    include/llvm/Transforms/Utils/SSAUpdater.h
G    lib/Transforms/Utils/SSAUpdater.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100264 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 03:50:38 +00:00
Johnny Chen
b68a3ee82a Second try of initial ARM/Thumb disassembler check-in. It consists of a tablgen
backend (ARMDecoderEmitter) which emits the decoder functions for ARM and Thumb,
and the disassembler core which invokes the decoder function and builds up the
MCInst based on the decoded Opcode.

Reviewed by Chris Latter and Bob Wilson.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100233 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 22:27:38 +00:00
Evan Cheng
f28f8bc40e Correctly lower memset / memcpy of undef. It should be a nop. PR6767.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100208 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 19:36:14 +00:00
Mon P Wang
e754d3fb85 Revert r100191 since it breaks objc in clang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 18:43:02 +00:00
Mon P Wang
e33c848fa4 Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 18:04:15 +00:00
Dan Gohman
d7bfd0028b Manually notify ScalarEvolution before making an operand replacement, since
it can't currently observe such changes automatically.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 14:48:31 +00:00
Dan Gohman
f860db2398 Revert the recent alignment changes. They're broken for -Os because,
in particular, they end up aligning strings at 16-byte boundaries, and
there's no way for GlobalOpt to check OptForSize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100172 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 03:04:37 +00:00
Evan Cheng
db8771af28 After trivial coalescing, the MI being visited may have become a copy. Avoid adding it to CSE hash table since copies aren't being considered for CSE and they may be deleted.
rdar://7819990


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 02:21:24 +00:00
Dan Gohman
1e4ac4dfd9 Remove this initializer so that the optimizer doesn't convert
unaligned loads into aligned loads.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100166 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 01:26:13 +00:00
Dan Gohman
403d5a2c49 Update this test for the new preferred alignment heuristics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 01:24:08 +00:00
Dan Gohman
c9ae19e465 Make globalopt refine global variable alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 00:14:16 +00:00
Evan Cheng
3ea97550e3 In 64-bit mode, use i64 to lower memcpy / memset instead of f64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100137 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 20:27:45 +00:00
Evan Cheng
94107ba9ce - Avoid using floating point stores to implement memset unless the value is zero.
- Do not try to infer GV alignment unless its type is sized. It's not possible to infer alignment if it has opaque type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100118 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 18:19:11 +00:00
Evan Cheng
0bf77de91f Add -mcpu to memcpy / memset tests to ensure they behave the same on all hosts / targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100101 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 08:25:26 +00:00
Evan Cheng
255f20f7f7 Fix sdisel memcpy, memset, memmove lowering:
1. Makes it possible to lower with floating point loads and stores.
2. Avoid unaligned loads / stores unless it's fast.
3. Fix some memcpy lowering logic bug related to when to optimize a
   load from constant string into a constant.
4. Adjust x86 memcpy lowering threshold to make it more sane.
5. Fix x86 target hook so it uses vector and floating point memory
   ops more effectively.
rdar://7774704


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 06:04:33 +00:00
Chris Lattner
e6bb172f7e change this from using '!dbg' to using '!dbgx'. The
MD used here isn't valid for !dbg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 05:13:10 +00:00
Bob Wilson
368454976c Add a redundant PHI testcase for SSAUpdater to go with svn r100047.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100050 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 21:38:43 +00:00
Gabor Greif
4e86da71b3 testcase for r99914, provided by baldrick!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 20:37:13 +00:00
Jakob Stoklund Olesen
d363b4ebc7 Replace V_SET0 with variants for each SSE execution domain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 00:40:13 +00:00
Jakob Stoklund Olesen
b16df90b48 Fix typo. Thank you, valgrind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99974 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 00:40:08 +00:00
Jakob Stoklund Olesen
932df5e9f6 Not all platforms start symbols with _
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 23:12:48 +00:00
Jakob Stoklund Olesen
bfcd61b907 Enable -sse-domain-fix by default. Now with tests!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99954 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 22:47:00 +00:00
Bob Wilson
100f090add Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 22:27:04 +00:00
Devang Patel
722f2290b8 Ignore invalid metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99938 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 22:09:52 +00:00
Mon P Wang
808bab0169 Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
A update of langref will occur in a subsequent checkin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 20:55:56 +00:00
Eric Christopher
8258d0b4bf Remove the pmulld intrinsic and autoupdate it as a vector multiply.
Rewrite the pmulld patterns, and make sure that they fold in loads of
arguments into the instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99910 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 18:49:01 +00:00
Benjamin Kramer
32e6518de3 XFAIL some PIC16 tests when running under valgrind-leaks. I don't expect these
to be fixed any time soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 14:34:13 +00:00
Daniel Dunbar
1de558b71f MC/Mach-O/x86_64: Support @GOTPCREL on symbols, even for non-PCrel relocations!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99853 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 23:56:40 +00:00
Evan Cheng
8e36a5c960 Fix PR4975. Avoid referencing empty vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 21:27:30 +00:00
Chris Lattner
e27e02b1a4 From Kalle Raiskila:
"the bigstack patch for SPU, with testcase. It is essentially the patch committed as 97091, and reverted as 97099, but with the following additions:
-in vararg handling, registers are marked to be live, to not confuse the register scavenger
-function prologue and epilogue are not emitted, if the stack size is 16. 16 means it is empty - there is only the register scavenger emergency spill slot, which is not used as there is no stack."



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 17:38:47 +00:00
Chris Lattner
d7ba0f2ade add support for zero initialized unions, patch by Tim Northover!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 17:36:02 +00:00
Chris Lattner
7a0eb91b4c teach tblgen to allow patterns like (add (i32 (bitconvert (i32 GPR))), 4),
transforming it into (add (i32 GPR), 4).  This allows us to write type
generic multi patterns and have tblgen automatically drop the bitconvert
in the case when the types align.  This allows us to fold an extra load
in the changed testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99756 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 08:38:32 +00:00
Chris Lattner
ba47ce1244 add some nounwinds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 07:58:37 +00:00
Chris Lattner
cf3fed0fd4 this takes an insane amount of time to run, disable it for now (PR6727)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99751 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 07:58:09 +00:00
Jeffrey Yasskin
b3a1f928d8 XFAIL a new tblgen test for memory leak checking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99707 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-27 04:59:47 +00:00
Evan Cheng
2c12cb47d9 Do not sibcall if stack needs to be dynamically aligned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99620 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 16:26:03 +00:00
Evan Cheng
3c262eec53 Allow trivial sibcall of vararg callee when no arguments are being passed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99598 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 02:13:13 +00:00
Evan Cheng
9f68948609 Try trivial remat before the coalescer gives up on a vr / physreg coalescing for fear of tying up a physical register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 00:07:25 +00:00
Jim Grosbach
7ec7a0e96b switch the flag for using NEON for SP floating point to a subtarget 'feature'.
Re-commit. This time complete with testsuite updates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 23:47:34 +00:00
Evan Cheng
0ea15ecfda Add nounwind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99546 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 20:01:07 +00:00
Bob Wilson
86afec7730 Reapply Kevin's change 94440, now that Chris has fixed the limitation on
opcode values fitting in one byte (svn r99494).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99514 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 16:36:14 +00:00
Jakob Stoklund Olesen
d1baa252c4 Fix evil TableGen bug in template parameters with defaults.
If a TableGen class has an initializer expression containing an X.Y subexpression,
AND X depends on template parameters,
AND those template parameters have defaults,
AND some parameters with defaults are beyond position 1,
THEN parts of the initializer expression are evaluated prematurely with the default values when the first explicit template parameter is substituted, before the remaining explicit template parameters have been substituted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 06:23:34 +00:00
Chris Lattner
219d77430b fix PR6642, GVN forwarding from memset to load of the base of the memset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99488 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 05:58:19 +00:00
Chris Lattner
47cdf4abff Make the NDEBUG assertion stronger and more clear what is
happening.

Enhance scheduling to set the DEAD flag on implicit defs
more aggressively.  Before, we'd set an implicit def operand
to dead if it were present in the SDNode corresponding to
the machineinstr but had no use.  Now we do it in this case
AND if the implicit def does not exist in the SDNode at all.

This exposes a couple of problems: one is the FIXME, which
causes a live intervals crash on CodeGen/X86/sibcall.ll.
The second is that it makes machinecse and licm more 
aggressive (which is a good thing) but also exposes a case
where licm hoists a set0 and then it doesn't get resunk.

Talking to codegen folks about both these issues, but I need
this patch in in the meantime.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99485 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 05:40:48 +00:00
Eric Christopher
f27e6088a3 Reapply r99451 with a fix to move the NoInline check to the cost functions
instead of InlineFunction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99483 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 04:49:10 +00:00
Eric Christopher
4750cb9da9 Make sure this runs in 64-bit only, 32-bit won't produce the correct stores.
Fariborz please review and make sure this is what you meant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 01:46:07 +00:00
Daniel Dunbar
e9cfd685f5 MC: Fix refacto in MCExpr evaluation, I mistakenly replaced a fragment address with a symbol address.
- This fixes the integrated-as nightly test regressions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99466 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 01:03:17 +00:00
Eric Christopher
0623e90398 Temporarily revert this, it's causing an issue with an internal project.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99451 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 23:35:21 +00:00
Bob Wilson
014dc4e720 Speculatively revert this to see if it fixes buildbot failures.
--- Reverse-merging r99440 into '.':
U    test/MC/AsmParser/X86/x86_32-bit_cat.s
U    test/MC/AsmParser/X86/x86_32-encoding.s
U    include/llvm/IntrinsicsX86.td
U    include/llvm/CodeGen/SelectionDAGNodes.h
U    lib/Target/X86/X86InstrSSE.td
U    lib/Target/X86/X86ISelLowering.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99450 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 23:26:29 +00:00
Kevin Enderby
760c2f34d9 Added the Advanced Encryption Standard (AES) Instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99440 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 22:33:33 +00:00
Kevin Enderby
044be39090 Fixed the SS42AI template for the SSE 4.2 instructions with TA prefix so it does
not get an "Unknown immediate size" assert failure when used.  All instructions 
of this form have an 8-bit immediate.  Also added a test case of an example
instruction that is of this form.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99435 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 22:28:42 +00:00
Nate Begeman
fdea31a463 BUILD_VECTOR was missing out on some prime opportunities to use SSE 4.1 inserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99423 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 20:49:50 +00:00
Bob Wilson
d6a6b3b756 Revert Edwin's change that is breaking MultiSource/Applications/ClamAV/clamscan.
--- Reverse-merging r99400 into '.':
D    test/CodeGen/Generic/2010-03-24-liveintervalleak.ll
U    lib/CodeGen/LiveIntervalAnalysis.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99419 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 20:25:25 +00:00
Devang Patel
8fe7979c41 Do not rely on getCompileUnit() to find source file information for a subprogram.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99410 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 18:48:00 +00:00
Torok Edwin
15417383b9 Fix memory leak in liveintervals: the destructor for VNInfos must be called,
otherwise the SmallVector it contains doesn't free its memory.
In most cases LiveIntervalAnalysis could get away by not calling the destructor,
because VNInfos are bumpptr-allocated, and smallvectors usually don't grow.
However when the SmallVector does grow it always leaks.

This is the valgrind shown leak from the original testcase:
==8206== 18,304 bytes in 151 blocks are definitely lost in loss record 164 of 164
==8206==    at 0x4A079C7: operator new(unsigned long) (vg_replace_malloc.c:220)
==8206==    by 0x4DB7A7E: llvm::SmallVectorBase::grow_pod(unsigned long, unsigned long) (in /home/edwin/clam/git/builds/defaul
t/libclamav/.libs/libclamav.so.6.1.0)
==8206==    by 0x4F90382: llvm::VNInfo::addKill(llvm::SlotIndex) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libcl
amav.so.6.1.0)
==8206==    by 0x5126B5C: llvm::LiveIntervals::handleVirtualRegisterDef(llvm::MachineBasicBlock*, llvm::ilist_iterator<llvm::M
achineInstr>, llvm::SlotIndex, llvm::MachineOperand&, unsigned int, llvm::LiveInterval&) (in /home/edwin/clam/git/builds/defau
lt/libclamav/.libs/libclamav.so.6.1.0)
==8206==    by 0x512725E: llvm::LiveIntervals::handleRegisterDef(llvm::MachineBasicBlock*, llvm::ilist_iterator<llvm::MachineI
nstr>, llvm::SlotIndex, llvm::MachineOperand&, unsigned int) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libclamav
.so.6.1.0)
==8206==    by 0x51278A8: llvm::LiveIntervals::computeIntervals() (in /home/edwin/clam/git/builds/default/libclamav/.libs/libc
lamav.so.6.1.0)
==8206==    by 0x5127CB4: llvm::LiveIntervals::runOnMachineFunction(llvm::MachineFunction&) (in /home/edwin/clam/git/builds/de
fault/libclamav/.libs/libclamav.so.6.1.0)
==8206==    by 0x4DAE935: llvm::FPPassManager::runOnFunction(llvm::Function&) (in /home/edwin/clam/git/builds/default/libclama
v/.libs/libclamav.so.6.1.0)
==8206==    by 0x4DAEB10: llvm::FunctionPassManagerImpl::run(llvm::Function&) (in /home/edwin/clam/git/builds/default/libclama
v/.libs/libclamav.so.6.1.0)
==8206==    by 0x4DAED3D: llvm::FunctionPassManager::run(llvm::Function&) (in /home/edwin/clam/git/builds/default/libclamav/.l
ibs/libclamav.so.6.1.0)
==8206==    by 0x4D8BE8E: llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard const&) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libclamav.so.6.1.0)
==8206==    by 0x4D8CA72: llvm::JIT::getPointerToFunction(llvm::Function*) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libclamav.so.6.1.0)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99400 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 13:50:36 +00:00
Chris Lattner
a54934ae9d add some accessors to callsite/callinst/invokeinst to check
for the noinline attribute, and make the inliner refuse to
inline a call site when the call site is marked noinline even
if the callee isn't.  This fixes PR6682.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99341 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 22:59:07 +00:00
Stuart Hastings
b2dc2df7d2 Test case for llvm-gcc r99305. Radar 7659636.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99306 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 18:39:23 +00:00
Evan Cheng
0289b419a4 Teach simplify libcall to transform __strcpy_chk to __memcpy_chk to enable optimizations down stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99282 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 15:48:04 +00:00
Evan Cheng
9d8f002d8f Fix an incorrect logic causing instcombine to miss some _chk -> non-chk transformations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99263 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 06:06:09 +00:00
Chris Lattner
ea16ea5901 Fix PR6673: updating the callback should not clear the map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 23:15:57 +00:00
Devang Patel
4a602caf2e Emit DW_AT_low_pc and DW_AT_high_pc attributes for TAG_compile_unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99225 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 23:11:36 +00:00
Jeffrey Yasskin
f65b0e9b45 XFAIL tests from LLVMC on valgrind or valgrind+leak-checking. We
don't care about leaks from tblgen, and I assume we don't care about
valgrind errors in llvm-gcc/g++.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99115 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-21 08:12:46 +00:00
Jeffrey Yasskin
32989deb96 Add support for XFAILing valgrind runs with memory leak checking independently
of runs without leak checking.  We add -vg to the triple for non-checked runs,
or -vg_leak for checked runs.  Also use this to XFAIL the TableGen tests, since
tablegen leaks like a sieve.  This includes some valgrindArgs refactoring.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 23:08:45 +00:00
Daniel Dunbar
78fcf53a18 MC/Mach-O: Remove Darwin host specific tests, we don't need them anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 22:36:32 +00:00
Daniel Dunbar
57a49a202f MC/Mach-O: Tweak optimal_nop test to be host independent.
- This also avoids us running valgrind on /usr/bin/as, which has leaks. :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99099 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 22:36:29 +00:00
Bob Wilson
c88d072293 pr6652: Use LDM to restore PC to the return address on ARMv4.
Patch by John Tytgat!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99096 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 22:20:40 +00:00
Daniel Dunbar
a56a810be4 tests: Mangle '-vg' onto the end of the triple when running under valgrind, so
we can use the standard XFAIL and XTARGET to conditional tests based on
valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99088 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 21:12:48 +00:00
Evan Cheng
1ad584e93d Stupid svn. Add back to the lost sibcall tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99033 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-20 03:17:05 +00:00
Devang Patel
608f5a6d48 call void @llvm.dbg.declare(metadata !{i32* null}, metadata !1)
is valid, but not useful, when variable  identified by !1 is optimized away by the optimizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 21:06:24 +00:00
Kevin Enderby
b46b03b36f Fixed the encoding problems of the crc32 instructions. All had the Operand size
override prefix and only the r/m16 forms should have had that.  Also for variant
one, the AT&T syntax, added suffixes to all forms.  Also added the missing
64-bit form for 'CRC32 r64, r/m8'.  Plus added test cases for all forms and
tweaked one test case to add the needed suffixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 20:04:42 +00:00
Daniel Dunbar
602b40f0d0 MC/Mach-O/x86_64: Add relocation support.
- This is "extraordinarily" Darwin 'as' compatible. See the litany of FIXMEs littered about for more information.
 - There are a few cases which seem to clearly be 'as' bugs which I have left unsupported, and there is one cases where we diverge but should fix if it blocks diffing .o files (Darwin 'as' ends up widening a jump unnecessarily).
 - 403.gcc build, runs, and diffs equivalently to the 'as' built version now (using llvm-mc). However, it builds so slowly that I wouldn't recommend trying it quite yet. :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98974 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 18:07:55 +00:00
Daniel Dunbar
0180daee02 MC/X86: Rename alternate spellings of {ADD64,CMP64} and mark as "code gen only" so they don't get selected by the asm matcher.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98972 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 18:07:48 +00:00
Daniel Dunbar
939f8d7ca2 MC/Mach-O: Factor out isScatteredFixupFullyResolvedSimple predicate, and fix some corner cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98924 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 03:18:12 +00:00
Mon P Wang
c1e5d491a0 Fixed a widening bug where we were not using the correct size for the load
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 01:19:52 +00:00
Daniel Dunbar
c28c7689fc X86: Fix encoding for TEST64rr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 01:15:03 +00:00
Jeffrey Yasskin
765028f97b Remove ignore from LLVMC/TestWarnings.td. This avoids
https://bugs.kde.org/show_bug.cgi?id=231257 and seems not to have been
needed in the first place.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98917 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 01:10:41 +00:00
Jeffrey Yasskin
0392080fbf Revert r98892. BSD systems may not have bash installed at all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-19 00:32:11 +00:00
Jeffrey Yasskin
1ff781fb50 Work around a valgrind oddity where it doesn't pass the full path of a
script to the #! command by using bash instead of /bin/sh.  Bash
searches $PATH for its script argument, but dash, which /bin/sh
resolves to on some systems, does not.
https://bugs.kde.org/show_bug.cgi?id=231257 tracks the valgrind
problem.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98892 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 22:56:02 +00:00
Daniel Dunbar
9fdac902d4 X86MCCodeEmitter: Fix two minor issues with reloc_riprel_4byte_movq_load, we
were missing it on some movq instructions and were not including the appropriate
PCrel bias.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98880 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 21:53:54 +00:00
Daniel Dunbar
f98bc6320b MC/X86/AsmMatcher: Use the new instruction cleanup routine to implement a
temporary workaround for matching inc/dec on x86_64 to the correct instruction.
 - This hack will eventually be replaced with a robust mechanism for handling
   matching instructions based on the available target features.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 20:06:02 +00:00
Chris Lattner
618d0ed4bc fix an x86-64 encoding bug Daniel found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98855 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 20:04:36 +00:00
Chris Lattner
0f53cf2236 add a special relocation type for movq loads for object
files that produce special relocation types where the 
linker changes movq's into lea's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98839 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 18:10:56 +00:00
Evan Cheng
bdc652bab8 Turning off post-ra scheduling for x86. It isn't a consistent win.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98810 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-18 06:55:42 +00:00
Evan Cheng
f3caa525cc X86 address mode matching code MatchAddressRecursively does some aggressive hack which require doing a RAUW. It may end up deleting some SDNode up stream. It should avoid referencing deleted nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98780 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 23:58:35 +00:00
Johnny Chen
9e08876a2a Added sub-formats to the NeonI/NeonXI instructions to further refine the NEONFrm
instructions to help disassembly.

We also changed the output of the addressing modes to omit the '+' from the
assembler syntax #+/-<imm> or +/-<Rm>.  See, for example, A8.6.57/58/60.

And modified test cases to not expect '+' in +reg or #+num.  For example,

; CHECK:       ldr.w	r9, [r7, #28]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98745 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 17:52:21 +00:00
Stuart Hastings
b0a72ec2eb Testcase for r98728.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98744 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 17:51:08 +00:00
Evan Cheng
4507f089d4 Fix liveintervals handling of dbg_value instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 21:51:27 +00:00
Daniel Dunbar
ab7f10705a Revert r98666 too; it's checkin-without-testing day!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98673 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 20:52:59 +00:00
Chris Lattner
7df6ecf767 temporarily xfail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 20:08:07 +00:00
Dan Gohman
eb2693ebc0 Add an rdar number to this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98654 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 19:08:20 +00:00
Duncan Sands
c221bc7344 Chris pointed out that producing undef here is wrong in
general.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 18:50:54 +00:00
Bob Wilson
49d9dc4dd2 --- Reverse-merging r98637 into '.':
U    test/CodeGen/ARM/tls2.ll
U    test/CodeGen/ARM/arm-negative-stride.ll
U    test/CodeGen/ARM/2009-10-30.ll
U    test/CodeGen/ARM/globals.ll
U    test/CodeGen/ARM/str_pre-2.ll
U    test/CodeGen/ARM/ldrd.ll
U    test/CodeGen/ARM/2009-10-27-double-align.ll
U    test/CodeGen/Thumb2/thumb2-strb.ll
U    test/CodeGen/Thumb2/ldr-str-imm12.ll
U    test/CodeGen/Thumb2/thumb2-strh.ll
U    test/CodeGen/Thumb2/thumb2-ldr.ll
U    test/CodeGen/Thumb2/thumb2-str_pre.ll
U    test/CodeGen/Thumb2/thumb2-str.ll
U    test/CodeGen/Thumb2/thumb2-ldrh.ll
U    utils/TableGen/TableGen.cpp
U    utils/TableGen/DisassemblerEmitter.cpp
D    utils/TableGen/RISCDisassemblerEmitter.h
D    utils/TableGen/RISCDisassemblerEmitter.cpp
U    Makefile.rules
U    lib/Target/ARM/ARMInstrNEON.td
U    lib/Target/ARM/Makefile
U    lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
U    lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
U    lib/Target/ARM/AsmPrinter/ARMInstPrinter.h
D    lib/Target/ARM/Disassembler
U    lib/Target/ARM/ARMInstrFormats.td
U    lib/Target/ARM/ARMAddressingModes.h
U    lib/Target/ARM/Thumb2ITBlockPass.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 16:59:47 +00:00
Johnny Chen
d30a98e43a Initial ARM/Thumb disassembler check-in. It consists of a tablgen backend
(RISCDisassemblerEmitter) which emits the decoder functions for ARM and Thumb,
and the disassembler core which invokes the decoder function and builds up the
MCInst based on the decoded Opcode.

Added sub-formats to the NeonI/NeonXI instructions to further refine the NEONFrm
instructions to help disassembly.

We also changed the output of the addressing modes to omit the '+' from the
assembler syntax #+/-<imm> or +/-<Rm>.  See, for example, A8.6.57/58/60.

And modified test cases to not expect '+' in +reg or #+num.  For example,

; CHECK:       ldr.w	r9, [r7, #28]


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 16:36:54 +00:00
Bob Wilson
ea7f22c31d Stop using the old pre-UAL syntax for LDM/STM instruction suffixes.
This does not move entirely to UAL syntax, since the default "increment after"
suffix is empty but we still use "IA" for that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98635 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 16:19:07 +00:00
Duncan Sands
984751e5a7 Check that P is not zero initialized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98627 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 11:36:35 +00:00
Bob Wilson
7cfb6d373a Add a testcase for the change in r98586.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98610 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 05:33:29 +00:00
Bill Wendling
827f778338 Forgot testcase for r98599.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98602 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 01:54:20 +00:00
Chris Lattner
999aee24c7 Fix the third (and last known) case of code update problems due
to LLVM IR changes with addr label weirdness.  In the testcase, we
generate references to the two bb's when codegen'ing the first
function:

_test1:                                 ## @test1
	leaq	Ltmp0(%rip), %rax
..
	leaq	Ltmp1(%rip), %rax

Then continue to codegen the second function where the blocks
get merged.  We're now smart enough to emit both labels, producing
this code:

_test_fun:                              ## @test_fun
## BB#0:                                ## %entry
Ltmp1:                                  ## Block address taken
Ltmp0:
## BB#1:                                ## %ret
	movl	$-1, %eax
	ret

Rejoice.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-16 00:29:39 +00:00
Daniel Dunbar
4e815f8a8c MC: Allow modifiers in MCSymbolRefExpr, and eliminate X86MCTargetExpr.
- Although it would be nice to allow this decoupling, the assembler needs to be able to reason about MCSymbolRefExprs in too many places to make this viable. We can use a target specific encoding of the variant if this becomes an issue.
 - This patch also extends llvm-mc to support parsing of the modifiers, as opposed to lumping them in with the symbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 23:51:06 +00:00
Dan Gohman
1bbf72b069 Recognize code for doing vector gather/scatter index calculations with
32-bit indices. Instead of shuffling each element out of the index vector,
when all indices are needed, just store the input vector to the stack and
load the elements out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98588 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-15 23:23:03 +00:00