Commit Graph

74634 Commits

Author SHA1 Message Date
Dan Gohman b256ccfbe5 Preserve NSW information in more places.
llvm-svn: 91656
2009-12-18 02:09:29 +00:00
Evan Cheng 3dfd04e2b7 Re-apply 91623 now that I actually know what I was trying to do.
llvm-svn: 91655
2009-12-18 01:59:21 +00:00
Dan Gohman 18fa5686f6 Add Loop contains utility methods for testing whether a loop
contains another loop, or an instruction. The loop form is
substantially more efficient on large loops than the typical
code it replaces.

llvm-svn: 91654
2009-12-18 01:24:09 +00:00
Dan Gohman fd7231f1fe Minor code simplification.
llvm-svn: 91653
2009-12-18 01:20:44 +00:00
Fariborz Jahanian 6ab7ed40c7 Implemented rewriting of invocation of a block ivar.
(radar 7482224).
 

llvm-svn: 91652
2009-12-18 01:15:21 +00:00
Dan Gohman cb0efecd33 Whitespace cleanups.
llvm-svn: 91651
2009-12-18 01:14:11 +00:00
Dan Gohman 51fbfb726f Tidy up this testcase and add test for tailcall optimization
with unreachable.

llvm-svn: 91650
2009-12-18 01:05:06 +00:00
Bob Wilson 3152b0471b Handle ARM inline asm "w" constraints with 64-bit ("d") registers.
The change in SelectionDAGBuilder is needed to allow using bitcasts to convert
between f64 (the default type for ARM "d" registers) and 64-bit Neon vector
types.  Radar 7457110.

llvm-svn: 91649
2009-12-18 01:03:29 +00:00
Dan Gohman 7f4326f8b6 Remove "tail" keywords. These calls are not intended to be tail calls.
This protects this test from depending on codegen not performing the
tail call optimization by default.

llvm-svn: 91648
2009-12-18 01:02:18 +00:00
Dan Gohman b1924e8a0f Don't pass const pointers by reference.
llvm-svn: 91647
2009-12-18 00:38:08 +00:00
Dan Gohman 1af1954852 Update a comment.
llvm-svn: 91645
2009-12-18 00:28:43 +00:00
John McCall eabfd8b155 Pass the error string directly to llvm_unreachable instead of the residual
(0 && "error").  Rough consensus seems to be that g++ *should* be diagnosing
this because the pointer makes it not an ICE in c++03.  Everyone agrees that
the current standard is silly and null-pointer-ness should not be based on
ICE-ness.  Excellent fight scene in Act II, denouement weak, two stars.

llvm-svn: 91644
2009-12-18 00:27:18 +00:00
Eli Friedman fa7f519ce4 Temporarily XFAIL this test.
llvm-svn: 91643
2009-12-18 00:23:19 +00:00
Jakob Stoklund Olesen 78c5919b14 Add test case for the phi reuse patch.
llvm-svn: 91642
2009-12-18 00:11:44 +00:00
Dan Gohman 92c3696524 Reapply LoopStrengthReduce and IVUsers cleanups, excluding the part
of 91296 that caused trouble -- the Processed list needs to be
preserved for the livetime of the pass, as AddUsersIfInteresting
is called from other passes.

llvm-svn: 91641
2009-12-18 00:06:20 +00:00
Sean Callanan 12ca3f46d8 Testcase fixes to reflect instruction table changes in the LLVM backend
(http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091214/092780.html)
The instruction fixes were checked and approved by Chris Lattner, but
these testcase fixes are mine; please yell at me if there are any
problems with either.

* PR5050-constructor-conversion.cpp
* array-construction.cpp
* constructor-conversion.cpp
* cast-conversion.cpp
* constructor-default-arg.cpp
* derived-to-base-conv.cpp
* ptr-to-member-function.cpp
* call-arg-zero-temp.cpp
* default-destructor-synthesis.cpp
* global-array-destruction.cpp
* array-operator-delete-call.cpp
* decl-ref-init.cpp
* default-constructor-for-members.cpp
* convert-to-fptr.cpp
* constructor-for-array-members.cpp
* conversion-function.cpp
* objc-read-weak-byref.m
	Fixed testcase to reflect call qualifier

