Commit Graph

90190 Commits

Author SHA1 Message Date
Chris Lattner 2c9e253ca9 more dead thing zapping.
llvm-svn: 112353
2010-08-28 03:43:50 +00:00
Chris Lattner d069114613 zap dead method
llvm-svn: 112352
2010-08-28 03:42:45 +00:00
Chris Lattner 50df36ac0a for completeness, allow undef also.
llvm-svn: 112351
2010-08-28 03:36:51 +00:00
Chris Lattner 95bb297c26 squish dead code.
llvm-svn: 112350
2010-08-28 03:21:03 +00:00
Chris Lattner ca936ac966 zap dead code
llvm-svn: 112349
2010-08-28 03:18:45 +00:00
Bruno Cardoso Lopes a982aa24ef Clean up the logic of vector shuffles -> vector shifts.
Also teach this logic how to handle target specific shuffles if
needed, this is necessary while searching recursively for zeroed
scalar elements in vector shuffle operands.

llvm-svn: 112348
2010-08-28 02:46:39 +00:00
Gabor Greif 468aa3b20c check whether sema issues a redefinition error
llvm-svn: 112347
2010-08-28 02:00:22 +00:00
Gabor Greif 34ecff269e perform cheap test first
llvm-svn: 112346
2010-08-28 01:58:12 +00:00
Chris Lattner d0214f3efe handle the constant case of vector insertion. For something
like this:

struct S { float A, B, C, D; };

struct S g;
struct S bar() { 
  struct S A = g;
  ++A.B;
  A.A = 42;
  return A;
}

we now generate:

_bar:                                   ## @bar
## BB#0:                                ## %entry
	movq	_g@GOTPCREL(%rip), %rax
	movss	12(%rax), %xmm0
	pshufd	$16, %xmm0, %xmm0
	movss	4(%rax), %xmm2
	movss	8(%rax), %xmm1
	pshufd	$16, %xmm1, %xmm1
	unpcklps	%xmm0, %xmm1
	addss	LCPI1_0(%rip), %xmm2
	pshufd	$16, %xmm2, %xmm2
	movss	LCPI1_1(%rip), %xmm0
	pshufd	$16, %xmm0, %xmm0
	unpcklps	%xmm2, %xmm0
	ret

instead of:

_bar:                                   ## @bar
## BB#0:                                ## %entry
	movq	_g@GOTPCREL(%rip), %rax
	movss	12(%rax), %xmm0
	pshufd	$16, %xmm0, %xmm0
	movss	4(%rax), %xmm2
	movss	8(%rax), %xmm1
	pshufd	$16, %xmm1, %xmm1
	unpcklps	%xmm0, %xmm1
	addss	LCPI1_0(%rip), %xmm2
	movd	%xmm2, %eax
	shlq	$32, %rax
	addq	$1109917696, %rax       ## imm = 0x42280000
	movd	%rax, %xmm0
	ret

llvm-svn: 112345
2010-08-28 01:50:57 +00:00
Duncan Sands 3bd97fec8f Straighten out any triple strings passed on the command line before
they hit the rest of the system.

llvm-svn: 112344
2010-08-28 01:30:02 +00:00
Chris Lattner dd6601048e optimize bitcasts from large integers to vector into vector
element insertion from the pieces that feed into the vector.
This handles a pattern that occurs frequently due to code
generated for the x86-64 abi.  We now compile something like
this:

struct S { float A, B, C, D; };
struct S g;
struct S bar() { 
  struct S A = g;
  ++A.A;
  ++A.C;
  return A;
}

into all nice vector operations:

_bar:                                   ## @bar
## BB#0:                                ## %entry
	movq	_g@GOTPCREL(%rip), %rax
	movss	LCPI1_0(%rip), %xmm1
	movss	(%rax), %xmm0
	addss	%xmm1, %xmm0
	pshufd	$16, %xmm0, %xmm0
	movss	4(%rax), %xmm2
	movss	12(%rax), %xmm3
	pshufd	$16, %xmm2, %xmm2
	unpcklps	%xmm2, %xmm0
	addss	8(%rax), %xmm1
	pshufd	$16, %xmm1, %xmm1
	pshufd	$16, %xmm3, %xmm2
	unpcklps	%xmm2, %xmm1
	ret

instead of icky integer operations:

_bar:                                   ## @bar
	movq	_g@GOTPCREL(%rip), %rax
	movss	LCPI1_0(%rip), %xmm1
	movss	(%rax), %xmm0
	addss	%xmm1, %xmm0
	movd	%xmm0, %ecx
	movl	4(%rax), %edx
	movl	12(%rax), %esi
	shlq	$32, %rdx
	addq	%rcx, %rdx
	movd	%rdx, %xmm0
	addss	8(%rax), %xmm1
	movd	%xmm1, %eax
	shlq	$32, %rsi
	addq	%rax, %rsi
	movd	%rsi, %xmm1
	ret

