oota-llvm.git
15 years agorewrite CountNumNewlinesBetween to be in terms of StringRef.
Chris Lattner [Sun, 20 Sep 2009 22:42:44 +0000 (22:42 +0000)]
rewrite CountNumNewlinesBetween to be in terms of StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82410 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agothis was not supposed to be committed
Chris Lattner [Sun, 20 Sep 2009 22:36:11 +0000 (22:36 +0000)]
this was not supposed to be committed

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82409 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimplement and document support for CHECK-NOT
Chris Lattner [Sun, 20 Sep 2009 22:35:26 +0000 (22:35 +0000)]
implement and document support for CHECK-NOT

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82408 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorewrite FileCheck in terms of StringRef instead of manual pointer pairs.
Chris Lattner [Sun, 20 Sep 2009 22:11:44 +0000 (22:11 +0000)]
rewrite FileCheck in terms of StringRef instead of manual pointer pairs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82407 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimprove memdep to eliminate bitcasts (and aliases, and noop geps)
Chris Lattner [Sun, 20 Sep 2009 21:00:18 +0000 (21:00 +0000)]
improve memdep to eliminate bitcasts (and aliases, and noop geps)
early for the stated reasons: this allows it to find more
equivalences and depend less on code layout.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82404 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove CoerceAvailableValueToLoadType earlier in GVN.cpp. Hook it up
Chris Lattner [Sun, 20 Sep 2009 20:09:34 +0000 (20:09 +0000)]
Move CoerceAvailableValueToLoadType earlier in GVN.cpp.  Hook it up
so that nonlocal and partially redundant loads can use it as well.
The testcase shows examples of craziness this can handle.  This triggers
*many* times in 176.gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82403 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agochange the interface to CoerceAvailableValueToLoadType to be
Chris Lattner [Sun, 20 Sep 2009 19:31:14 +0000 (19:31 +0000)]
change the interface to CoerceAvailableValueToLoadType to be
more generic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82402 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTeach 'make check-all' to build the site configuration for clang, if it is in tree.
Daniel Dunbar [Sun, 20 Sep 2009 19:04:28 +0000 (19:04 +0000)]
Teach 'make check-all' to build the site configuration for clang, if it is in tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82400 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoenhance GVN to forward substitute a stored value to a load
Chris Lattner [Sun, 20 Sep 2009 19:03:47 +0000 (19:03 +0000)]
enhance GVN to forward substitute a stored value to a load
(and load -> load) when the base pointers must alias but when
they are different types.  This occurs very very frequently in
176.gcc and other code that uses bitfields a lot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82399 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoupdate an entry, delete an entry which has been fixed.
Chris Lattner [Sun, 20 Sep 2009 17:37:38 +0000 (17:37 +0000)]
update an entry, delete an entry which has been fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82398 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agotidy up
Chris Lattner [Sun, 20 Sep 2009 17:32:21 +0000 (17:32 +0000)]
tidy up

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82397 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago--- Reverse-merging r82282 into '.':
Bill Wendling [Sun, 20 Sep 2009 09:13:15 +0000 (09:13 +0000)]
--- Reverse-merging r82282 into '.':
U    lib/CodeGen/AsmPrinter/DwarfException.cpp
U    lib/CodeGen/AsmPrinter/DwarfException.h

--- Reverse-merging r82274 into '.':
U    lib/Target/TargetLoweringObjectFile.cpp
G    lib/CodeGen/AsmPrinter/DwarfException.cpp

