Commit Graph

107173 Commits

Author SHA1 Message Date
Jim Grosbach c7e6b8fed5 Diagnostic for undefined assembler local symbols.
Re-apply 133010, with fixes for inline assembler.

Original commit message:
"When an assembler local symbol is used but not defined in a module, a
Darwin assembler wants to issue a diagnostic to that effect."

Added fix to only perform the check when finalizing, as otherwise we're not
done and undefined symbols may simply not have been encountered yet.

Passes "make check" and a self-host check on Darwin.

llvm-svn: 133071
2011-06-15 18:33:28 +00:00
Eli Friedman 471a22febc Use isAnyComplexType here so we don't pass complex numbers into the aggregate handling code; found by inspection.
llvm-svn: 133070
2011-06-15 18:27:44 +00:00
Eli Friedman 7e68c88bf7 Fix a regression from r132957 involving complex integers. (Fixes failures on gcc-testsuite bot.)
llvm-svn: 133069
2011-06-15 18:26:32 +00:00
Andrew Trick 967d584a3a Disabling this test until I can figure out the right lit flags.
llvm-svn: 133068
2011-06-15 18:25:38 +00:00
Jakob Stoklund Olesen 5977109f14 Remove custom allocation orders in SystemZ.
Note that this actually changes code generation, and someone who
understands this target better should check the changes.

- R12Q is now allocatable. I think it was omitted from the allocation
  order by mistake since it isn't reserved. It as apparently used as a
  GOT pointer sometimes, and it should probably be reserved if that is
  the case.

- The GR64 registers are allocated in a different order now. The
  register allocator will automatically put the CSRs last. There were
  other changes to the order that may have been significant.

The test fix is because r0 and r1 swapped places in the allocation order.

llvm-svn: 133067
2011-06-15 18:02:56 +00:00
Devang Patel ce04aa5a2c Testcase for r133065
llvm-svn: 133066
2011-06-15 17:57:23 +00:00
Devang Patel 7bf741ac36 Do not emit stoppoint before emitting debug info for parameters.
- llvm.dbg.declare already receives line number information from ParmDecl
- Additional extra stoppoint messes up gdb's understanding of where function body starts.

llvm-svn: 133065
2011-06-15 17:57:08 +00:00
Evan Cheng 678b691aa3 Another revsh pattern. rdar://9609059
llvm-svn: 133064
2011-06-15 17:17:48 +00:00
Andrew Trick 3013b6ae4a Added -stress-sched flag in the Asserts build.
Added a test case for handling physreg aliases during pre-RA-sched.

llvm-svn: 133063
2011-06-15 17:16:12 +00:00
Chad Rosier 19a1f425a7 TargetLoweringOpt is a struct used by DAGCombine, not a pass.
llvm-svn: 133062
2011-06-15 16:48:02 +00:00
Caroline Tice 8f7eb81bf6 Add an introduction to the scripting example web page.
llvm-svn: 133061
2011-06-15 16:37:40 +00:00
Douglas Gregor 39c0272f65 Eliminate a 'default' case in template argument deduction, where we
were just punting on template argument deduction for a number of type
nodes. Most of them, obviously, didn't matter.

As a consequence of this, make extended vector types (via the
ext_vector_type attribute) actually work properly for several
important cases:
  - If the attribute appears in a type-id (i.e, not attached to a
  typedef), actually build a proper vector type
  - Build ExtVectorType whenever the size is constant; previously, we
  were building DependentSizedExtVectorType when the size was constant
  but the type was dependent, which makes no sense at all.
  - Teach template argument deduction to handle
  ExtVectorType/DependentSizedExtVectorType.

llvm-svn: 133060
2011-06-15 16:02:29 +00:00
Roman Divacky 6874b26d0f Make PPC64CompilationCallback compilable no non-darwin platforms.
Patch by Nathan Whitehorn!

llvm-svn: 133059
2011-06-15 15:29:47 +00:00
Nadav Rotem 13cb7736a7 getZeroExtendInReg needs to get a scalar type
llvm-svn: 133057
2011-06-15 14:37:18 +00:00
Douglas Gregor 4e5df95e49 Eliminate an unnecessary include. FIXMEs -=1
llvm-svn: 133056
2011-06-15 14:26:34 +00:00
Douglas Gregor 55462626b6 When performing substitution of default template template parameters
before the template parameters have acquired a proper context (e.g.,
because the enclosing context has yet to be built), provide empty
parameter lists for all outer template parameter scopes to inhibit any
substitution for those template parameters. Fixes PR9643 /
<rdar://problem/9251019>.

llvm-svn: 133055
2011-06-15 14:20:42 +00:00
Nadav Rotem 24c6558865 This test was failing on X86 machines which do not have SSE4. Fixed the test by
specifying that the target CPU is corei7.

llvm-svn: 133053
2011-06-15 12:26:53 +00:00
Nadav Rotem d2d9bdb2b0 Enable the simplification of truncating-store after fixing the usage of
GetDemandBits (which must operate on the vector element type).

