oota-llvm.git
14 years agoadd a twine form of MCStreamer::EmitRawText, and mc'ize
Chris Lattner [Sat, 3 Apr 2010 22:12:35 +0000 (22:12 +0000)]
add a twine form of MCStreamer::EmitRawText, and mc'ize
a few more things in AsmPrinter.cpp.

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

14 years agoallow attaching comments to raw text.
Chris Lattner [Sat, 3 Apr 2010 22:06:56 +0000 (22:06 +0000)]
allow attaching comments to raw text.

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

14 years agostart moving towards emitting inline asm statements with
Chris Lattner [Sat, 3 Apr 2010 22:01:50 +0000 (22:01 +0000)]
start moving towards emitting inline asm statements with
EmitInlineAsm.  However, this attempt is foiled by operands
being emitted directly to "O" so I'll have to do some surgery
and finish MCizing the world.

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

14 years agoadd <cstdlib> header for abort() on linux builders.
Chris Lattner [Sat, 3 Apr 2010 21:48:59 +0000 (21:48 +0000)]
add <cstdlib> header for abort() on linux builders.

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

14 years agoadd a new EmitInlineAsm function to asmprinter to handle inline asm.
Chris Lattner [Sat, 3 Apr 2010 21:35:55 +0000 (21:35 +0000)]
add a new EmitInlineAsm function to asmprinter to handle inline asm.
If we have an MCAsmStreamer, we continue to emit asm textually,
otherwise we (currently) emit an error to errs and ignore it.

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

14 years agomc'ize comment printing around file scope inline asm.
Chris Lattner [Sat, 3 Apr 2010 21:13:18 +0000 (21:13 +0000)]
mc'ize comment printing around file scope inline asm.

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

14 years agoremove some extraneous casts
Chris Lattner [Sat, 3 Apr 2010 21:03:50 +0000 (21:03 +0000)]
remove some extraneous casts

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

14 years agorequire that the branch being controlled by the IV
Chris Lattner [Sat, 3 Apr 2010 07:21:39 +0000 (07:21 +0000)]
require that the branch being controlled by the IV
exits the loop.  With this information we can guarantee
the iteration count of the loop is bounded by the
compare.  I think this xforms is finally safe now.

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

14 years agoadd integer overflow check for the fp induction variable
Chris Lattner [Sat, 3 Apr 2010 07:18:48 +0000 (07:18 +0000)]
add integer overflow check for the fp induction variable
checker.  Amusingly, we already had tests that we should
have rejects because they would be miscompiled in the
testsuite.

The remaining issue with this is that we don't check that
the branch causes us to exit the loop if it fails, so we
don't actually know if we remain in bounds.

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

14 years agoadd a comment and fix some consistency issues, converting
Chris Lattner [Sat, 3 Apr 2010 06:41:49 +0000 (06:41 +0000)]
add a comment and fix some consistency issues, converting
to a signed vs unsigned value depending on the sign of the
constant fp means that we can't distinguish between a
truly negative number and a positive number so large the
32nd bit is set.  So, do don't this!

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

14 years agofix PR6761, a miscompilation due to the fp->int IV conversion
Chris Lattner [Sat, 3 Apr 2010 06:30:03 +0000 (06:30 +0000)]
fix PR6761, a miscompilation due to the fp->int IV conversion
stuff.  More bugs remain though.

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

14 years agoconvert to filecheck
Chris Lattner [Sat, 3 Apr 2010 06:27:56 +0000 (06:27 +0000)]
convert to filecheck

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

14 years agojust eliminate the uitofp checks. This code isn't doing
Chris Lattner [Sat, 3 Apr 2010 06:25:21 +0000 (06:25 +0000)]
just eliminate the uitofp checks.  This code isn't doing
the required validity checks in the first place, and supporting
a condition large enough to require the 32'nd bit isn't worth it.

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

14 years agorename feature test.
Chris Lattner [Sat, 3 Apr 2010 06:24:28 +0000 (06:24 +0000)]
rename feature test.

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

14 years agoactually just remove this, will move the real feature test here.
Chris Lattner [Sat, 3 Apr 2010 06:24:03 +0000 (06:24 +0000)]
actually just remove this, will move the real feature test here.

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

