Commit Graph

53457 Commits

Author SHA1 Message Date
Chris Lattner 76a63ed099 now that all the pieces are in place, teach instcombine's
simplifydemandedbits to simplify instructions with *multiple
uses* in contexts where it can get away with it.  This allows
it to simplify the code in multi-use-or.ll into a single 'add 
double'.

This change is particularly interesting because it will cover
up for some common codegen bugs with large integers created due
to the recent SROA patch.  When working on fixing those bugs,
this should be disabled.

llvm-svn: 63481
2009-01-31 08:40:03 +00:00
Chris Lattner 3e2cb66c56 simplify/clarify control flow and improve comments, no functionality change.
llvm-svn: 63480
2009-01-31 08:24:16 +00:00
Chris Lattner 83c6a141b8 make some fairly meaty internal changes to how SimplifyDemandedBits works.
Now, if it detects that "V" is the same as some other value, 
SimplifyDemandedBits returns the new value instead of RAUW'ing it immediately.
This has two benefits:
1) simpler code in the recursive SimplifyDemandedBits routine.
2) it allows future fun stuff in instcombine where an operation has multiple
   uses and can be simplified in one context, but not all.

#2 isn't implemented yet, this patch should have no functionality change.

llvm-svn: 63479
2009-01-31 08:15:18 +00:00
Chris Lattner 19efe30264 add accessors
llvm-svn: 63478
2009-01-31 07:34:19 +00:00
Chris Lattner 585cfb2ce7 minor cleanups
llvm-svn: 63477
2009-01-31 07:26:06 +00:00
Chris Lattner 94cfb281c3 make sure to set Changed=true when instcombine hacks on the code,
not doing so prevents it from properly iterating and prevents it
from deleting the entire body of dce-iterate.ll

llvm-svn: 63476
2009-01-31 07:04:22 +00:00
Mon P Wang b6080cf943 Used "-enable-unsafe-fp-math" to allow this transformation - (a * b -c) = c - a *b.
llvm-svn: 63475
2009-01-31 06:50:54 +00:00
Mon P Wang cf9ba82324 If unsafe FP optimization is not set, don't allow -(A-B) => B-A because
when A==B, -0.0 != +0.0.

llvm-svn: 63474
2009-01-31 06:07:45 +00:00
Bill Wendling 3b585af0ec Don't use DebugLoc::getUnknownLoc(). Default to something hopefully sensible.
llvm-svn: 63473
2009-01-31 03:12:48 +00:00
Daniel Dunbar 5df2b0baaa Remove unused overload of GetFunctionType.
llvm-svn: 63472
2009-01-31 03:05:44 +00:00
Daniel Dunbar a8b7f6bb13 Initialize CGFunctionInfo isVariadic bit correctly.
llvm-svn: 63471
2009-01-31 02:54:56 +00:00
Fariborz Jahanian c22f236e81 Use target alignment API to set objc2's meta-data
alignment.

llvm-svn: 63470
2009-01-31 02:43:27 +00:00
Chris Lattner ec99c46d44 Simplify and generalize the SROA "convert to scalar" transformation to
be able to handle *ANY* alloca that is poked by loads and stores of 
bitcasts and GEPs with constant offsets.  Before the code had a number
of annoying limitations and caused it to miss cases such as storing into
holes in structs and complex casts (as in bitfield-sroa) where we had
unions of bitfields etc.  This also handles a number of important cases
that are exposed due to the ABI lowering stuff we do to pass stuff by
value.

One case that is pretty great is that we compile 
2006-11-07-InvalidArrayPromote.ll into:

define i32 @func(<4 x float> %v0, <4 x float> %v1) nounwind {
	%tmp10 = call <4 x i32> @llvm.x86.sse2.cvttps2dq(<4 x float> %v1)
	%tmp105 = bitcast <4 x i32> %tmp10 to i128
	%tmp1056 = zext i128 %tmp105 to i256	
	%tmp.upgrd.43 = lshr i256 %tmp1056, 96
	%tmp.upgrd.44 = trunc i256 %tmp.upgrd.43 to i32	
	ret i32 %tmp.upgrd.44
}