Fix the a usage of getZeroExtendInReg which must also be done on scalar types.

llvm-svn: 133052
2011-06-15 11:19:12 +00:00
Owen Anderson 86fd3c0058 Replace the statically generated hashtables for checking register relationships with just scanning the (typically tiny) static lists.
At the time I wrote this code (circa 2007), TargetRegisterInfo was using a std::set to perform these queries.  Switching to the static hashtables was an obvious improvement, but in reality there's no reason to do anything other than scan.
With this change, total LLC time on a whole-program 403.gcc is reduced by approximately 1.5%, almost all of which comes from a 15% reduction in LiveVariables time.  It also reduces the binary size of LLC by 86KB, thanks to eliminating a bunch of very large static tables.

llvm-svn: 133051
2011-06-15 06:53:50 +00:00
Nick Lewycky 5bcbd73c38 Teach the .ll parser to handle named metadata with non-simple names.
Unfortunately we can't follow what the rest of the language does (wrapping it
in double-quotes) because that would cause an ambiguity with metadata strings,
so instead we escape any unusual characters with \xx escaping.

llvm-svn: 133050
2011-06-15 06:37:58 +00:00
Chris Lattner 4d8a3a173f remove some more empty dirs.
llvm-svn: 133049
2011-06-15 06:07:34 +00:00
Chris Lattner f43ba1a9b4 remove an empty dir.
llvm-svn: 133048
2011-06-15 06:06:16 +00:00
Bob Wilson 4b12a11f30 A minor simplification: no functional change.
llvm-svn: 133047
2011-06-15 06:04:34 +00:00
Jordy Rose 634c12d23f [analyzer] Revise CStringChecker's modelling of strcpy() and strcat():
- (bounded copies) Be more conservative about how much is being copied.
- (str(n)cat) If we can't compute the exact final length of an append operation, we can still lower-bound it.
- (stpcpy) Fix the conjured return value at the end to actually be returned.

This requires these supporting changes:
- C string metadata symbols are still live even when buried in a SymExpr.
- "Hypothetical" C string lengths, to represent a value that /will/ be passed to setCStringLength() if all goes well. (The idea is to allow for temporary constrainable symbols that may end up becoming permanent.)
- The 'checkAdditionOverflow' helper makes sure that the two strings being appended in a strcat don't overflow size_t. This should never *actually* happen; the real effect is to keep the final string length from "wrapping around" in the constraint manager.

This doesn't actually test the "bounded" operations (strncpy and strncat) because they can leave strings unterminated. Next on the list!

llvm-svn: 133046
2011-06-15 05:52:56 +00:00
Douglas Gregor 88336839b9 Don't add redundant FormatAttr, ConstAttr, or NoThrowAttr attributes,
either imlicitly (for builtins) or explicitly (due to multiple
specification of the same attributes). Fixes <rdar://problem/9612060>.

llvm-svn: 133045
2011-06-15 05:45:11 +00:00
Jordy Rose 0e9fb28e95 [analyzer] If a C string length is UnknownVal, clear any existing length binding. No tests yet because the only thing that sets string length is strcpy(), and that needs some work anyway.
llvm-svn: 133044
2011-06-15 05:14:03 +00:00
Jakob Stoklund Olesen 5ee87726dd Use a SetTheory instance to expand register lists in register classes.
This prepares tablegen to compute register lists from set theoretic dag
expressions. This doesn't really make any difference as long as
Target.td still declares RegisterClass::MemberList as [Register].

llvm-svn: 133043
2011-06-15 05:09:20 +00:00
Bill Wendling a337414ff4 Remove the LTO stuff from the profile_rt library's Makefile.
llvm-svn: 133042
2011-06-15 04:56:13 +00:00
Jordy Rose b891bd8a3c [analyzer] When performing a binary operation on symbolic operands, we convert the symbol values to a common type. But in a relational operation, the result is an 'int' or 'bool', which may not be the appropriate type to convert the operands to. In these cases, use the left-hand operand's type as the conversion type.
There's no associated test for this because fully-constrained symbolic values are evaluated ahead of time in normal expressions. This can only come up in checker-constructed expressions (like the ones in an upcoming patch to CStringChecker).

llvm-svn: 133041
2011-06-15 04:55:49 +00:00
Jakob Stoklund Olesen d7bc5c26ab Give CodeGenRegisterClass a real sorted member set.
Make the Elements vector private and expose an ArrayRef through
getOrder() instead. getOrder will eventually provide multiple
user-specified allocation orders.

Use the sorted member set for member and subclass tests. Clean up a lot
of ad hoc searches.

llvm-svn: 133040
2011-06-15 04:50:36 +00:00
Nico Weber 50340d5c87 Build fix attempt.
llvm-svn: 133039
2011-06-15 04:50:13 +00:00
Bill Wendling 36c0c6db3f Improve the heuristic to emit the alias if the number of hard-coded registers
are also greater than the alias.