llvm-svn: 91640
2009-12-18 00:04:09 +00:00
Dan Gohman dcdd3a5477 Add an svn:ignore.
llvm-svn: 91639
2009-12-18 00:03:58 +00:00
Sean Callanan 04d8cb74f3 Instruction fixes, added instructions, and AsmString changes in the
X86 instruction tables.

Also (while I was at it) cleaned up the X86 tables, removing tabs and
80-line violations.

This patch was reviewed by Chris Lattner, but please let me know if
there are any problems.

* X86*.td
	Removed tabs and fixed 80-line violations

* X86Instr64bit.td
	(IRET, POPCNT, BT_, LSL, SWPGS, PUSH_S, POP_S, L_S, SMSW)
		Added
	(CALL, CMOV) Added qualifiers
	(JMP) Added PC-relative jump instruction
	(POPFQ/PUSHFQ) Added qualifiers; renamed PUSHFQ to indicate
		that it is 64-bit only (ambiguous since it has no
		REX prefix)
	(MOV) Added rr form going the other way, which is encoded
		differently
	(MOV) Changed immediates to offsets, which is more correct;
		also fixed MOV64o64a to have to a 64-bit offset
	(MOV) Fixed qualifiers
	(MOV) Added debug-register and condition-register moves
	(MOVZX) Added more forms
	(ADC, SUB, SBB, AND, OR, XOR) Added reverse forms, which
		(as with MOV) are encoded differently
	(ROL) Made REX.W required
	(BT) Uncommented mr form for disassembly only
	(CVT__2__) Added several missing non-intrinsic forms
	(LXADD, XCHG) Reordered operands to make more sense for
		MRMSrcMem
	(XCHG) Added register-to-register forms
	(XADD, CMPXCHG, XCHG) Added non-locked forms
* X86InstrSSE.td
	(CVTSS2SI, COMISS, CVTTPS2DQ, CVTPS2PD, CVTPD2PS, MOVQ)
		Added
* X86InstrFPStack.td
	(COM_FST0, COMP_FST0, COM_FI, COM_FIP, FFREE, FNCLEX, FNOP,
	 FXAM, FLDL2T, FLDL2E, FLDPI, FLDLG2, FLDLN2, F2XM1, FYL2X,
	 FPTAN, FPATAN, FXTRACT, FPREM1, FDECSTP, FINCSTP, FPREM,
	 FYL2XP1, FSINCOS, FRNDINT, FSCALE, FCOMPP, FXSAVE,
	 FXRSTOR)
		Added
	(FCOM, FCOMP) Added qualifiers
	(FSTENV, FSAVE, FSTSW) Fixed opcode names
	(FNSTSW) Added implicit register operand
* X86InstrInfo.td
	(opaque512mem) Added for FXSAVE/FXRSTOR
	(offset8, offset16, offset32, offset64) Added for MOV
	(NOOPW, IRET, POPCNT, IN, BTC, BTR, BTS, LSL, INVLPG, STR,
	 LTR, PUSHFS, PUSHGS, POPFS, POPGS, LDS, LSS, LES, LFS,
	 LGS, VERR, VERW, SGDT, SIDT, SLDT, LGDT, LIDT, LLDT,
	 LODSD, OUTSB, OUTSW, OUTSD, HLT, RSM, FNINIT, CLC, STC,
	 CLI, STI, CLD, STD, CMC, CLTS, XLAT, WRMSR, RDMSR, RDPMC,
	 SMSW, LMSW, CPUID, INVD, WBINVD, INVEPT, INVVPID, VMCALL,
	 VMCLEAR, VMLAUNCH, VMRESUME, VMPTRLD, VMPTRST, VMREAD,
	 VMWRITE, VMXOFF, VMXON) Added
	(NOOPL, POPF, POPFD, PUSHF, PUSHFD) Added qualifier
	(JO, JNO, JB, JAE, JE, JNE, JBE, JA, JS, JNS, JP, JNP, JL,
	 JGE, JLE, JG, JCXZ) Added 32-bit forms
	(MOV) Changed some immediate forms to offset forms
	(MOV) Added reversed reg-reg forms, which are encoded
		differently
	(MOV) Added debug-register and condition-register moves
	(CMOV) Added qualifiers
	(AND, OR, XOR, ADC, SUB, SBB) Added reverse forms, like MOV
	(BT) Uncommented memory-register forms for disassembler
	(MOVSX, MOVZX) Added forms
	(XCHG, LXADD) Made operand order make sense for MRMSrcMem
	(XCHG) Added register-register forms
	(XADD, CMPXCHG) Added unlocked forms