These revisions were breaking everything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82396 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove a temporary hack.
Chris Lattner [Sun, 20 Sep 2009 07:47:59 +0000 (07:47 +0000)]
remove a temporary hack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82395 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename X86ATTAsmPrinter.cpp -> X86AsmPrinter.cpp likewise the .h file.
Chris Lattner [Sun, 20 Sep 2009 07:41:30 +0000 (07:41 +0000)]
rename X86ATTAsmPrinter.cpp -> X86AsmPrinter.cpp likewise the .h file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82394 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomove target registry stuff to X86ATTAsmPrinter.cpp
Chris Lattner [Sun, 20 Sep 2009 07:39:06 +0000 (07:39 +0000)]
move target registry stuff to X86ATTAsmPrinter.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82393 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosimplify this now that createX86CodePrinterPass is trivial
Chris Lattner [Sun, 20 Sep 2009 07:37:51 +0000 (07:37 +0000)]
simplify this now that createX86CodePrinterPass is trivial

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82392 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename X86ATTAsmPrinter class -> X86AsmPrinter
Chris Lattner [Sun, 20 Sep 2009 07:35:34 +0000 (07:35 +0000)]
rename X86ATTAsmPrinter class -> X86AsmPrinter

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82391 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove the asmstring, it is now dead. Improve comment.
Chris Lattner [Sun, 20 Sep 2009 07:32:00 +0000 (07:32 +0000)]
remove the asmstring, it is now dead.  Improve comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82390 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPeer through zext and sext to eliminate them when it is safe to do so.
Nick Lewycky [Sun, 20 Sep 2009 07:31:25 +0000 (07:31 +0000)]
Peer through zext and sext to eliminate them when it is safe to do so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82389 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agokill off printPICLabel now, it's specialness is handled by
Chris Lattner [Sun, 20 Sep 2009 07:28:26 +0000 (07:28 +0000)]
kill off printPICLabel now, it's specialness is handled by
the MachineInstr ->MCInst lowering process, not in the
asmprinter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82388 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agodelete X86IntelAsmPrinter! Now -x86-asm-syntax just switches
Chris Lattner [Sun, 20 Sep 2009 07:25:17 +0000 (07:25 +0000)]
delete X86IntelAsmPrinter!  Now -x86-asm-syntax just switches
the instruction syntax, not the entire asmprinter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82387 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFold 'icmp eq (icmp), true' into an xor(icmp).
Nick Lewycky [Sun, 20 Sep 2009 07:21:39 +0000 (07:21 +0000)]
Fold 'icmp eq (icmp), true' into an xor(icmp).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82386 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd an intel syntax MCInstPrinter implementation. You can now
Chris Lattner [Sun, 20 Sep 2009 07:17:49 +0000 (07:17 +0000)]
Add an intel syntax MCInstPrinter implementation.  You can now
transcode from AT&T to intel syntax with "llvm-mc foo.s -output-asm-variant=1"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82385 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agotidy up
Chris Lattner [Sun, 20 Sep 2009 07:16:54 +0000 (07:16 +0000)]
tidy up

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82384 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRewrite this check so that it checks what it's supposed to and doesn't use
Nick Lewycky [Sun, 20 Sep 2009 07:00:24 +0000 (07:00 +0000)]
Rewrite this check so that it checks what it's supposed to and doesn't use
CHECK-NOT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82383 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoeliminate a use of strtoul.
Chris Lattner [Sun, 20 Sep 2009 06:58:54 +0000 (06:58 +0000)]
eliminate a use of strtoul.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82382 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosplit random COFF asmprinter state out to X86COFFMachineModuleInfo.h.
Chris Lattner [Sun, 20 Sep 2009 06:45:52 +0000 (06:45 +0000)]
split random COFF asmprinter state out to X86COFFMachineModuleInfo.h.
Make dllexport directives come out in determinstic order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82381 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCorrect the comment; this applies to fcmp too.
Nick Lewycky [Sun, 20 Sep 2009 06:27:35 +0000 (06:27 +0000)]
Correct the comment; this applies to fcmp too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82380 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove tab, again.
Nick Lewycky [Sun, 20 Sep 2009 06:26:34 +0000 (06:26 +0000)]
Remove tab, again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82379 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTeach the constant folder how to not a cmpinst.
Nick Lewycky [Sun, 20 Sep 2009 06:24:51 +0000 (06:24 +0000)]
Teach the constant folder how to not a cmpinst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82378 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosmallvectorize getExtraOptionNames
Chris Lattner [Sun, 20 Sep 2009 06:21:43 +0000 (06:21 +0000)]
smallvectorize getExtraOptionNames

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82377 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a helper method.
Chris Lattner [Sun, 20 Sep 2009 06:21:20 +0000 (06:21 +0000)]
add a helper method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82376 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agominor cleanups.
Chris Lattner [Sun, 20 Sep 2009 06:18:38 +0000 (06:18 +0000)]
minor cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82375 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd 'make check-all', which runs the LLVM tests along with the clang tests if
Daniel Dunbar [Sun, 20 Sep 2009 06:17:21 +0000 (06:17 +0000)]
Add 'make check-all', which runs the LLVM tests along with the clang tests if
its in the standard location.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82374 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFollow googletest logic for suppressing warnings in unittests/UnitTestMain.
Daniel Dunbar [Sun, 20 Sep 2009 06:17:12 +0000 (06:17 +0000)]
Follow googletest logic for suppressing warnings in unittests/UnitTestMain.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82373 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agostrength reduce further StringRef-> const char*, saving another 620 bytes.
Chris Lattner [Sun, 20 Sep 2009 05:53:47 +0000 (05:53 +0000)]
strength reduce further StringRef-> const char*, saving another 620 bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82372 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTry turning icmp(bitcast(x), bitcast(y)) into icmp(bitcast(bitcast(x)), y) in
Nick Lewycky [Sun, 20 Sep 2009 05:48:50 +0000 (05:48 +0000)]
Try turning icmp(bitcast(x), bitcast(y)) into icmp(bitcast(bitcast(x)), y) in
the hopes that the two bitcasts will merge.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82371 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoswitch an std::string to StringRef, shaving 400 bytes off CommandLine.o
Chris Lattner [Sun, 20 Sep 2009 05:48:01 +0000 (05:48 +0000)]
switch an std::string to StringRef, shaving 400 bytes off CommandLine.o

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82370 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove tabs I added.
Nick Lewycky [Sun, 20 Sep 2009 05:47:45 +0000 (05:47 +0000)]
Remove tabs I added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82369 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agothe switch from std::map -> StringMap caused --help output to be in
Chris Lattner [Sun, 20 Sep 2009 05:37:24 +0000 (05:37 +0000)]
the switch from std::map -> StringMap caused --help output to be in
non-sorted order, restore the sort.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82368 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoeliminate the duplicate detection loop, moving it into the loop that populates the...
Chris Lattner [Sun, 20 Sep 2009 05:22:52 +0000 (05:22 +0000)]
eliminate the duplicate detection loop, moving it into the loop that populates the Opts vector in the first place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82367 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEliminate a masochistic "algorithm" loop, shrinking CommandLine.o from 71524->70700...
Chris Lattner [Sun, 20 Sep 2009 05:18:28 +0000 (05:18 +0000)]
Eliminate a masochistic "algorithm" loop, shrinking CommandLine.o from 71524->70700 bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82366 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agodon't use count + insert, just do insert + failure. Also, instead of deleting from
Chris Lattner [Sun, 20 Sep 2009 05:15:12 +0000 (05:15 +0000)]
don't use count + insert, just do insert + failure.  Also, instead of deleting from
the middle of a vector, swap the last element in and pop_back.  Also saves 330 bytes :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82365 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoswitch to SmallPtrSet instead of std::set, saving 1K from the
Chris Lattner [Sun, 20 Sep 2009 05:12:14 +0000 (05:12 +0000)]
switch to SmallPtrSet instead of std::set, saving 1K from the
release-asserts .o file (72900->71856).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82364 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agochange an std::sort to an array_pod_sort call, shrinking CommandLine.o by 9%.
Chris Lattner [Sun, 20 Sep 2009 05:06:23 +0000 (05:06 +0000)]
change an std::sort to an array_pod_sort call, shrinking CommandLine.o by 9%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82363 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSeveral changes together in a murky mess:
Chris Lattner [Sun, 20 Sep 2009 05:03:30 +0000 (05:03 +0000)]
Several changes together in a murky mess:
1. Change some "\n" -> '\n'.
2. eliminte some std::string's by using raw_ostream::indent.
3. move a bunch of code out of the main arg parser routine into
   a new static HandlePrefixedOrGroupedOption function.