14 years agorename test since it is a feature test.
Chris Lattner [Sat, 3 Apr 2010 06:22:52 +0000 (06:22 +0000)]
rename test since it is a feature test.

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

14 years agorename PH -> PN to be consistent with WeakPN and the rest
Chris Lattner [Sat, 3 Apr 2010 06:17:08 +0000 (06:17 +0000)]
rename PH -> PN to be consistent with WeakPN and the rest
of llvm.

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

14 years agoimprove comment and drop a dead check. If PH had
Chris Lattner [Sat, 3 Apr 2010 06:16:22 +0000 (06:16 +0000)]
improve comment and drop a dead check.  If PH had
no uses, it would have been deleted by
RecursivelyDeleteTriviallyDeadInstructions

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

14 years agostrength reduce a ridiculous use of APInt.
Chris Lattner [Sat, 3 Apr 2010 06:13:12 +0000 (06:13 +0000)]
strength reduce a ridiculous use of APInt.

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

14 years agorename stuff improve comment grammar.
Chris Lattner [Sat, 3 Apr 2010 06:11:07 +0000 (06:11 +0000)]
rename stuff improve comment grammar.

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

14 years agosimplify some code and resolve a fixme.
Chris Lattner [Sat, 3 Apr 2010 06:06:59 +0000 (06:06 +0000)]
simplify some code and resolve a fixme.

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

14 years agoThere is no guarantee that the increment and the branch
Chris Lattner [Sat, 3 Apr 2010 06:05:10 +0000 (06:05 +0000)]
There is no guarantee that the increment and the branch
are in the same block.  Insert the new increment in the
correct location.

Also, more cleanups.

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

14 years agofirst half of a pass through IndVarSimplify::HandleFloatingPointIV,
Chris Lattner [Sat, 3 Apr 2010 05:54:59 +0000 (05:54 +0000)]
first half of a pass through IndVarSimplify::HandleFloatingPointIV,
this cleans up a bunch of code and also fixes several crashes and
miscompiles.  More to come unfortunately, this optimization
is quite broken.

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

14 years agodon't internalize available_externally functions, they are
Chris Lattner [Sat, 3 Apr 2010 05:24:50 +0000 (05:24 +0000)]
don't internalize available_externally functions, they are
really just declarations.  This is related to PR6524

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

14 years agoFix a warning in GCC about a pointless typedef.
Chandler Carruth [Sat, 3 Apr 2010 04:45:24 +0000 (04:45 +0000)]
Fix a warning in GCC about a pointless typedef.

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

14 years agoAdd the new ARMDecodeEmitter to CMake build.
Chandler Carruth [Sat, 3 Apr 2010 04:36:43 +0000 (04:36 +0000)]
Add the new ARMDecodeEmitter to CMake build.

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

14 years agoGet rid of the middleman (ARMAlgorithm), which causes more trouble than the
Johnny Chen [Sat, 3 Apr 2010 04:10:56 +0000 (04:10 +0000)]
Get rid of the middleman (ARMAlgorithm), which causes more trouble than the
abstraction it brings.  And also get rid of the atexit() handler, it does not
belong in the lib directory. :-)

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

14 years agoRevert all my SSAUpdater patches. The PHI placement algorithm is not correct
Bob Wilson [Sat, 3 Apr 2010 03:50:38 +0000 (03:50 +0000)]
Revert all my SSAUpdater patches.  The PHI placement algorithm is not correct
(what was I thinking?) and there's also a problem with LCSSA.  I'll try again
later with fixes.

--- Reverse-merging r100263 into '.':
U    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100177 into '.':
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100148 into '.':
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100147 into '.':
U    include/llvm/Transforms/Utils/SSAUpdater.h
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100131 into '.':
G    include/llvm/Transforms/Utils/SSAUpdater.h
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100130 into '.':
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100126 into '.':
G    include/llvm/Transforms/Utils/SSAUpdater.h
G    lib/Transforms/Utils/SSAUpdater.cpp
--- Reverse-merging r100050 into '.':
D    test/Transforms/GVN/2010-03-31-RedundantPHIs.ll
--- Reverse-merging r100047 into '.':
G    include/llvm/Transforms/Utils/SSAUpdater.h
G    lib/Transforms/Utils/SSAUpdater.cpp

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