* X86InstrMMX.td
	(MMX_MOVD, MMV_MOVQ) Added forms
* X86InstrInfo.cpp: Changed PUSHFQ to PUSHFQ64 to reflect table
	change

* X86RegisterInfo.td: Added debug and condition register sets
* x86-64-pic-3.ll: Fixed testcase to reflect call qualifier
* peep-test-3.ll: Fixed testcase to reflect test qualifier
* cmov.ll: Fixed testcase to reflect cmov qualifier
* loop-blocks.ll: Fixed testcase to reflect call qualifier
* x86-64-pic-11.ll: Fixed testcase to reflect call qualifier
* 2009-11-04-SubregCoalescingBug.ll: Fixed testcase to reflect call
  qualifier
* x86-64-pic-2.ll: Fixed testcase to reflect call qualifier
* live-out-reg-info.ll: Fixed testcase to reflect test qualifier
* tail-opts.ll: Fixed testcase to reflect call qualifiers
* x86-64-pic-10.ll: Fixed testcase to reflect call qualifier
* bss-pagealigned.ll: Fixed testcase to reflect call qualifier
* x86-64-pic-1.ll: Fixed testcase to reflect call qualifier
* widen_load-1.ll: Fixed testcase to reflect call qualifier

llvm-svn: 91638
2009-12-18 00:01:26 +00:00
John McCall 753100cef3 Sundry dependent-name fixes flagged by clang++.
llvm-svn: 91636
2009-12-17 23:49:16 +00:00
Bill Wendling 3c13667d14 Revert accidental commit.
llvm-svn: 91635
2009-12-17 23:45:18 +00:00
Bill Wendling 819c356a09 Turn off critical edge splitting for landing pads. The introduction of a
non-landing pad basic block as the successor to a block that ends in an
unconditional jump will cause block folding to remove the added block as a
successor. Thus eventually removing it AND the landing pad entirely. Critical
edge splitting is an optimization, so we can safely turn it off when dealing
with landing pads.

llvm-svn: 91634
2009-12-17 23:42:32 +00:00
John McCall 90d3bb943e Patch over yet more problems with friend declarations which were provoking
problems on LLVM-Code-Syntax.  This proved remarkably easy to "fix" once
I settled on how I was going to approach it.

llvm-svn: 91633
2009-12-17 23:21:11 +00:00
Jeffrey Yasskin 0de0ce11d8 Revert r91623 to unbreak the buildbots.
llvm-svn: 91632
2009-12-17 22:44:34 +00:00
Eli Friedman 250b119d98 Allow instcombine to combine "sext(a) >u const" to "a >u trunc(const)".
llvm-svn: 91631
2009-12-17 22:42:29 +00:00
Nuno Lopes 050672ab84 reword the help text of fno_assume_sane_operator_new, following Chris suggestion
llvm-svn: 91630
2009-12-17 22:37:33 +00:00
Mike Stump 6dc04f4067 Revert r91073.
llvm-svn: 91629
2009-12-17 22:14:41 +00:00
Douglas Gregor 95a438b291 Add a couple more paths to the LLVM-Code-Syntax test
llvm-svn: 91627
2009-12-17 21:51:02 +00:00
Jeffrey Yasskin 2b73a4e90f Don't codegen available_externally functions. Fixes http://llvm.org/PR5735.
llvm-svn: 91626
2009-12-17 21:35:29 +00:00
Eli Friedman 7cc86b4cc6 Make the ptrtoint comparison simplification work if one side is a global.
llvm-svn: 91624
2009-12-17 21:27:47 +00:00
Evan Cheng e43b403c87 Remove an unused option.
llvm-svn: 91623
2009-12-17 21:23:58 +00:00
Chris Lattner cbc0804c71 tabs -> spaces.
llvm-svn: 91622
2009-12-17 21:23:46 +00:00
Eli Friedman 5842c9968a Slightly generalize transformation of memmove(a,a,n) so that it also applies
to memcpy. (Such a memcpy is technically illegal, but in practice is safe
and is generated by struct self-assignment in C code.)