4. Greatly simplify the implementation of getOptionPred, and make
   it avoid splitting prefix options at = when that doesn't match
   a non-prefix option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82362 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoClean up the usage of evaluateICmpRelation's return value.
Nick Lewycky [Sun, 20 Sep 2009 04:27:06 +0000 (04:27 +0000)]
Clean up the usage of evaluateICmpRelation's return value.
Add another line to the ConstantExprFold test to demonstrate the GEPs may not
wrap around in either the signed or unsigned senses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82361 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix refacto, this code was expecting to stride past the argument prefix.
Daniel Dunbar [Sun, 20 Sep 2009 04:03:41 +0000 (04:03 +0000)]
Fix refacto, this code was expecting to stride past the argument prefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82360 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStrip trailing whitespace.
Daniel Dunbar [Sun, 20 Sep 2009 04:03:34 +0000 (04:03 +0000)]
Strip trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82359 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoA few more tabs -> spaces.
Daniel Dunbar [Sun, 20 Sep 2009 04:03:25 +0000 (04:03 +0000)]
A few more tabs -> spaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82358 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove dead store by taking a guess at what Chris meant. I wasn't able to
Nick Lewycky [Sun, 20 Sep 2009 03:48:46 +0000 (03:48 +0000)]
Remove dead store by taking a guess at what Chris meant. I wasn't able to
design a testcase that would tickle this behaviour.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82357 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStill one more thing wrong here...
Bill Wendling [Sun, 20 Sep 2009 02:27:06 +0000 (02:27 +0000)]
Still one more thing wrong here...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82356 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTabs -> spaces, and remove trailing whitespace.
Daniel Dunbar [Sun, 20 Sep 2009 02:20:51 +0000 (02:20 +0000)]
Tabs -> spaces, and remove trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82355 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHere's fun! It turns out that these filter functions can be internal. If they're
Bill Wendling [Sun, 20 Sep 2009 02:19:49 +0000 (02:19 +0000)]
Here's fun! It turns out that these filter functions can be internal. If they're
internal, they shouldn't use the indirect pointer stuff. In the case of
throw_rethrow_test, it was marked as 'internal' and calculated its own offset to
its contents.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82354 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDelete dead code. sext and zext can not turn integers into pointers. Further,
Nick Lewycky [Sun, 20 Sep 2009 02:11:47 +0000 (02:11 +0000)]
Delete dead code. sext and zext can not turn integers into pointers. Further,
the optimization described in the comment is only valid with target data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82353 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoconvert argname to StringRef, simplifying LookupOption.
Chris Lattner [Sun, 20 Sep 2009 02:02:24 +0000 (02:02 +0000)]
convert argname to StringRef, simplifying LookupOption.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82352 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoconvert 'Value' to StringRef which makes it easier to
Chris Lattner [Sun, 20 Sep 2009 01:53:12 +0000 (01:53 +0000)]
convert 'Value' to StringRef which makes it easier to
maintain the "null is unspecified, empty is empty" semantics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82351 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange CommaSeparated processing to do it with StringRef instead of temporary std...
Chris Lattner [Sun, 20 Sep 2009 01:49:31 +0000 (01:49 +0000)]
Change CommaSeparated processing to do it with StringRef instead of temporary std::strings.
This requires StringRef'izing ProvideOption which I also did.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82350 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoValue* were never meant to be const. Removing constness from the constant
Nick Lewycky [Sun, 20 Sep 2009 01:35:59 +0000 (01:35 +0000)]
Value* were never meant to be const. Removing constness from the constant
folder removes a lot of const_casting and requires no changes to clang or
llvm-gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82349 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorewrite ParseCStringVector in terms of stringref.
Chris Lattner [Sun, 20 Sep 2009 01:33:46 +0000 (01:33 +0000)]
rewrite ParseCStringVector in terms of stringref.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82348 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomove a couple non-trivial methods out of line, add new
Chris Lattner [Sun, 20 Sep 2009 01:22:16 +0000 (01:22 +0000)]
move a couple non-trivial methods out of line, add new
find_first_of/find_first_of methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82347 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agocoding style cleanup
Chris Lattner [Sun, 20 Sep 2009 01:11:23 +0000 (01:11 +0000)]
coding style cleanup

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82346 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoconvert a bunch more stuff to use StringRef. The ArgName arguments are now
Chris Lattner [Sun, 20 Sep 2009 00:40:49 +0000 (00:40 +0000)]
convert a bunch more stuff to use StringRef.  The ArgName arguments are now
stringref because they may not be nul terminated.  For options like -Lfoo
this now avoids a O(n)  temporary std::strings where N is the length of
the string after -L.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82345 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd size_t and a version of rfind that allows specification of where
Chris Lattner [Sun, 20 Sep 2009 00:38:28 +0000 (00:38 +0000)]
add size_t and a version of rfind that allows specification of where
to scan from.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82343 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen computing live intervals for earlyclobber operands,
Dale Johannesen [Sun, 20 Sep 2009 00:36:41 +0000 (00:36 +0000)]
When computing live intervals for earlyclobber operands,
we pushed the beginning of the interval back 1, so the
interval would overlap with inputs that die.  We were
also pushing the end of the interval back 1, though,
which means the earlyclobber didn't overlap with other
output operands.  Don't do this.  PR 4964.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82342 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoavoid a bunch of malloc thrashing for PositinoalVals by eliminating
Chris Lattner [Sun, 20 Sep 2009 00:07:40 +0000 (00:07 +0000)]
avoid a bunch of malloc thrashing for PositinoalVals by eliminating
a std::vector and a bunch of std::string temporaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82341 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTeach the constant folder how to handle a few simple i1 cases.
Nick Lewycky [Sun, 20 Sep 2009 00:04:02 +0000 (00:04 +0000)]
Teach the constant folder how to handle a few simple i1 cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82340 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAvoid some temporary strings.
Chris Lattner [Sat, 19 Sep 2009 23:59:02 +0000 (23:59 +0000)]
Avoid some temporary strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82339 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd some more overloads of StringRef::getAsInteger for
Chris Lattner [Sat, 19 Sep 2009 23:58:48 +0000 (23:58 +0000)]
add some more overloads of StringRef::getAsInteger for
common and useful integer types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82338 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a simple c_str() method to SmallString.
Chris Lattner [Sat, 19 Sep 2009 23:57:31 +0000 (23:57 +0000)]
add a simple c_str() method to SmallString.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82337 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevert r82274. It's causing failures in the CINT2006 benchmarks.
Bill Wendling [Sat, 19 Sep 2009 22:02:37 +0000 (22:02 +0000)]
Revert r82274. It's causing failures in the CINT2006 benchmarks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82336 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPrefer super class constructor to explicit initialization.
Daniel Dunbar [Sat, 19 Sep 2009 20:40:28 +0000 (20:40 +0000)]
Prefer super class constructor to explicit initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82335 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTabs -> spaces (really?)
Daniel Dunbar [Sat, 19 Sep 2009 20:40:21 +0000 (20:40 +0000)]
Tabs -> spaces (really?)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82334 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix indentation.
Daniel Dunbar [Sat, 19 Sep 2009 20:40:14 +0000 (20:40 +0000)]
Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82333 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStrip trailing whitespace.
Daniel Dunbar [Sat, 19 Sep 2009 20:40:05 +0000 (20:40 +0000)]
Strip trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82332 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRHS of assignment should be const reference.
Daniel Dunbar [Sat, 19 Sep 2009 20:39:50 +0000 (20:39 +0000)]
RHS of assignment should be const reference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82331 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove the default value for ConstantStruct::get's isPacked parameter and
Nick Lewycky [Sat, 19 Sep 2009 20:30:26 +0000 (20:30 +0000)]
Remove the default value for ConstantStruct::get's isPacked parameter and
update the code which was broken by this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82327 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoprovide a "strtoull" operation that works on StringRef's.
Chris Lattner [Sat, 19 Sep 2009 19:47:14 +0000 (19:47 +0000)]
provide a "strtoull" operation that works on StringRef's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82322 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a comment explaining why you would ever want to do this.
Nick Lewycky [Sat, 19 Sep 2009 19:00:06 +0000 (19:00 +0000)]
Add a comment explaining why you would ever want to do this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82319 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoconvert a bunch of std::strings to use StringRef. This should eliminate
Chris Lattner [Sat, 19 Sep 2009 18:55:05 +0000 (18:55 +0000)]
convert a bunch of std::strings to use StringRef.  This should eliminate
a massive number of temporary strings created when parsing a command line.
More still left to eliminate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82318 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoLett users of sparse propagation do their own thing with phi nodes if they want
Nick Lewycky [Sat, 19 Sep 2009 18:33:36 +0000 (18:33 +0000)]
Lett users of sparse propagation do their own thing with phi nodes if they want
to. This can be combined with LCSSA or SSI form to store more information on a
PHINode than can be computed by looking at its incoming values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82317 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThe flag "--dot-cfg-only" is at the moment equivalent to the flag "--dot-cfg".
Duncan Sands [Sat, 19 Sep 2009 11:25:44 +0000 (11:25 +0000)]
The flag "--dot-cfg-only" is at the moment equivalent to the flag "--dot-cfg".
It prints the content of all bbs, instead of printing empty bbs to make the
CFG more readable.  Fix this.  Patch by Tobias Grosser.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82315 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix funky comments.
Evan Cheng [Sat, 19 Sep 2009 10:09:15 +0000 (10:09 +0000)]
Fix funky comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82314 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate comments.
Evan Cheng [Sat, 19 Sep 2009 10:08:51 +0000 (10:08 +0000)]
Update comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82313 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTry to speed up the slowest parts of the CommandLine library
Benjamin Kramer [Sat, 19 Sep 2009 10:01:45 +0000 (10:01 +0000)]
Try to speed up the slowest parts of the CommandLine library