14 years agoAdd a DEBUG_TYPE for the SSAUpdater.
Bob Wilson [Sat, 3 Apr 2010 03:28:44 +0000 (03:28 +0000)]
Add a DEBUG_TYPE for the SSAUpdater.

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

14 years agoCode refactoring.
Evan Cheng [Sat, 3 Apr 2010 02:23:43 +0000 (02:23 +0000)]
Code refactoring.

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

14 years agoAdd special case bitcode support for DebugLoc. This avoids
Chris Lattner [Sat, 3 Apr 2010 02:17:50 +0000 (02:17 +0000)]
Add special case bitcode support for DebugLoc.  This avoids
having the bitcode writer materialize mdnodes for all the
debug location tuples when writing out the bc file and
stores the information in a more compact form.  For example,
the -O0 -g bc file for combine.c in 176.gcc shrinks from
739392 to 512096 bytes.

This concludes my planned short-term debug info work.

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

14 years agoPass -shared to the linker.
Mikhail Glushenkov [Sat, 3 Apr 2010 02:00:03 +0000 (02:00 +0000)]
Pass -shared to the linker.

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

14 years agoFix comment.
Johnny Chen [Sat, 3 Apr 2010 01:17:30 +0000 (01:17 +0000)]
Fix comment.

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

14 years agoRegister ARMAlgorithm::DoCleanup() to be called on exit to free the memory
Johnny Chen [Sat, 3 Apr 2010 01:09:47 +0000 (01:09 +0000)]
Register ARMAlgorithm::DoCleanup() to be called on exit to free the memory
occuplied by the cached ARMAlgorithm objects.

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

14 years agoadd a couple missing enum names.
Chris Lattner [Sat, 3 Apr 2010 01:05:24 +0000 (01:05 +0000)]
add a couple missing enum names.

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

14 years agoRewrite aesimc handling. It only takes a single input and has a single
Eric Christopher [Fri, 2 Apr 2010 23:48:33 +0000 (23:48 +0000)]
Rewrite aesimc handling.  It only takes a single input and has a single
dest.

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

14 years agoFix another build warning.
Johnny Chen [Fri, 2 Apr 2010 23:43:38 +0000 (23:43 +0000)]
Fix another build warning.

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

14 years agoFix typo aeskeygenassist -> aeskeygenassist128.
Eric Christopher [Fri, 2 Apr 2010 23:29:36 +0000 (23:29 +0000)]
Fix typo aeskeygenassist -> aeskeygenassist128.

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

14 years agoOk, third time's the charm. No changes from last time except the CMake
David Greene [Fri, 2 Apr 2010 23:17:14 +0000 (23:17 +0000)]
Ok, third time's the charm.  No changes from last time except the CMake
source addition.  Apparently the buildbots were wrong about failures.

---

Add some switches helpful for debugging:

-print-before=<Pass Name>

Dump IR before running pass <Pass Name>.

-print-before-all

Dump IR before running each pass.

-print-after-all

Dump IR after running each pass.

These are helpful when tracking down a miscompilation.  It is easy to
get IR dumps and do diffs on them, etc.

To make this work well, add a new getPrinterPass API to Pass so that
each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass
suitable for dumping out the kind of object the Pass works on.

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

14 years agoMove variable "Bits" declaration/definition into the DEBUG block where its usage
Johnny Chen [Fri, 2 Apr 2010 23:13:52 +0000 (23:13 +0000)]
Move variable "Bits" declaration/definition into the DEBUG block where its usage
is expected.

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

14 years agoFixed build warning.
Johnny Chen [Fri, 2 Apr 2010 22:51:04 +0000 (22:51 +0000)]
Fixed build warning.

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

14 years agoChange from .../Support/DataTypes.h to .../System/DataTypes.h.
Johnny Chen [Fri, 2 Apr 2010 22:41:06 +0000 (22:41 +0000)]
Change from .../Support/DataTypes.h to .../System/DataTypes.h.
(Fix build failure)

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