llvm-svn: 91621
2009-12-17 21:07:31 +00:00
Jeffrey Yasskin 5908f1e27b Make Path use StringRef instead of std::string where possible.
llvm-svn: 91620
2009-12-17 21:02:39 +00:00
Bill Wendling 03b5aed7d8 Temporarily revert 91337. It's causing testcase failures.
$ svn merge -c -91337 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r91337 into '.':
U    lib/CodeGen/AsmPrinter/DwarfException.cpp

llvm-svn: 91618
2009-12-17 20:41:01 +00:00
Steve Naroff d3ab107432 Fix Windows build breakage...
llvm-svn: 91617
2009-12-17 20:39:34 +00:00
Ted Kremenek 48af0e0a71 Tweak formatting and comments.
llvm-svn: 91615
2009-12-17 20:10:17 +00:00
Ken Dyck df5561db78 Introduce EVT::getHalfSizedIntegerVT() for use in ExpandUnalignedStore() in
LegalizeDAG.cpp. Unlike the code it replaces, which simply decrements the simple
type by one, getHalfSizedIntegerVT() searches for the smallest simple integer
type that is at least half the size of the type it is called on. This approach
has the advantage that it will continue working if a new value type (such as
i24) is added to MVT.

Also, in preparation for new value types, remove the assertions that
non-power-of-2 8-bit-mutiple types are Extended when legalizing extload and
truncstore operations.

llvm-svn: 91614
2009-12-17 20:09:43 +00:00
Ted Kremenek 94cc33f33e Convert GRExprEngine::VisitCallExpr() to use a worklist instead of recursion to evaluate the arguments of a CallExpr. This simplifies the logic and makes it easier to read. (it also avoids any issues with blowing out the stack if the CallExpr had a ridiculous number of arguments)
llvm-svn: 91613
2009-12-17 20:06:29 +00:00
Chris Lattner 50272752fa finish cleaning up StructLayoutMap.
llvm-svn: 91612
2009-12-17 20:00:21 +00:00
Jeffrey Yasskin 28f244863e This fixes a memory leak in OpaqueType found by Google's internal heapchecker.
llvm-svn: 91611
2009-12-17 19:55:06 +00:00
Ted Kremenek da7d55a4a8 Reduce nesting by using early exits. No functionality change.
llvm-svn: 91610
2009-12-17 19:17:27 +00:00
Eric Christopher 2d1ffe028f Fix unused variable warning.
llvm-svn: 91609
2009-12-17 19:07:19 +00:00
Bob Wilson f3927b7994 Re-revert 91459. It's breaking the x86_64 darwin bootstrap.
llvm-svn: 91607
2009-12-17 18:34:24 +00:00
Evan Cheng ece104a0e1 Remove debugging code.
llvm-svn: 91604
2009-12-17 18:03:12 +00:00
Jim Grosbach 67584fe874 Add more detail for getting started on Windows.
Patch from jon.forums at gmail.com

llvm-svn: 91603
2009-12-17 17:18:11 +00:00
Ken Dyck 798493285c In LowerEXTRACT_VECTOR_ELT, force an i32 value type for PEXTWR instead of
incrementing the simple value type of the 16-bit type, which would give the
wrong type if an intemediate MVT (such as i24) were introduced.

llvm-svn: 91602
2009-12-17 15:31:52 +00:00
Nuno Lopes e9823fab83 implement PR3962: diagnose more faulty cases of usage of the restrict qualifier. this also removes a FIXME
llvm-svn: 91601
2009-12-17 11:35:26 +00:00
Nuno Lopes 641fdce235 revert part of my last patch, and mark only the c++ global new operator as noalias. the rest will be infered by llvm optz
llvm-svn: 91600
2009-12-17 10:15:49 +00:00
Nuno Lopes ff22e5e8cb document -fno-assume-sane-operator-new, per Chris request.
please review for English grammar mistakes

llvm-svn: 91599
2009-12-17 10:00:52 +00:00
Evan Cheng 090ac0865a Revert 91280-91283, 91286-91289, 91291, 91293, 91295-91296. It apparently introduced a non-deterministic behavior in the optimizer somewhere.
llvm-svn: 91598
2009-12-17 09:39:49 +00:00