llvm-svn: 133038
2011-06-15 04:31:19 +00:00
Douglas Gregor 1778b030c0 Properly implement C++0x [stmt.dcl]p3, which requires a scope to be
protected in the case where a variable is being initialized by a
trivial default constructor but has a non-trivial destructor.

llvm-svn: 133037
2011-06-15 03:23:34 +00:00
Nico Weber 0870debb8b Warn on "void f(int a[10]) { sizeof(a); }"
llvm-svn: 133036
2011-06-15 02:47:03 +00:00
Eli Friedman e8bbc10880 Stop using memdep for a check that didn't really make sense with memdep. In terms of specific issues, using memdep here checks irrelevant instructions and won't work properly once we start returning "unknown" more aggressively from memdep.
llvm-svn: 133035
2011-06-15 01:25:56 +00:00
Evan Cheng 6d02d9044b PerformBFICombine - (bfi A, (and B, Mask1), Mask2) -> (bfi A, B, Mask2) iff
the bits being cleared by the AND are not demanded by the BFI.

The previous BFI dag combine rule was actually incorrect (or used to be
correct until BFI representation changed).

rdar://9609030

llvm-svn: 133034
2011-06-15 01:12:31 +00:00
Ted Kremenek 70f05fdfee Sema: show shift result in hexadecimal
Change the output for -Wshift-overflow and
-Wshift-sign-overflow to an unsigned hexadecimal. It makes
more sense for looking at bits than a signed decimal does.
Also, change the diagnostic's wording from "overrides"
to "sets".

This uses a new optional argument in APInt::toString()
that adds the '0x' prefix to hexademical numbers.

This fixes PR 9651.

Patch by nobled@dreamwidth.org!

llvm-svn: 133033
2011-06-15 00:54:52 +00:00
Ted Kremenek b05f02e956 add option for literal formatting to APInt::toString()
toString() now takes an optional bool argument that,
depending on the radix, adds the appropriate prefix
to the integer's string representation that makes it into a
meaningful C literal, e.g.:

hexademical: '-f' becomes '-0xf'
octal: '77' becomes '077'
binary: '110' becomes '0b110'

Patch by nobled@dreamwidth.org!

llvm-svn: 133032
2011-06-15 00:51:55 +00:00
Eli Friedman 7d58bc7bc0 Add "unknown" results for memdep, which mean "I don't know whether a dependence for the given instruction exists in the given block". This cleans up all the existing hacks in memdep which represent this concept by returning clobber with various unrelated instructions.
llvm-svn: 133031
2011-06-15 00:47:34 +00:00
Chris Lattner e67977214f mention new VLA behavior in gnu* vs c* mode dox.
llvm-svn: 133030
2011-06-15 00:41:40 +00:00
Jakob Stoklund Olesen 22ea424d43 Move the list of register classes into CodeGenRegBank as well.
No functional change intended.

llvm-svn: 133029
2011-06-15 00:20:40 +00:00
Tanya Lattner e9e6705cf9 Add an optimization that looks for a specific pair-wise add pattern and generates a vpaddl instruction instead of scalarizing the add.
Includes a test case.

llvm-svn: 133027
2011-06-14 23:48:48 +00:00
Rafael Espindola 2efebb3610 Add triple.
llvm-svn: 133026
2011-06-14 23:47:36 +00:00
Douglas Gregor a860e6aebc Introduce a -cc1-level option to turn off related result type
inference, to be used (only) by the Objective-C rewriter.

llvm-svn: 133025
2011-06-14 23:20:43 +00:00
Ted Kremenek 192ed0b7ee [format strings] correctly suggest correct type for '%@' specifiers. Fixes <rdar://problem/9607158>.
llvm-svn: 133024
2011-06-14 22:56:51 +00:00
Anna Zaks cd7f70e8b5 Anna's test commit (#2).
llvm-svn: 133023
2011-06-14 22:40:29 +00:00
Chad Rosier 818e116723 When pattern matching during instruction selection make sure shl x,1 is not
converted to add x,x if x is a undef.  add undef, undef does not guarantee
that the resulting low order bit is zero.
Fixes <rdar://problem/9453156> and <rdar://problem/9487392>.

llvm-svn: 133022
2011-06-14 22:29:10 +00:00
Rafael Espindola 1bf96ac607 Check the llc output.
llvm-svn: 133021
2011-06-14 22:24:32 +00:00
Johnny Chen 67a3e9e40c Update usage comment.
llvm-svn: 133020
2011-06-14 22:23:54 +00:00
Daniel Dunbar 7487bbb72a build/clang_darwin: Fix previous change to CheckArches to not cause problem when
command produces error output on stdout instead of stderr (and suppress the
stderr output while at it).

llvm-svn: 133019
2011-06-14 22:21:49 +00:00