14 years agoSecond try of initial ARM/Thumb disassembler check-in. It consists of a tablgen
Johnny Chen [Fri, 2 Apr 2010 22:27:38 +0000 (22:27 +0000)]
Second try of initial ARM/Thumb disassembler check-in.  It consists of a tablgen
backend (ARMDecoderEmitter) which emits the decoder functions for ARM and Thumb,
and the disassembler core which invokes the decoder function and builds up the
MCInst based on the decoded Opcode.

Reviewed by Chris Latter and Bob Wilson.

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

14 years agoAdded support for reporting operand token ranges
Sean Callanan [Fri, 2 Apr 2010 22:27:05 +0000 (22:27 +0000)]
Added support for reporting operand token ranges
to the ARM AsmParser.

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

14 years agoSeparate out the AES-NI instructions from the SSE4.2 instructions. Add
Eric Christopher [Fri, 2 Apr 2010 21:54:27 +0000 (21:54 +0000)]
Separate out the AES-NI instructions from the SSE4.2 instructions.  Add
a new subtarget option for AES and check for the support.  Add "westmere"
line of processors and add AES-NI support to the core i7.

Add a couple of TODOs for information I couldn't verify.

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

14 years agoSkip debug info when looking for existing EH calls at the
Dale Johannesen [Fri, 2 Apr 2010 21:49:27 +0000 (21:49 +0000)]
Skip debug info when looking for existing EH calls at the
beginning of a block.

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

14 years agoFixes to the X86 disassembler. The disassembler will now
Sean Callanan [Fri, 2 Apr 2010 21:23:51 +0000 (21:23 +0000)]
Fixes to the X86 disassembler.  The disassembler will now
return an error status in all failure cases, printing
messages to debugs() only when debugging is enabled.

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

14 years agoFix anachronism.
Benjamin Kramer [Fri, 2 Apr 2010 20:47:05 +0000 (20:47 +0000)]
Fix anachronism.

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

14 years agoDebugInfoFinder::processModule was foiling my plot by
Chris Lattner [Fri, 2 Apr 2010 20:44:29 +0000 (20:44 +0000)]
DebugInfoFinder::processModule was foiling my plot by
materializing an MDNode for every debugloc.  don't do that! :)

"clang -g -S t.c" really no longer makes mdnodes for location
tuples now.

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

14 years agofix the llvm-x86_64-linux buildbot.
Chris Lattner [Fri, 2 Apr 2010 20:36:25 +0000 (20:36 +0000)]
fix the llvm-x86_64-linux buildbot.

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

14 years agoremove empty file.
Chris Lattner [Fri, 2 Apr 2010 20:26:36 +0000 (20:26 +0000)]
remove empty file.

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

14 years agoremove compatibility typedef.
Chris Lattner [Fri, 2 Apr 2010 20:26:07 +0000 (20:26 +0000)]
remove compatibility typedef.

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

14 years agorename NewDebugLoc -> DebugLoc, prune #includes in DebugLoc.h.
Chris Lattner [Fri, 2 Apr 2010 20:21:22 +0000 (20:21 +0000)]
rename NewDebugLoc -> DebugLoc, prune #includes in DebugLoc.h.

This keeps around temporary typedef for clang/llvm-gcc so the
build won't break when I commit this :)

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

14 years agoremove uses of DebugLoc::getUnknownLoc.
Chris Lattner [Fri, 2 Apr 2010 20:20:41 +0000 (20:20 +0000)]
remove uses of DebugLoc::getUnknownLoc.

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

14 years agoinclude densemap.h explicitly and rearrange #includes.
Chris Lattner [Fri, 2 Apr 2010 20:20:04 +0000 (20:20 +0000)]
include densemap.h explicitly and rearrange #includes.

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

14 years agostop using DebugLoc::getUnknownLoc()
Chris Lattner [Fri, 2 Apr 2010 20:17:23 +0000 (20:17 +0000)]
stop using DebugLoc::getUnknownLoc()

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

14 years agouse DebugLoc default ctor instead of DebugLoc::getUnknownLoc()
Chris Lattner [Fri, 2 Apr 2010 20:16:16 +0000 (20:16 +0000)]
use DebugLoc default ctor instead of DebugLoc::getUnknownLoc()

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