This resolves rdar://8360454

llvm-svn: 112343
2010-08-28 01:20:38 +00:00
Nick Lewycky 02d13d1356 Ignore this flag too, Clang doesn't seem to use random numbers internally.
llvm-svn: 112342
2010-08-28 01:01:21 +00:00
Dan Gohman e06905d1f0 Completely disable tail calls when fast-isel is enabled, as fast-isel
doesn't currently support dealing with this.

llvm-svn: 112341
2010-08-28 00:51:03 +00:00
Dan Gohman 1e06dbf881 Trim a #include.
llvm-svn: 112340
2010-08-28 00:49:13 +00:00
Gabor Greif 73ddbc51ab note to self: save before committing; add PR
llvm-svn: 112339
2010-08-28 00:48:36 +00:00
Gabor Greif 1d28820888 fix test by applying it in top namespace: PR8007 only showed up this way
llvm-svn: 112338
2010-08-28 00:45:56 +00:00
Dan Gohman fe22f1d3cc Fix an index calculation thinko.
llvm-svn: 112337
2010-08-28 00:39:27 +00:00
Bob Wilson 8ee9394750 We don't need to custom-select VLDMQ and VSTMQ anymore.
llvm-svn: 112336
2010-08-28 00:20:11 +00:00
Ted Kremenek d7478d6010 Update test case, with comment to later investigate the correct behavior. Now the behavior is at least consistent.
llvm-svn: 112335
2010-08-28 00:19:12 +00:00
Ted Kremenek 82bfc86792 Explicitly handle CXXExprWithTemporaries during CFG construction by just visiting the subexpression. While we don't do anything intelligent right now, this obviates a bogus -Wunreahable-code warning reported in PR 6130.
llvm-svn: 112334
2010-08-28 00:19:02 +00:00
Gabor Greif b6aba3ef28 fix PR8007
reordering and redefinition issues still may linger,
I plan to nail them next

llvm-svn: 112333
2010-08-28 00:16:06 +00:00
Benjamin Kramer 83f9ff0452 Update CMake build. Add newline at end of file.
llvm-svn: 112332
2010-08-28 00:11:12 +00:00
Greg Clayton 73b953bc1f Detect when ValueObject values change each time they are evaluated.
llvm-svn: 112331
2010-08-28 00:08:07 +00:00
Douglas Gregor eaeeca9afe Basic code completion support for the base and member initializers in
a constructor.

llvm-svn: 112330
2010-08-28 00:00:50 +00:00
Bob Wilson ca5af12920 When merging Thumb2 loads/stores, do not give up when the offset is one of
the special values that for ARM would be used with IB or DA modes.  Fall
through and consider materializing a new base address is it would be
profitable.

llvm-svn: 112329
2010-08-27 23:57:52 +00:00
Johnny Chen 269457515a Fail early, fail fast.
llvm-svn: 112328
2010-08-27 23:53:00 +00:00
Johnny Chen 5ee881948a Added a test case test_breakpoint_creation_by_filespec_python() which creates a
breakpoint by FileSpec and line number and exercises some FileSpec APIs.

Also, RUN_STOPPED is a bad assert name, RUN_SUCCEEDED is better.

llvm-svn: 112327
2010-08-27 23:47:36 +00:00
Gabor Greif a56984c72f reproduction recipe for PR8007, expected to fail for now, review welcome
llvm-svn: 112326
2010-08-27 23:39:49 +00:00
Owen Anderson cf7f941121 Add a prototype of a new peephole optimizing pass that uses LazyValue info to simplify PHIs and select's.
This pass addresses the missed optimizations from PR2581 and PR4420.

llvm-svn: 112325
2010-08-27 23:31:36 +00:00
Sean Callanan e71d553cd4 Added a ClangUtilityFunction class that allows the
debugger to insert self-contained functions for use by
expressions (mainly for error-checking).

In order to support detecting whether a crash occurred
in one of these helpers -- currently our preferred way
of reporting that an error-check failed -- added a bit
of support for getting the extent of a JITted function
in addition to just its base.

llvm-svn: 112324
2010-08-27 23:31:21 +00:00
Owen Anderson 38f6b7fe3b Improve the precision of getConstant().
llvm-svn: 112323
2010-08-27 23:29:38 +00:00
Bob Wilson 13ce07fa92 Change ARM VFP VLDM/VSTM instructions to use addressing mode #4, just like
all the other LDM/STM instructions.  This fixes asm printer crashes when
compiling with -O0.  I've changed one of the NEON tests (vst3.ll) to run
with -O0 to check this in the future.