which turns into:

_func:
	subl	$28, %esp
	cvttps2dq	%xmm1, %xmm0
	movaps	%xmm0, (%esp)
	movl	12(%esp), %eax
	addl	$28, %esp
	ret

Which is pretty good code all things considering :).

One effect of this is that SROA will start generating arbitrary bitwidth 
integers that are a multiple of 8 bits.  In the case above, we got a 
256 bit integer, but the codegen guys assure me that it can handle the 
simple and/or/shift/zext stuff that we're doing on these operations.

This addresses rdar://6532315

llvm-svn: 63469
2009-01-31 02:28:54 +00:00
Dale Johannesen db7c5f6a7b Move CurDebugLoc into SelectionDAGLowering.
llvm-svn: 63468
2009-01-31 02:22:37 +00:00
Daniel Dunbar a37249c663 Err, unbreak my previous "no functionality change commit", will fix properly later.
llvm-svn: 63467
2009-01-31 02:20:43 +00:00
Daniel Dunbar 3cd20632ff Kill off CGCallInfo, always use CGFunctionInfo for encapsulating
function/call info.

llvm-svn: 63466
2009-01-31 02:19:00 +00:00
Ted Kremenek a377abfe26 Update checker build.
llvm-svn: 63464
2009-01-31 01:32:23 +00:00
Gabor Greif dc588689bb back out my previous change, it exposes a latent bug. investigating
llvm-svn: 63463
2009-01-31 01:31:59 +00:00
Anders Carlsson d277d790e0 Add sema support for the cleanup attribute.
llvm-svn: 63462
2009-01-31 01:16:18 +00:00
Fariborz Jahanian 0408723269 class meta-data belong to __objc_data section (in objc2
nonfragile abi).

llvm-svn: 63461
2009-01-31 01:07:39 +00:00
Fariborz Jahanian 822082517f Recognize class's visibility attribute and set its linkage
to private extern (in objc2 nonfragile abi).

llvm-svn: 63460
2009-01-31 00:59:10 +00:00
Gabor Greif f88092ee06 use precise accessors
llvm-svn: 63459
2009-01-31 00:58:14 +00:00
Dale Johannesen dc0f124429 Propagate debug info in LegalizeFloatTypes.
Complete (modulo bugs).

llvm-svn: 63458
2009-01-31 00:43:08 +00:00
Dale Johannesen 42aa385e20 Propagate debug info. This file complete
(modulo bugs)

llvm-svn: 63457
2009-01-31 00:20:43 +00:00
Dale Johannesen c910889511 Propagate debug info through MakeLibCall and a
couple of things that use it.

llvm-svn: 63456
2009-01-31 00:11:23 +00:00
Daniel Dunbar 34aa3ca8c4 x86_64 ABI: Retool classification to compute lo & hi classifications
in terms of where the type resides in the containing object. This is a
more clear embodiement of the spec & fixes a merging issue with
unions. Down to 3/1000 failures.

llvm-svn: 63455
2009-01-31 00:06:58 +00:00
Bill Wendling 31b50991cb More DebugLoc propagation.
llvm-svn: 63454
2009-01-30 23:59:18 +00:00
Fariborz Jahanian 75e0351adb Missed another mis-alignment of an objc2 meta-data.
llvm-svn: 63453
2009-01-30 23:51:52 +00:00
Bill Wendling 27d9dd4b57 More DebugLoc propagation.
llvm-svn: 63452
2009-01-30 23:36:47 +00:00
Bill Wendling 306bfc2213 More DebugLoc propagation in LOAD etc. methods.
llvm-svn: 63451
2009-01-30 23:27:35 +00:00
Douglas Gregor 576e98cc1e Improve our handling of the second step in a user-defined conversion
sequence. Previously, we weren't permitting the second step to call
copy constructors, which left user-defined conversion sequences
surprisingly broken.