14 years agoSwitch the code generator (except the JIT) onto the new DebugLoc
Chris Lattner [Fri, 2 Apr 2010 19:42:39 +0000 (19:42 +0000)]
Switch the code generator (except the JIT) onto the new DebugLoc
representation.  This eliminates the 'DILocation' MDNodes for
file/line/col tuples from -O0 -g codegen.

This remove the old DebugLoc class, making it a typedef for DebugLoc,
I'll rename NewDebugLoc next.

I didn't update the JIT to use the new apis, so it will continue to
work, but be as slow as before.  Someone should eventually do this
or, better yet, rip out the JIT debug info stuff and build the JIT
on top of MC.

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

14 years agoCorrectly lower memset / memcpy of undef. It should be a nop. PR6767.
Evan Cheng [Fri, 2 Apr 2010 19:36:14 +0000 (19:36 +0000)]
Correctly lower memset / memcpy of undef. It should be a nop. PR6767.

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

14 years agoRevert 100204. It broke a bunch of tests and apparently changed what passes are run...
Evan Cheng [Fri, 2 Apr 2010 19:29:15 +0000 (19:29 +0000)]
Revert 100204. It broke a bunch of tests and apparently changed what passes are run during codegen.

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

14 years agoUpdate CMake.
Benjamin Kramer [Fri, 2 Apr 2010 19:09:51 +0000 (19:09 +0000)]
Update CMake.

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

14 years agoLet's try this again. Re-apply 100143 including an apparent missing
David Greene [Fri, 2 Apr 2010 18:46:26 +0000 (18:46 +0000)]
Let's try this again.  Re-apply 100143 including an apparent missing
<string> include.  For some reason the buildbot choked on this while my
builds did not.  It's probably due to a difference in system headers.

---

Add some switches helpful for debugging:

-print-before=<Pass Name>

Dump IR before running pass <Pass Name>.

-print-before-all

Dump IR before running each pass.

-print-after-all

Dump IR after running each pass.

These are helpful when tracking down a miscompilation.  It is easy to
get IR dumps and do diffs on them, etc.

To make this work well, add a new getPrinterPass API to Pass so that
each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass
suitable for dumping out the kind of object the Pass works on.

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

14 years agoRevert r100191 since it breaks objc in clang
Mon P Wang [Fri, 2 Apr 2010 18:43:02 +0000 (18:43 +0000)]
Revert r100191 since it breaks objc in clang

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

14 years agoReapply address space patch after fixing an issue in MemCopyOptimizer.
Mon P Wang [Fri, 2 Apr 2010 18:04:15 +0000 (18:04 +0000)]
Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)

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

14 years agoAdd an explicit keyword.
Dan Gohman [Fri, 2 Apr 2010 14:57:49 +0000 (14:57 +0000)]
Add an explicit keyword.

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

14 years agoManually notify ScalarEvolution before making an operand replacement, since
Dan Gohman [Fri, 2 Apr 2010 14:48:31 +0000 (14:48 +0000)]
Manually notify ScalarEvolution before making an operand replacement, since
it can't currently observe such changes automatically.

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

14 years agoFix SpecificBumpPtrAllocator iteration.
Torok Edwin [Fri, 2 Apr 2010 13:20:51 +0000 (13:20 +0000)]
Fix SpecificBumpPtrAllocator iteration.

Need to start from (char*)(Slab+1), and not from (char*)Slab+1.
This fixes crashes in Win64 debug mode.
Thanks to Nicolas Capens!

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

14 years agoAdd notes about dragonegg.
Duncan Sands [Fri, 2 Apr 2010 09:23:15 +0000 (09:23 +0000)]
Add notes about dragonegg.

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

14 years agoRecommit 100158 now that the buildbots are happy again.
Bob Wilson [Fri, 2 Apr 2010 05:09:46 +0000 (05:09 +0000)]
Recommit 100158 now that the buildbots are happy again.

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

14 years agoRemove FIXME - if there's a better way to do this it isn't here.
Eric Christopher [Fri, 2 Apr 2010 04:32:37 +0000 (04:32 +0000)]
Remove FIXME - if there's a better way to do this it isn't here.

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

