oota-llvm.git
13 years agoPreserve line number information.
Devang Patel [Thu, 28 Apr 2011 22:48:14 +0000 (22:48 +0000)]
Preserve line number information.

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

13 years agoCoalesce some DEBUGs (moving an only-used-in-DEBUG variable's declaration into the...
Matt Beaumont-Gay [Thu, 28 Apr 2011 22:26:05 +0000 (22:26 +0000)]
Coalesce some DEBUGs (moving an only-used-in-DEBUG variable's declaration into the DEBUG)

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

13 years agoWe require threse bits to be zero, too.
Benjamin Kramer [Thu, 28 Apr 2011 21:38:51 +0000 (21:38 +0000)]
We require threse bits to be zero, too.

This shouldn't happen in practice because the icmp would be a constant.
Add a check so we don't miscompile code if something goes wrong.

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

13 years agoOnly read *predecessor once so as to fix a theoretical issue where it changes
Nick Lewycky [Thu, 28 Apr 2011 21:35:49 +0000 (21:35 +0000)]
Only read *predecessor once so as to fix a theoretical issue where it changes
between two reads (threading).

Fix an off-by-one in the indirect counter table that I meant to revert after an
earlier experiment. Whoops!

Implement GCOV_PREFIX. Doesn't handle GCOV_PREFIX_STRIP yet.

Fix an off-by-one in string emission. Extra whoops!

Tolerate DISubprograms that have null Function*'s attached to them. I don't yet
understand what this means, but it happens when you have a global static with
a non-trivial constructor/destructor.

Fix a crash on switch statements with a single successor (default-only).

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

13 years agoTarget/X86/MC: Add an option for disabling arith relaxation, for my own testing
Daniel Dunbar [Thu, 28 Apr 2011 21:23:31 +0000 (21:23 +0000)]
Target/X86/MC: Add an option for disabling arith relaxation, for my own testing
purposes.

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

13 years agoAdd the getExprForFDESymbol method that responsible for computing the
Rafael Espindola [Thu, 28 Apr 2011 21:04:39 +0000 (21:04 +0000)]
Add the getExprForFDESymbol method that responsible for computing the
expressions used in the FDE to refer to symbols.

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

13 years agoBeautify debug info probe output.
Devang Patel [Thu, 28 Apr 2011 20:46:18 +0000 (20:46 +0000)]
Beautify debug info probe output.

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

13 years agoAdd MemoryBuffer::getBufferKind() to report whether a memory buffer uses malloc'ed...
Ted Kremenek [Thu, 28 Apr 2011 20:34:18 +0000 (20:34 +0000)]
Add MemoryBuffer::getBufferKind() to report whether a memory buffer uses malloc'ed or mmap'ed memory.  This is for performance analysis.

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

13 years agoRemove DbgDeclare only if all uses are converted.
Devang Patel [Thu, 28 Apr 2011 20:32:02 +0000 (20:32 +0000)]
Remove DbgDeclare only if all uses are converted.

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

13 years agoRemove bounded StringRef::compare() since nothing but Clang SA was using it and it...
Lenny Maiorani [Thu, 28 Apr 2011 20:20:12 +0000 (20:20 +0000)]
Remove bounded StringRef::compare() since nothing but Clang SA was using it and it is just as easy to use StringRef::substr() preceding StringRef::compare() to achieve the same thing.

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

13 years agofast-isel sret calls, try 2. We actually do need to do something on x86-32. rdar...
Eli Friedman [Thu, 28 Apr 2011 20:19:12 +0000 (20:19 +0000)]
fast-isel sret calls, try 2.  We actually do need to do something on x86-32. rdar://problem/9303592 .

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

13 years agoFix a comment.
Benjamin Kramer [Thu, 28 Apr 2011 20:09:57 +0000 (20:09 +0000)]
Fix a comment.

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

13 years agoimprove comment.
Chris Lattner [Thu, 28 Apr 2011 20:02:57 +0000 (20:02 +0000)]
improve comment.

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

13 years agoDo not lose line number info while eliminating tail call.
Devang Patel [Thu, 28 Apr 2011 18:43:39 +0000 (18:43 +0000)]
Do not lose line number info while eliminating tail call.

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

13 years agoActually revert r130348 correctly.
Eli Friedman [Thu, 28 Apr 2011 18:20:24 +0000 (18:20 +0000)]
Actually revert r130348 correctly.

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

13 years agofinal step needed to resolve PR6627, which allows us to flatten the code down to
Chris Lattner [Thu, 28 Apr 2011 18:15:47 +0000 (18:15 +0000)]
final step needed to resolve PR6627, which allows us to flatten the code down to
a nice and tidy:
  %x1 = load i32* %0, align 4
  %1 = icmp eq i32 %x1, 1179403647
  br i1 %1, label %if.then, label %if.end

instead of doing lots of loads and branches.  May the FreeBSD bootloader
long fit in its allocated space.

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

13 years agocode cleanups only.
Chris Lattner [Thu, 28 Apr 2011 18:08:21 +0000 (18:08 +0000)]
code cleanups only.

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

13 years agoRevert r130348; causing buildbot issues on x86-32.
Eli Friedman [Thu, 28 Apr 2011 18:06:10 +0000 (18:06 +0000)]
Revert r130348; causing buildbot issues on x86-32.

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

13 years agoFix a bug in tblgen that caused incorrect encodings on instructions that specified...
Owen Anderson [Thu, 28 Apr 2011 17:51:45 +0000 (17:51 +0000)]
Fix a bug in tblgen that caused incorrect encodings on instructions that specified operands with "bit" instead of "bits<1>".
Unfortunately, my only testcase for this is fragile, and the ARM AsmParser can't round trip the instruction in question.
<rdar://problem/9345702>

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

13 years agoAdd command line option to print debug info in human readable form as comment in...
Devang Patel [Thu, 28 Apr 2011 17:41:38 +0000 (17:41 +0000)]
Add command line option to print debug info in human readable form as comment in llvm IR output. This, i.e -enable-debug-info-comment,  is very useful if you want to easily find out which optimization pass is losing line number information.

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

13 years agoReapply r130340: Fix for PR9730.
Andrew Trick [Thu, 28 Apr 2011 17:30:04 +0000 (17:30 +0000)]
Reapply r130340: Fix for PR9730.

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

13 years agoInstCombine: Merge "(trunc x) == C1 & (and x, CA) == C2" into a single and+icmp.
Benjamin Kramer [Thu, 28 Apr 2011 16:58:40 +0000 (16:58 +0000)]
InstCombine: Merge "(trunc x) == C1 & (and x, CA) == C2" into a single and+icmp.

This happens when GVN widens loads. Part of PR6627.

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

13 years agoBe more layout aware here and swap the successor and branch condition
Eric Christopher [Thu, 28 Apr 2011 16:52:09 +0000 (16:52 +0000)]
Be more layout aware here and swap the successor and branch condition
if it means we get a fallthrough.

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

13 years agocentralize "marking for deletion" into a helper function. Pass GVN around to
Chris Lattner [Thu, 28 Apr 2011 16:36:48 +0000 (16:36 +0000)]
centralize "marking for deletion" into a helper function.  Pass GVN around to
static functions instead of passing around tons of random ivars.

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

13 years agoPromote toErase to be an ivar of the GVN class.
Chris Lattner [Thu, 28 Apr 2011 16:18:52 +0000 (16:18 +0000)]
Promote toErase to be an ivar of the GVN class.

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

13 years agoAdd a getExprForPersonalitySymbol method to MCAsmInfo. Use it when
Rafael Espindola [Thu, 28 Apr 2011 16:09:09 +0000 (16:09 +0000)]
Add a getExprForPersonalitySymbol method to MCAsmInfo. Use it when
converting the symbol passed to .cfi_personality into bytes is the file.

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

13 years agoMark the EH symbol global or weak if the corresponding function is.
Rafael Espindola [Thu, 28 Apr 2011 12:50:37 +0000 (12:50 +0000)]
Mark the EH symbol global or weak if the corresponding function is.

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

13 years agoFix typos in comments.
Jay Foad [Thu, 28 Apr 2011 09:12:47 +0000 (09:12 +0000)]
Fix typos in comments.

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

13 years agoFix the last -Wnon-pod-memset I'm seeing. This is benign, but appears
Chandler Carruth [Thu, 28 Apr 2011 08:37:18 +0000 (08:37 +0000)]
Fix the last -Wnon-pod-memset I'm seeing. This is benign, but appears
a bit more sinister as the memset doesn't do what the constructor does.
There seems to be a cleaner solution than a cast here though, instead we
can point the memset destination into the union its actually trying to
clear.

An alternative is to point to the Untyped member of this union. Review
appreciated, and if that is cleaner I'm happy to switch. All of these
should be functionally equivalent to the original code.

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

13 years agoRevert an unintended commit. Very sorry for this one.
Chandler Carruth [Thu, 28 Apr 2011 08:18:22 +0000 (08:18 +0000)]
Revert an unintended commit. Very sorry for this one.

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

13 years agoFix more -Wnon-pod-memset warnings.
Chandler Carruth [Thu, 28 Apr 2011 08:17:08 +0000 (08:17 +0000)]
Fix more -Wnon-pod-memset warnings.

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

13 years agonuke gold
Chandler Carruth [Thu, 28 Apr 2011 08:17:05 +0000 (08:17 +0000)]
nuke gold

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

13 years agoteach GVN to widen integer loads when they are overaligned, when doing an
Chris Lattner [Thu, 28 Apr 2011 07:29:08 +0000 (07:29 +0000)]
teach GVN to widen integer loads when they are overaligned, when doing an
wider load would allow elimination of subsequent loads, and when the wider
load is still a native integer type.  This eliminates a ton of loads on
various benchmarks involving struct fields, though it is somewhat hobbled
by clang not being very aggressive about field alignment.

This is yet another step along the way towards resolving PR6627.

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

13 years agoLet the immediate leaf pattern take transforms and switch the signed
Eric Christopher [Thu, 28 Apr 2011 05:49:04 +0000 (05:49 +0000)]
Let the immediate leaf pattern take transforms and switch the signed
immediate patterns in arm to using the pattern.

Handles rdar://9299434

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

13 years agomove PR9803 to this readme.
Chris Lattner [Thu, 28 Apr 2011 05:33:16 +0000 (05:33 +0000)]
move PR9803 to this readme.

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

13 years agoAdd utility method to DenseMap to return the amount of memory used for its buckets.
Ted Kremenek [Thu, 28 Apr 2011 04:52:57 +0000 (04:52 +0000)]
Add utility method to DenseMap to return the amount of memory used for its buckets.

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

13 years agoAdd a small temporary hack for producing identical eh_frame sections on OS X.
Rafael Espindola [Thu, 28 Apr 2011 04:04:14 +0000 (04:04 +0000)]
Add a small temporary hack for producing identical eh_frame sections on OS X.
This removes one of the main advantages of moving eh_frame to MC, but
makes the transition a lot easier to debug (run md5).

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

13 years agoProduce the EH_frame# symbols if needed.
Rafael Espindola [Thu, 28 Apr 2011 03:26:11 +0000 (03:26 +0000)]
Produce the EH_frame# symbols if needed.

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

13 years agoForward isFunctionEHFrameSymbolPrivate. If it is false, produce the foo.eh
Rafael Espindola [Thu, 28 Apr 2011 02:46:42 +0000 (02:46 +0000)]
Forward isFunctionEHFrameSymbolPrivate. If it is false, produce the foo.eh
symbols.

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

13 years agoTeach dwarf writer to handle complex address expression for .debug_loc entries.
Devang Patel [Thu, 28 Apr 2011 02:22:40 +0000 (02:22 +0000)]
Teach dwarf writer to handle complex address expression for .debug_loc entries.
This fixes clang generated blocks' variables' debug info.
Radar 9279956.

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

13 years agosilence some -Wnon-pod-memset warnings, since std::pair is not POD.
Chris Lattner [Thu, 28 Apr 2011 00:55:53 +0000 (00:55 +0000)]
silence some -Wnon-pod-memset warnings, since std::pair is not POD.

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

13 years agoFix a silly mistake in r130338.
Eli Friedman [Thu, 28 Apr 2011 00:42:03 +0000 (00:42 +0000)]
Fix a silly mistake in r130338.

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

13 years agoPTX: support for select_cc and fixes for setcc
Justin Holewinski [Thu, 28 Apr 2011 00:19:56 +0000 (00:19 +0000)]
PTX: support for select_cc and fixes for setcc

- expansion of SELECT_CC into SETCC
- force SETCC result type to i1
- custom selection for handling i1 using SETCC

Patch by Dan Bailey

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

13 years agoPTX: support for select
Justin Holewinski [Thu, 28 Apr 2011 00:19:55 +0000 (00:19 +0000)]
PTX: support for select

- selection of SELP instruction
- new selp.ll test

Patch by Dan Bailey

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

13 years agoPTX: mov fix and rounding correction for cvt
Justin Holewinski [Thu, 28 Apr 2011 00:19:54 +0000 (00:19 +0000)]
PTX:  mov fix and rounding correction for cvt

- fix typo in MOV
- correct fp rounding on CVT
- new cvt.ll test

Patch by Dan Bailey

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

13 years agoPTX: support for fneg
Justin Holewinski [Thu, 28 Apr 2011 00:19:53 +0000 (00:19 +0000)]
PTX: support for fneg

- selection of FNEG instruction
- new fneg.ll test

Patch by Dan Bailey

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

13 years agoPTX: support for zext loads and trunc stores
Justin Holewinski [Thu, 28 Apr 2011 00:19:52 +0000 (00:19 +0000)]
PTX: support for zext loads and trunc stores

- expansion of EXTLOAD and TRUNCSTORE instructions

Patch by Dan Bailey

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

13 years agoPTX: support for bitwise operations on predicates
Justin Holewinski [Thu, 28 Apr 2011 00:19:51 +0000 (00:19 +0000)]
PTX: support for bitwise operations on predicates

- selection of bitwise preds (AND, OR, XOR)
- new bitwise.ll test

Patch by Dan Bailey

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

13 years agoPTX: patch to AsmPrinter
Justin Holewinski [Thu, 28 Apr 2011 00:19:50 +0000 (00:19 +0000)]
PTX: patch to AsmPrinter

- immediate value cast as long not int
- handles initializer for constant array

Patch by Dan Bailey

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

13 years agoReverting r130340 in the unlikely event that it's responsible for a llvm-gcc stage2...
Andrew Trick [Thu, 28 Apr 2011 00:13:59 +0000 (00:13 +0000)]
Reverting r130340 in the unlikely event that it's responsible for a llvm-gcc stage2 compiler error.

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

13 years agofast-isel sret. We actually don't need to do anything special on x86. :) rdar:/...
Eli Friedman [Wed, 27 Apr 2011 23:58:52 +0000 (23:58 +0000)]
fast-isel sret.  We actually don't need to do anything special on x86. :) rdar://problem/9303592 .

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

13 years agoAdd tests for A8.6.110 NOP.
Johnny Chen [Wed, 27 Apr 2011 23:29:21 +0000 (23:29 +0000)]
Add tests for A8.6.110 NOP.

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

13 years agoRemove unnecessary argument.
Rafael Espindola [Wed, 27 Apr 2011 23:17:57 +0000 (23:17 +0000)]
Remove unnecessary argument.

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

13 years agoRename getPersonalityPICSymbol to getCFIPersonalitySymbol, document it, and
Rafael Espindola [Wed, 27 Apr 2011 23:08:15 +0000 (23:08 +0000)]
Rename getPersonalityPICSymbol to getCFIPersonalitySymbol, document it, and
give it a bit more responsibility. Also implement it for MachO.

If hacked to use cfi, 32 bit MachO will produce

.cfi_personality 155, L___gxx_personality_v0$non_lazy_ptr

and 64 bit will produce

.cfi_presonality ___gxx_personality_v0

The general idea is that .cfi_personality gets passed the final symbol. It is
up to codegen to produce it if using indirect representation (like 32 bit
MachO), but it is up to MC to decide which relocations to create.

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

13 years agoFixes PR9730: indvars: An asserting value handle still pointed to this value
Andrew Trick [Wed, 27 Apr 2011 23:00:03 +0000 (23:00 +0000)]
Fixes PR9730: indvars: An asserting value handle still pointed to this value

Modified LinearFunctionTestReplace to push the condition on the dead
list instead of eagerly deleting it. This can cause unnecessary
IV rewrites, which should have no effect on codegen and will not be an
issue once we stop generating canonical IVs.

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

13 years agoSimplify handling of variables with complex address (i.e. blocks variables)
Devang Patel [Wed, 27 Apr 2011 22:45:24 +0000 (22:45 +0000)]
Simplify handling of variables with complex address (i.e. blocks variables)

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

13 years agoMake the fast-isel code for literal 0.0 a bit shorter/faster, since 0.0 is common...
Eli Friedman [Wed, 27 Apr 2011 22:41:55 +0000 (22:41 +0000)]
Make the fast-isel code for literal 0.0 a bit shorter/faster, since 0.0 is common.  rdar://problem/9303592 .

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

13 years agoRemove unused function.
Eli Friedman [Wed, 27 Apr 2011 22:21:02 +0000 (22:21 +0000)]
Remove unused function.

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

13 years agodocs/doxygen.css: Tweak style for readability.
NAKAMURA Takumi [Wed, 27 Apr 2011 21:53:35 +0000 (21:53 +0000)]
docs/doxygen.css: Tweak style for readability.

A few styles are brought from http://llvm.org/test-doxygen/api/api.css

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

13 years agoFix indentation.
Rafael Espindola [Wed, 27 Apr 2011 21:29:52 +0000 (21:29 +0000)]
Fix indentation.

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

13 years agoFix a bug in the case that there is no add or subtract symbol and the offset
Kevin Enderby [Wed, 27 Apr 2011 21:02:27 +0000 (21:02 +0000)]
Fix a bug in the case that there is no add or subtract symbol and the offset
value is zero so it does not add a NULL expr operand.

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

13 years agoTeach BasicAA about arm.neon.vld1 and vst1.
Dan Gohman [Wed, 27 Apr 2011 20:44:28 +0000 (20:44 +0000)]
Teach BasicAA about arm.neon.vld1 and vst1.

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

13 years agoRevert r130178. It turned out to be not the optimal path to emit complex location...
Devang Patel [Wed, 27 Apr 2011 20:29:27 +0000 (20:29 +0000)]
Revert r130178. It turned out to be not the optimal path to emit complex location expressions.

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

13 years agoIf converter was being too cute. It look for root BBs (which don't have
Evan Cheng [Wed, 27 Apr 2011 19:32:43 +0000 (19:32 +0000)]
If converter was being too cute. It look for root BBs (which don't have
successors) and use inverse depth first search to traverse the BBs. However
that doesn't work when the CFG has infinite loops. Simply do a linear
traversal of all BBs work just fine.

rdar://9344645

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

13 years agoWhen analyzing functions known to only access argument pointees,
Dan Gohman [Wed, 27 Apr 2011 18:39:03 +0000 (18:39 +0000)]
When analyzing functions known to only access argument pointees,
only check arguments with pointer types. Update the documentation
of IntrReadArgMem reflect this.

While here, add support for TBAA tags on intrinsic calls.

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

13 years agoCorrects an old, old typo in a case that doesn't seem to be reached in practice.
Andrew Trick [Wed, 27 Apr 2011 18:17:36 +0000 (18:17 +0000)]
Corrects an old, old typo in a case that doesn't seem to be reached in practice.

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

13 years agoSimplify cfg inserts a call to trap when unreachable code is detected. Assign DebugLo...
Devang Patel [Wed, 27 Apr 2011 17:59:27 +0000 (17:59 +0000)]
Simplify cfg inserts a call to trap when unreachable code is detected. Assign DebugLoc to this new trap instruction.

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

13 years agoAlso add <imp-def> operands for defined and dead super-registers when rewriting.
Jakob Stoklund Olesen [Wed, 27 Apr 2011 17:42:31 +0000 (17:42 +0000)]
Also add <imp-def> operands for defined and dead super-registers when rewriting.

We cannot rely on the <imp-def> operands added by LiveIntervals in all cases as
demonstrated by the test case.

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

13 years agoFactor a bit of code to MCStreamer::EmitLabel. Keep track of the last
Rafael Espindola [Wed, 27 Apr 2011 15:21:19 +0000 (15:21 +0000)]
Factor a bit of code to MCStreamer::EmitLabel. Keep track of the last
non private symbol. This will be use for handling

foo:
  .cfi_startproc
  ...

On OS X where we have to create a foo.eh symbol.

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

13 years agoStop trying to have instcombine preserve LCSSA form: this was not
Duncan Sands [Wed, 27 Apr 2011 10:55:12 +0000 (10:55 +0000)]
Stop trying to have instcombine preserve LCSSA form: this was not
effective in avoiding recomputation of LCSSA form; the widespread
use of instsimplify (which looks through phi nodes) means it was
not preserving LCSSA form anyway; and instcombine is no longer
scheduled in the middle of the loop passes so this doesn't matter
anymore.

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

13 years agoTest case and comment for PR9633.
Andrew Trick [Wed, 27 Apr 2011 05:42:17 +0000 (05:42 +0000)]
Test case and comment for PR9633.

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

13 years agoUse static inline to do the right thing when built in C99 mode. Of course,
Nick Lewycky [Wed, 27 Apr 2011 03:22:17 +0000 (03:22 +0000)]
Use static inline to do the right thing when built in C99 mode. Of course,
C89 doesn't have an inline keyword.

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

13 years agoRefactor out code to fast-isel a memcpy operation with a small constant
Eli Friedman [Wed, 27 Apr 2011 01:45:07 +0000 (01:45 +0000)]
Refactor out code to fast-isel a memcpy operation with a small constant
length.  (I'm planning to use this to implement byval.)

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

13 years agoForce some values to be absolute and align based on the FDE pointers size. A small
Rafael Espindola [Wed, 27 Apr 2011 01:43:49 +0000 (01:43 +0000)]
Force some values to be absolute and align based on the FDE pointers size. A small
step towards using .cfi_* on OS X.

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

13 years agoFix an edge case involving branches in fast-isel on x86.
Eli Friedman [Wed, 27 Apr 2011 01:34:27 +0000 (01:34 +0000)]
Fix an edge case involving branches in fast-isel on x86.
rdar://problem/9303306 .

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

13 years agoFix for PR9633 [indvars] Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatib...
Andrew Trick [Wed, 27 Apr 2011 01:21:25 +0000 (01:21 +0000)]
Fix for PR9633 [indvars] Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

Added a type check in ScalarEvolution::computeSCEVAtScope to handle the case in which operands of an
AddRecExpr in the current scope are folded.

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

13 years agoEnhance memdep to return clobber relation between noalias loads when
Chris Lattner [Tue, 26 Apr 2011 22:42:01 +0000 (22:42 +0000)]
Enhance memdep to return clobber relation between noalias loads when
an earlier load could be widened to encompass a later load.  For example,
if we see:

  X = load i8* P, align 4
  Y = load i8* (P+3), align 1

and we have a 32-bit native integer type, we can widen the former load
to i32 which then makes the second load redundant.  GVN can't actually
do anything with this load/load relation yet, so this isn't testable, but
it is the next step to resolving PR6627, and a fairly general class of
"merge neighboring loads" missed optimizations.

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

13 years agoAdd a safe-guard against repeated splitting for some rare cases.
Jakob Stoklund Olesen [Tue, 26 Apr 2011 22:33:12 +0000 (22:33 +0000)]
Add a safe-guard against repeated splitting for some rare cases.

The number of blocks covered by a live range must be strictly decreasing when
splitting, otherwise we can't allow repeated splitting.

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

13 years agouse AA::isMustAlias to simplify some calls.
Chris Lattner [Tue, 26 Apr 2011 21:53:34 +0000 (21:53 +0000)]
use AA::isMustAlias to simplify some calls.

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

13 years agoremove support for llvm.invariant.end from memdep. It is a
Chris Lattner [Tue, 26 Apr 2011 21:50:51 +0000 (21:50 +0000)]
remove support for llvm.invariant.end from memdep.  It is a
work-in-progress that is not progressing, and it has issues.

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

13 years agoBe careful about scheduling nodes above previous calls. It increase usages of
Evan Cheng [Tue, 26 Apr 2011 21:31:35 +0000 (21:31 +0000)]
Be careful about scheduling nodes above previous calls. It increase usages of
more callee-saved registers and introduce copies. Only allows it if scheduling
a node above calls would end up lessen register pressure.

Call operands also has added ABI restrictions for register allocation, so be
extra careful with hoisting them above calls.

rdar://9329627

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

13 years agoThis test should be in MC. It breaks with changes to scheduling / register allocation...
Evan Cheng [Tue, 26 Apr 2011 21:09:04 +0000 (21:09 +0000)]
This test should be in MC. It breaks with changes to scheduling / register allocation so it's being removed.

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

13 years agomake a couple of changes to the standard pass pipeline:
Chris Lattner [Tue, 26 Apr 2011 20:45:33 +0000 (20:45 +0000)]
make a couple of changes to the standard pass pipeline:
1. Only run the early (in the module pass pipe) instcombine/simplifycfg
   if the "unit at a time" passes they are cleaning up after runs.

2. Move the "clean up after the unroller" pass to the very end of the
   function-level pass pipeline.  Loop unroll uses instsimplify now,
   so it doesn't create a ton of trash.  Moving instcombine later allows
   it to clean up after opportunities are exposed by GVN, DSE, etc.

3. Introduce some phase ordering tests for things that are specifically
   intended to be simplified by the full optimizer as a whole.

This resolves PR2338, and is progress towards PR6627, which will be
generating code that looks similar to test2.

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

13 years agoTransform: "icmp eq (trunc (lshr(X, cst1)), cst" to "icmp (and X, mask), cst"
Chris Lattner [Tue, 26 Apr 2011 20:18:20 +0000 (20:18 +0000)]
Transform: "icmp eq (trunc (lshr(X, cst1)), cst" to "icmp (and X, mask), cst"
when X has multiple uses.  This is useful for exposing secondary optimizations,
but the X86 backend isn't ready for this when X has a single use.  For example,
this can disable load folding.

This is inching towards resolving PR6627.

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

13 years agosome random cleanups, no functionality change.
Chris Lattner [Tue, 26 Apr 2011 20:02:45 +0000 (20:02 +0000)]
some random cleanups, no functionality change.

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

13 years agoadd an m_ConstantInt matching predicate that binds to a uint64_t, and add an m_OneUse()
Chris Lattner [Tue, 26 Apr 2011 19:50:39 +0000 (19:50 +0000)]
add an m_ConstantInt matching predicate that binds to a uint64_t, and add an m_OneUse()
predicate that matches if the subexpr has a single use.

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

13 years agoARM and Thumb2 support for atomic MIN/MAX/UMIN/UMAX loads.
Jim Grosbach [Tue, 26 Apr 2011 19:44:18 +0000 (19:44 +0000)]
ARM and Thumb2 support for atomic MIN/MAX/UMIN/UMAX loads.

rdar://9326019

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

13 years agoPrint the label if we will use it in debug_frame.
Rafael Espindola [Tue, 26 Apr 2011 19:26:53 +0000 (19:26 +0000)]
Print the label if we will use it in debug_frame.

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

13 years agoRefactor code. Keep dwarf register operation selection logic at one place.
Devang Patel [Tue, 26 Apr 2011 19:06:18 +0000 (19:06 +0000)]
Refactor code. Keep dwarf register operation selection logic at one place.

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

13 years agoUse the new TRI->getLargestLegalSuperClass hook to constrain register class inflation.
Jakob Stoklund Olesen [Tue, 26 Apr 2011 18:52:36 +0000 (18:52 +0000)]
Use the new TRI->getLargestLegalSuperClass hook to constrain register class inflation.

This has two effects: 1. We never inflate to a larger register class than what
the sub-target can handle. 2. Completely unconstrained virtual registers get the
largest possible register class.

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

13 years agoAdd a TRI::getLargestLegalSuperClass hook to provide an upper limit on register class...
Jakob Stoklund Olesen [Tue, 26 Apr 2011 18:52:33 +0000 (18:52 +0000)]
Add a TRI::getLargestLegalSuperClass hook to provide an upper limit on register class inflation.

The hook will be used by the register allocator when recomputing register
classes after removing constraints.

Thumb1 code doesn't allow anything larger than tGPR, and x86 needs to ensure
that the spill size doesn't change.

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

13 years agoForce a triple on this test to unbreak windows buildbots.
Benjamin Kramer [Tue, 26 Apr 2011 18:47:43 +0000 (18:47 +0000)]
Force a triple on this test to unbreak windows buildbots.

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

13 years agoFix an off by one error while accessing complex address element of a DIVariable.
Devang Patel [Tue, 26 Apr 2011 18:24:39 +0000 (18:24 +0000)]
Fix an off by one error while accessing complex address element of a DIVariable.
This worked untill now because stars are aligned (i.e. num of complex address elments are always 0 or 2+ and when it is 2+ at least two elements are access together)

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

13 years agoImprove the bail-out predicate to really only kick in when phi
Chris Lattner [Tue, 26 Apr 2011 17:41:02 +0000 (17:41 +0000)]
Improve the bail-out predicate to really only kick in when phi
translation fails.  We were bailing out in some cases that would
cause us to miss GVN'ing some non-local cases away.

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

13 years agoFast-isel support for simple inline asms.
Dan Gohman [Tue, 26 Apr 2011 17:18:34 +0000 (17:18 +0000)]
Fast-isel support for simple inline asms.

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

13 years agoHonor LLVM_BUILD_RUNTIME.
Oscar Fuentes [Tue, 26 Apr 2011 14:55:27 +0000 (14:55 +0000)]
Honor LLVM_BUILD_RUNTIME.

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

13 years agoAdd test for PR9743.
Rafael Espindola [Tue, 26 Apr 2011 14:17:42 +0000 (14:17 +0000)]
Add test for PR9743.

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

13 years agoAnother example of a static table that wasn't marked static.
Duncan Sands [Tue, 26 Apr 2011 07:30:10 +0000 (07:30 +0000)]
Another example of a static table that wasn't marked static.

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

13 years agodon't emit the symbol name twice for local bss and common
Chris Lattner [Tue, 26 Apr 2011 06:14:13 +0000 (06:14 +0000)]
don't emit the symbol name twice for local bss and common
symbols.  For example, don't emit:
        .comm   _i,4,2                  ## @i
                                        ## @i

instead emit:
        .comm   _i,4,2                  ## @i

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

13 years agoAdd cmakefiles to build profile_rt.so!
Nick Lewycky [Tue, 26 Apr 2011 05:48:41 +0000 (05:48 +0000)]
Add cmakefiles to build profile_rt.so!

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