- Replace std::map<std::string with StringMap
- Eliminate unnecessary std::string copies
- ~10% speed-up for clang's testsuite on my machine (debug build)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82312 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PR4926. When target hook EmitInstrWithCustomInserter() insert new basic blocks...
Evan Cheng [Sat, 19 Sep 2009 09:51:03 +0000 (09:51 +0000)]
Fix PR4926. When target hook EmitInstrWithCustomInserter() insert new basic blocks and update CFG, it should also inform sdisel of the changes so the phi source operands will come from the right basic blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82311 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnhance transform passes so that they apply the same tranforms to malloc calls as...
Victor Hernandez [Fri, 18 Sep 2009 22:35:49 +0000 (22:35 +0000)]
Enhance transform passes so that they apply the same tranforms to malloc calls as to MallocInst.

Reviewed by Dan Gohman.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82300 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove an extraneous mem2reg pass early in the pipe. Since
Chris Lattner [Fri, 18 Sep 2009 22:03:29 +0000 (22:03 +0000)]
remove an extraneous mem2reg pass early in the pipe.  Since
this is run after the 'standard function passes', SRoA was
recently run.  This saves a domfrontier construction. Thanks
to Eli for noticing this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82291 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoreduce indentation by using an early exit, and add a comment,
Chris Lattner [Fri, 18 Sep 2009 22:01:30 +0000 (22:01 +0000)]
reduce indentation by using an early exit, and add a comment,
no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82290 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix a comment typo and some whitespace.
Bob Wilson [Fri, 18 Sep 2009 21:43:11 +0000 (21:43 +0000)]
Fix a comment typo and some whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82285 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix a typo in an assertion message.
Bob Wilson [Fri, 18 Sep 2009 21:42:44 +0000 (21:42 +0000)]
Fix a typo in an assertion message.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82284 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFactor out label difference creation.
Bill Wendling [Fri, 18 Sep 2009 21:37:56 +0000 (21:37 +0000)]
Factor out label difference creation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82282 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnhance analysis passes so that they apply the same analysis to malloc calls as to...
Victor Hernandez [Fri, 18 Sep 2009 21:34:51 +0000 (21:34 +0000)]
Enhance analysis passes so that they apply the same analysis to malloc calls as to MallocInst.