14 years agoRevert the recent alignment changes. They're broken for -Os because,
Dan Gohman [Fri, 2 Apr 2010 03:04:37 +0000 (03:04 +0000)]
Revert the recent alignment changes. They're broken for -Os because,
in particular, they end up aligning strings at 16-byte boundaries, and
there's no way for GlobalOpt to check OptForSize.

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

14 years agoAfter trivial coalescing, the MI being visited may have become a copy. Avoid adding...
Evan Cheng [Fri, 2 Apr 2010 02:21:24 +0000 (02:21 +0000)]
After trivial coalescing, the MI being visited may have become a copy. Avoid adding it to CSE hash table since copies aren't being considered for CSE and they may be deleted.
rdar://7819990

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

14 years agoTeach AnalyzeBranch, RemoveBranch and the branch
Dale Johannesen [Fri, 2 Apr 2010 01:38:09 +0000 (01:38 +0000)]
Teach AnalyzeBranch, RemoveBranch and the branch
folder to be tolerant of debug info following the
branch(es) at the end of a block.

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

14 years agoDisambiguate conditional expression for newer GCCs.
Chandler Carruth [Fri, 2 Apr 2010 01:31:24 +0000 (01:31 +0000)]
Disambiguate conditional expression for newer GCCs.

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

14 years agoRemove this initializer so that the optimizer doesn't convert
Dan Gohman [Fri, 2 Apr 2010 01:26:13 +0000 (01:26 +0000)]
Remove this initializer so that the optimizer doesn't convert
unaligned loads into aligned loads.

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

14 years agoUpdate this test for the new preferred alignment heuristics.
Dan Gohman [Fri, 2 Apr 2010 01:24:08 +0000 (01:24 +0000)]
Update this test for the new preferred alignment heuristics.

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

14 years agoRevert 100158 in case it is causing some of the buildbot problems.
Bob Wilson [Fri, 2 Apr 2010 01:22:49 +0000 (01:22 +0000)]
Revert 100158 in case it is causing some of the buildbot problems.

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

14 years agoUpdated the install location for EnhancedDisassembly
Sean Callanan [Fri, 2 Apr 2010 00:53:42 +0000 (00:53 +0000)]
Updated the install location for EnhancedDisassembly
on Mac OS X to use @rpath rather than an absolute
path.  Also allowed the version to be set using an
environment variable.

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

14 years agoChange variables which are exactly 16 bytes to be 16-byte-aligned too.
Dan Gohman [Fri, 2 Apr 2010 00:46:07 +0000 (00:46 +0000)]
Change variables which are exactly 16 bytes to be 16-byte-aligned too.
This fixes test/Transforms/GlobalOpt/gv-align.ll.

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

14 years agoMake globalopt refine global variable alignment.
Dan Gohman [Fri, 2 Apr 2010 00:14:16 +0000 (00:14 +0000)]
Make globalopt refine global variable alignment.

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

14 years agoCheck for terminating conditions before adding PHIs to the worklists.
Bob Wilson [Fri, 2 Apr 2010 00:10:41 +0000 (00:10 +0000)]
Check for terminating conditions before adding PHIs to the worklists.
This is more efficient than adding them to the worklist and then ignoring them.

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

14 years agoremove these merge-tracking properties as they
Gabor Greif [Fri, 2 Apr 2010 00:08:26 +0000 (00:08 +0000)]
remove these merge-tracking properties as they
might interfere with merges to other branches (as Dan pointed out)

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

14 years agoIf the bitcode reader input stream isn't a multiple of 4 bytes, it's more
Dan Gohman [Fri, 2 Apr 2010 00:03:51 +0000 (00:03 +0000)]
If the bitcode reader input stream isn't a multiple of 4 bytes, it's more
likely not a bitcode file at all, rather than being a bitcode file which
is truncated. Check for this case and issue a more relevant error message.

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

14 years agoRemove trailing whitespace.
Bob Wilson [Thu, 1 Apr 2010 23:06:38 +0000 (23:06 +0000)]
Remove trailing whitespace.

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

14 years agoRewrite another SSAUpdater function to avoid recursion.
Bob Wilson [Thu, 1 Apr 2010 23:05:58 +0000 (23:05 +0000)]
Rewrite another SSAUpdater function to avoid recursion.

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

14 years agoRevert r100143.
Eric Christopher [Thu, 1 Apr 2010 22:54:42 +0000 (22:54 +0000)]
Revert r100143.

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