Prior to this change VLDM/VSTM used addressing mode #5, but not really.
The offset field was used to hold a count of the number of registers being
loaded or stored, and the AM5 opcode field was expanded to specify the IA
or DB mode, instead of the standard ADD/SUB specifier.  Much of the backend
was not aware of these special cases.  The crashes occured when rewriting
a frameindex caused the AM5 offset field to be changed so that it did not
have a valid submode.  I don't know exactly what changed to expose this now.
Maybe we've never done much with -O0 and NEON.  Regardless, there's no longer
any reason to keep a count of the VLDM/VSTM registers, so we can use
addressing mode #4 and clean things up in a lot of places.

llvm-svn: 112322
2010-08-27 23:18:17 +00:00
Chris Lattner 954e9557e3 tidy up test.
llvm-svn: 112321
2010-08-27 23:15:21 +00:00
Sebastian Redl 6766794c0b Parser support for inline namespaces
llvm-svn: 112320
2010-08-27 23:12:46 +00:00
Sebastian Redl 5bfe034ecc Comment and move another ASTReader member.
llvm-svn: 112319
2010-08-27 23:12:39 +00:00
Sebastian Redl cc6458890d Update comment after Chandler's change.
llvm-svn: 112318
2010-08-27 23:12:36 +00:00
Chris Lattner b8b7d52631 no really, fix the test.
llvm-svn: 112317
2010-08-27 23:05:54 +00:00
Chris Lattner c8908b4cdb fix this test. It's not clear what it's really testing.
llvm-svn: 112316
2010-08-27 23:05:27 +00:00
Douglas Gregor fcee9460c6 Miscellaneous found by inspection with John and Sebastian
llvm-svn: 112315
2010-08-27 22:55:10 +00:00
Chris Lattner 6c1395f62a Enhance the shift propagator to handle the case when you have:
A = shl x, 42
...
B = lshr ..., 38

which can be transformed into:
A = shl x, 4
...

iff we can prove that the would-be-shifted-in bits
are already zero.  This eliminates two shifts in the testcase
and allows eliminate of the whole i128 chain in the real example.

llvm-svn: 112314
2010-08-27 22:53:44 +00:00
Tom Care 71cc9d886a Added checking of (x == x) and (x != x) to IdempotentOperationChecker and updated test cases flagged by it.
llvm-svn: 112313
2010-08-27 22:50:47 +00:00
Tom Care 98e679508d Enabled relaxed LiveVariables analysis in the path-sensitive engine to increase the coverage of bugs. Primarily affects IdempotentOperationChecker.
- Migrated a temporarily separated test back to its original file (bug has been fixed, null-deref-ps-temp.c -> null-deref-ps.c)
- Changed SymbolManager to use relaxed LiveVariables
- Updated several test cases that the IdempotentOperationChecker class now flags
- Added test case to test relaxed LiveVariables use by the IdempotentOperationChecker

llvm-svn: 112312
2010-08-27 22:46:32 +00:00
Johnny Chen fd8967a82f Fixed a typo in the method name.
llvm-svn: 112311
2010-08-27 22:39:49 +00:00
Tom Care f7b7067c4d Remove an assertion in UnreachableCodeChecker that can be triggered by bugs in other checkers.
llvm-svn: 112310
2010-08-27 22:37:31 +00:00
Tom Care c29c91aaaa Fix bug in IdempotentOperationChecker where an assumption would not get updated properly.
llvm-svn: 112309
2010-08-27 22:35:28 +00:00
Johnny Chen 23fd10cb4e o Exposed SBFileSpec to the Python APIs in lldb.py.
o Fixed a crasher when getting it via SBTarget.GetExecutable().

>>> filespec = target.GetExecutable()
Segmentation fault

o And renamed SBFileSpec::GetFileName() to GetFilename() to be consistent with FileSpec::GetFilename().

llvm-svn: 112308
2010-08-27 22:35:26 +00:00
Chris Lattner 1ba644575d handle :: in selectors in objc++ mode, rdar://8366474
llvm-svn: 112307
2010-08-27 22:32:41 +00:00
Tom Care e5aa30c722 Add alternate version of LiveVariables analysis that does not kill liveness at assignments. This 'relaxed' liveness is useful in path sensitive analysis for situations where the resulting extended liveness allows us to find some bugs.
- Added killAtAssign flag to LiveVariables
- Added relaxed LiveVariables to AnalysisContext with an accessor

llvm-svn: 112306
2010-08-27 22:30:10 +00:00
Devang Patel f2855b147f Simplify.
llvm-svn: 112305
2010-08-27 22:25:51 +00:00
Chris Lattner 18d7fc8fc6 Implement a pretty general logical shift propagation
framework, which is good at ripping through bitfield
operations.  This generalize a bunch of the existing
xforms that instcombine does, such as 
  (x << c) >> c -> and
to handle intermediate logical nodes.  This is useful for
ripping up the "promote to large integer" code produced by
SRoA.

llvm-svn: 112304
2010-08-27 22:24:38 +00:00