Reviewed by Eli Friedman.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82281 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDelete the label names from this test to make it less fragile.
Dan Gohman [Fri, 18 Sep 2009 21:23:12 +0000 (21:23 +0000)]
Delete the label names from this test to make it less fragile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82276 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIt's inefficient to have place the exception tables (which contain the LSDA)
Bill Wendling [Fri, 18 Sep 2009 21:14:36 +0000 (21:14 +0000)]
It's inefficient to have place the exception tables (which contain the LSDA)
into the __DATA section. At launch time, dyld has to update most of the section
to fix up the type info pointers. It's better to place it into the __TEXT
section and use pc-rel indirect pointer encodings. Similar to the personality
routine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82274 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnhance EmitInstrWithCustomInserter() so target can specify CFG changes that sdisel...
Evan Cheng [Fri, 18 Sep 2009 21:02:19 +0000 (21:02 +0000)]
Enhance EmitInstrWithCustomInserter() so target can specify CFG changes that sdisel will use to properly complete phi nodes.
Not functionality change yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82273 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix cmake build, which has a different -I that
Shantonu Sen [Fri, 18 Sep 2009 20:35:59 +0000 (20:35 +0000)]
Fix cmake build, which has a different -I that
causes the "../foo" to not find the file

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82270 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake a new X8632_MachoTargetObjectFile TLOF implementation whose
Chris Lattner [Fri, 18 Sep 2009 20:22:52 +0000 (20:22 +0000)]
Make a new X8632_MachoTargetObjectFile TLOF implementation whose
getSymbolForDwarfGlobalReference is smart enough to know that it
needs to register the stub it references with MachineModuleInfoMachO,
so that it gets emitted at the end of the file.

Move stub emission from X86ATTAsmPrinter::doFinalization to the
new X86ATTAsmPrinter::EmitEndOfAsmFile asmprinter hook.  The important
thing here is that EmitEndOfAsmFile is called *after* the ehframes are
emitted, so we get all the stubs.

This allows us to remove a gross hack from the asmprinter where it would
"just know" that it needed to output stubs for personality functions.
Now this is all driven from a consistent interface.

The testcase change is just reordering the expected output now that the
stubs come out after the ehframe instead of before.

This also unblocks other changes that Bill wants to make.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82269 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a new hook to allow targets to splat stuff at the end of the file.
Chris Lattner [Fri, 18 Sep 2009 20:17:03 +0000 (20:17 +0000)]
add a new hook to allow targets to splat stuff at the end of the file.
Overriding doFinalization is pretty lame.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82268 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoModel the carry bit on ppc32. Without this we could
Dale Johannesen [Fri, 18 Sep 2009 20:15:22 +0000 (20:15 +0000)]
Model the carry bit on ppc32.  Without this we could
move a SUBFC (etc.) below the SUBFE (etc.) that consumed
the carry bit.  Add missing ADDIC8, noticed along the way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82266 91177308-0d34-0410-b5e6-96231b3b80d8