14 years agoRevert r100117.
Devang Patel [Thu, 1 Apr 2010 22:47:29 +0000 (22:47 +0000)]
Revert r100117.

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

14 years agoAdd some switches helpful for debugging:
David Greene [Thu, 1 Apr 2010 22:43:57 +0000 (22:43 +0000)]
Add some switches helpful for debugging:

-print-before=<Pass Name>

Dump IR before running pass <Pass Name>.

-print-before-all

Dump IR before running each pass.

-print-after-all

Dump IR after running each pass.

These are helpful when tracking down a miscompilation.  It is easy to
get IR dumps and do diffs on them, etc.

To make this work well, add a new getPrinterPass API to Pass so that
each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass
suitable for dumping out the kind of object the Pass works on.

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

14 years agoIn 64-bit mode, use i64 to lower memcpy / memset instead of f64.
Evan Cheng [Thu, 1 Apr 2010 20:27:45 +0000 (20:27 +0000)]
In 64-bit mode, use i64 to lower memcpy / memset instead of f64.

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

14 years agoDo not eagerly record known previous location. DBG_VALUE may not cause a new label...
Devang Patel [Thu, 1 Apr 2010 20:22:44 +0000 (20:22 +0000)]
Do not eagerly record known previous location. DBG_VALUE may not cause a new label due to one or other reason.

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

14 years agoSkip checking preferred alignment of GVs defined in other translation units all together.
Evan Cheng [Thu, 1 Apr 2010 20:13:28 +0000 (20:13 +0000)]
Skip checking preferred alignment of GVs defined in other translation units all together.

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

14 years agoAdd comments about DstAlign and SrcAlign.
Evan Cheng [Thu, 1 Apr 2010 20:10:42 +0000 (20:10 +0000)]
Add comments about DstAlign and SrcAlign.

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

14 years agoChange another SSAUpdater function to avoid recursion.
Bob Wilson [Thu, 1 Apr 2010 20:04:30 +0000 (20:04 +0000)]
Change another SSAUpdater function to avoid recursion.

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

14 years agoSimplify the code to check for existing PHIs, now that it is only used in
Bob Wilson [Thu, 1 Apr 2010 19:53:48 +0000 (19:53 +0000)]
Simplify the code to check for existing PHIs, now that it is only used in
one place.  This removes the template function added in svn 94690.

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

14 years agoThe SSAUpdater should avoid recursive traversals of the CFG, since that may
Bob Wilson [Thu, 1 Apr 2010 18:46:59 +0000 (18:46 +0000)]
The SSAUpdater should avoid recursive traversals of the CFG, since that may
blow out the stack for really big functions.  Start by fixing an easy case.

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

14 years ago- Avoid using floating point stores to implement memset unless the value is zero.
Evan Cheng [Thu, 1 Apr 2010 18:19:11 +0000 (18:19 +0000)]
- Avoid using floating point stores to implement memset unless the value is zero.
- Do not try to infer GV alignment unless its type is sized. It's not possible to infer alignment if it has opaque type.

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

14 years agoSkip instructions until new scope is seen.
Devang Patel [Thu, 1 Apr 2010 17:32:01 +0000 (17:32 +0000)]
Skip instructions until new scope is seen.

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

14 years agoCosmetic changes.
Devang Patel [Thu, 1 Apr 2010 17:16:48 +0000 (17:16 +0000)]
Cosmetic changes.
Update comment, rename a local variable.

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

14 years agoRemove accidental include and add a comment.
Benjamin Kramer [Thu, 1 Apr 2010 14:39:55 +0000 (14:39 +0000)]
Remove accidental include and add a comment.

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

14 years agoVarious improvements to MemoryBuffer::getFile:
Benjamin Kramer [Thu, 1 Apr 2010 14:35:22 +0000 (14:35 +0000)]
Various improvements to MemoryBuffer::getFile:

- Use a RAII object to close the FD.
- Use sys::StrError instead of thread-unsafe strerror calls.
- Recover gracefully if read returns zero. This works around an issue on
  DragonFlyBSD where /dev/null has an st_size of 136 but we can't read 136 bytes
  from it.

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