Now, we perform overload resolution among all of the constructors, but
only accept the result if it makes the conversion a standard
conversion. Note that this behavior is different from both GCC and EDG
(which don't agree with each other, either); I've submitted a core
issue on the matter.

llvm-svn: 63450
2009-01-30 23:27:23 +00:00
Anders Carlsson f6e6057e92 Fix typo noticed by Chris.
llvm-svn: 63449
2009-01-30 23:26:40 +00:00
Dale Johannesen 9d7c69d832 Fix build on case-sensitive filesystems (i.e. everybody else)
llvm-svn: 63448
2009-01-30 23:20:42 +00:00
Anders Carlsson db5a9b675c Turn on -flax-vector-conversions by default, issue a warning whenever one is done. Add a -fnolax-vector-conversions option. Fixes PR2862.
llvm-svn: 63447
2009-01-30 23:17:46 +00:00
Bill Wendling 0bd29743e3 More DebugLoc propagation in floating-point methods.
llvm-svn: 63446
2009-01-30 23:15:49 +00:00
Fariborz Jahanian e46e284efd Setting correct alignent for objc2 meta-data.
llvm-svn: 63445
2009-01-30 23:15:42 +00:00
Dale Johannesen 555a375bb6 Make LowerCallTo and LowerArguments take a DebugLoc
argument.  Adjust all callers and overloaded versions.

llvm-svn: 63444
2009-01-30 23:10:59 +00:00
Bill Wendling 6fbf5495f8 Standardize comments about folding xforms.
llvm-svn: 63443
2009-01-30 23:10:18 +00:00
Bill Wendling 8fb81f1b3d Get rid of the non-DebugLoc-ified getNOT() method.
llvm-svn: 63442
2009-01-30 23:03:19 +00:00
Bill Wendling 3dc5d2454e Propagate debug loc info for some FP arithmetic methods.
llvm-svn: 63441
2009-01-30 22:57:07 +00:00
Bill Wendling cb9be5d174 Propagate debug loc info for some FP arithmetic methods.
llvm-svn: 63440
2009-01-30 22:53:48 +00:00
Bill Wendling 4e0a61514b Propagate debug loc info for BIT_CONVERT.
llvm-svn: 63439
2009-01-30 22:44:24 +00:00
Daniel Dunbar 6a046c64d9 x86_64 ABI: Fix more thinkos, straddling computation for complex was
computing in bytes not bits. We are now down to 22/1000 failures on
the return types tests, and 18 of those are gcc bugs I believe.

llvm-svn: 63438
2009-01-30 22:40:15 +00:00
Bill Wendling 7bfa43b022 Propagate debug loc info for more *_EXTEND methods.
llvm-svn: 63437
2009-01-30 22:33:24 +00:00
Bill Wendling 9b3dc8d848 Propagate debug loc info for ANY_EXTEND.
llvm-svn: 63436
2009-01-30 22:27:33 +00:00
Douglas Gregor d42a0fb41b Upgrade the "excess elements in array initializer" warning to an
error, since both C99 and C++ consider it an error. For reference, GCC
makes this a warning while G++ makes it an error.

llvm-svn: 63435
2009-01-30 22:26:29 +00:00
Bill Wendling c409318562 Propagate debug loc info for some of the *_EXTEND functions.
llvm-svn: 63434
2009-01-30 22:23:15 +00:00
Bill Wendling cab9a2eef5 DebugLoc form of getNOT().
llvm-svn: 63433
2009-01-30 22:11:22 +00:00
Douglas Gregor d14247a9e5 Implement and test aggregate initialization in C++. Major changes:
- Support initialization of reference members; complain if any
  reference members are left uninitialized.
  - Use C++ copy-initialization for initializing each element (falls
  back to constraint checking in C)
  - Make sure we diagnose when one tries to provide an initializer
  list for a non-aggregate.
  - Don't complain about empty initializers in C++ (they are permitted)
  - Unrelated but necessary: don't bother trying to convert the
  decl-specifier-seq to a type when we're dealing with a C++
  constructor, destructor, or conversion operator; it results in
  spurious warnings.

llvm-svn: 63431
2009-01-30 22:09:00 +00:00
Fariborz Jahanian fa57e8e7ab add imag_info section and data (for objc2 nonfragile abi).
llvm-svn: 63430
2009-01-30 22:07:48 +00:00