oota-llvm.git
12 years agoDon't call dominates on unreachable instructions. Should fix the dragonegg
Rafael Espindola [Sun, 26 Feb 2012 05:30:08 +0000 (05:30 +0000)]
Don't call dominates on unreachable instructions. Should fix the dragonegg
build. Testcase is still reducing.

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

12 years agoDefault TargetData alignment information for 128-bit floating-point types.
Hal Finkel [Sun, 26 Feb 2012 04:13:31 +0000 (04:13 +0000)]
Default TargetData alignment information for 128-bit floating-point types.

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

12 years agoAnd update the comment...
Rafael Espindola [Sun, 26 Feb 2012 02:36:56 +0000 (02:36 +0000)]
And update the comment...

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

12 years agoEnable the assert that got all this dominator work started.
Rafael Espindola [Sun, 26 Feb 2012 02:29:18 +0000 (02:29 +0000)]
Enable the assert that got all this dominator work started.

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

12 years agoUse the DT dominates function in the verifier.
Rafael Espindola [Sun, 26 Feb 2012 02:23:37 +0000 (02:23 +0000)]
Use the DT dominates function in the verifier.

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

12 years agoChange the implementation of dominates(inst, inst) to one based on what the
Rafael Espindola [Sun, 26 Feb 2012 02:19:19 +0000 (02:19 +0000)]
Change the implementation of dominates(inst, inst) to one based on what the
verifier does. This correctly handles invoke.
Thanks to Duncan, Andrew and Chris for the comments.
Thanks to Joerg for the early testing.

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

12 years agoDon't call dominates on unreachable instructions.
Rafael Espindola [Sun, 26 Feb 2012 02:14:25 +0000 (02:14 +0000)]
Don't call dominates on unreachable instructions.

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

12 years agoReinstate the optimization from r151449 with a fix to not turn 'gep %x' into
Nick Lewycky [Sun, 26 Feb 2012 02:09:49 +0000 (02:09 +0000)]
Reinstate the optimization from r151449 with a fix to not turn 'gep %x' into
'gep null' when the icmp predicate is unsigned (or is signed without inbounds).

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

12 years agoDon't call dominates on unreachable instructions.
Rafael Espindola [Sun, 26 Feb 2012 01:50:14 +0000 (01:50 +0000)]
Don't call dominates on unreachable instructions.

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

12 years agoRoll these back to r151448 until I figure out how they're breaking
Nick Lewycky [Sat, 25 Feb 2012 23:01:19 +0000 (23:01 +0000)]
Roll these back to r151448 until I figure out how they're breaking
MultiSource/Applications/lua.

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

12 years agoAn argument and a local identified object (eg. a noalias call) could turn out
Nick Lewycky [Sat, 25 Feb 2012 20:19:07 +0000 (20:19 +0000)]
An argument and a local identified object (eg. a noalias call) could turn out
equal if both are null. In the test, scope type %t and global @y by adding a
'gep' prefix to them.

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

12 years agoFix five-letter typo in comment.
Nick Lewycky [Sat, 25 Feb 2012 19:12:58 +0000 (19:12 +0000)]
Fix five-letter typo in comment.

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

12 years agoTeach instsimplify to be more aggressive when analyzing comparisons of pointers
Nick Lewycky [Sat, 25 Feb 2012 19:07:42 +0000 (19:07 +0000)]
Teach instsimplify to be more aggressive when analyzing comparisons of pointers
by using llvm::isIdentifiedObject. Also teach it to handle GEPs that have
the same base pointer and constant operands. Fixes PR11238!

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

12 years agoMove isKnownNonNull from private implementation detail of BasicAA to a public
Nick Lewycky [Sat, 25 Feb 2012 10:56:28 +0000 (10:56 +0000)]
Move isKnownNonNull from private implementation detail of BasicAA to a public
function that others can use, next to llvm::isIdentifiedObject.

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

12 years agoRemove spurious emacs mode marker.
Nick Lewycky [Sat, 25 Feb 2012 07:20:06 +0000 (07:20 +0000)]
Remove spurious emacs mode marker.

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

12 years agoRevert r151278, breaks static linking.
Hal Finkel [Sat, 25 Feb 2012 03:40:11 +0000 (03:40 +0000)]
Revert r151278, breaks static linking.

Reverting this because it breaks static linking on ppc64. Specifically, it may be linkonce_odr functions that are the problem.
With this patch, if you link statically, calls to some functions end up calling their descriptor addresses instead
of calling to their entry points. This causes the execution to fail with SIGILL (b/c the descriptor address just
has some pointers, not code).

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

12 years agoTarget/X86: Fix assertion failures and warnings caused by r151382 _ftol2 lowering...
NAKAMURA Takumi [Sat, 25 Feb 2012 03:37:25 +0000 (03:37 +0000)]
Target/X86: Fix assertion failures and warnings caused by r151382 _ftol2 lowering for i386-*-win32 targets. Patch by Joe Groff.

[Joe Groff] Hi everyone. My previous patch applied as r151382 had a few problems:
Clang raised a warning, and X86 LowerOperation would assert out for
fptoui f64 to i32 because it improperly lowered to an illegal
BUILD_PAIR. Here's a patch that addresses these issues. Let me know if
any other changes are necessary. Thanks.

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

12 years agoAdd comment.
Chad Rosier [Sat, 25 Feb 2012 03:07:57 +0000 (03:07 +0000)]
Add comment.

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

12 years agoAdd support for disabling llvm.lifetime intrinsics in the AlwaysInliner. These
Chad Rosier [Sat, 25 Feb 2012 02:56:01 +0000 (02:56 +0000)]
Add support for disabling llvm.lifetime intrinsics in the AlwaysInliner. These
are optimization hints, but at -O0 we're not optimizing.  This becomes a problem
when the alwaysinline attribute is abused.
rdar://10921594

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

12 years agoMake the peephole optimizer clear kill flags on a vreg if it's about to add new
Lang Hames [Sat, 25 Feb 2012 02:01:00 +0000 (02:01 +0000)]
Make the peephole optimizer clear kill flags on a vreg if it's about to add new
uses of the vreg, since the old kills may no longer be valid.  This was causing
-verify-machineinstrs to complain about uses after kills, and could potentially
have been causing subtle register allocation issues, but I haven't come across a
test case yet.

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

12 years agoFix indentation.
Chad Rosier [Sat, 25 Feb 2012 01:10:59 +0000 (01:10 +0000)]
Fix indentation.

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

12 years agoGrammar-o.
Eric Christopher [Sat, 25 Feb 2012 01:02:44 +0000 (01:02 +0000)]
Grammar-o.

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

12 years agoFixed typo.
Lang Hames [Sat, 25 Feb 2012 00:46:38 +0000 (00:46 +0000)]
Fixed typo.

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

12 years agoAdd definitions of floating point multiply add/sub and negative multiply
Akira Hatanaka [Sat, 25 Feb 2012 00:21:52 +0000 (00:21 +0000)]
Add definitions of floating point multiply add/sub and negative multiply
add/sub instructions.

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

12 years agoAdd an option to use a virtual register as the global base register instead of
Akira Hatanaka [Fri, 24 Feb 2012 22:34:47 +0000 (22:34 +0000)]
Add an option to use a virtual register as the global base register instead of
reserving a physical register ($gp or $28) for that purpose.

This will completely eliminate loads that restore the value of $gp after every
function call, if the register allocator assigns a callee-saved register, or
eliminate unnecessary loads if it assigns a temporary register.

example:

.cpload $25       // set $gp.
...
.cprestore 16     // store $gp to stack slot 16($sp).
...
jalr $25          // function call. clobbers $gp.
lw $gp, 16($sp)   // not emitted if callee-saved reg is chosen.
...
lw $2, 4($gp)
...
jalr $25          // function call.
lw $gp, 16($sp)   // not emitted if $gp is not live after this instruction.
...

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

12 years agoRemove unused cl::opt, make another opt static.
Benjamin Kramer [Fri, 24 Feb 2012 22:09:25 +0000 (22:09 +0000)]
Remove unused cl::opt, make another opt static.

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

12 years agoAdd missing static
Jakob Stoklund Olesen [Fri, 24 Feb 2012 21:52:44 +0000 (21:52 +0000)]
Add missing static

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

12 years agoFix undefined behavior.
Ahmed Charles [Fri, 24 Feb 2012 19:06:15 +0000 (19:06 +0000)]
Fix undefined behavior.

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

12 years agoThumb2 asm aliases for wide bitwise w/ immediate instructions.
Jim Grosbach [Fri, 24 Feb 2012 19:06:05 +0000 (19:06 +0000)]
Thumb2 asm aliases for wide bitwise w/ immediate instructions.

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

12 years agofix PR12075, a regression in a recent transform I added. In unreachable code, gep...
Chris Lattner [Fri, 24 Feb 2012 19:01:58 +0000 (19:01 +0000)]
fix PR12075, a regression in a recent transform I added.  In unreachable code, gep chains can be infinite.  Just like "stripPointerCasts", use a set to keep track of visited instructions so we don't recurse infinitely.

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

12 years agoAdd WIN_FTOL_* psudo-instructions to model the unique calling convention
Michael J. Spencer [Fri, 24 Feb 2012 19:01:22 +0000 (19:01 +0000)]
Add WIN_FTOL_* psudo-instructions to model the unique calling convention
used by the Win32 _ftol2 runtime function. Patch by Joe Groff!

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

12 years agoAdd a -stress-regalloc=<N> option.
Jakob Stoklund Olesen [Fri, 24 Feb 2012 18:34:20 +0000 (18:34 +0000)]
Add a -stress-regalloc=<N> option.

This will limit all register classes to N registers in order to stress
test register allocation.

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

12 years agoX11/X2 loads around indirect calls on ppc64 should not be deleted.
Hal Finkel [Fri, 24 Feb 2012 17:54:01 +0000 (17:54 +0000)]
X11/X2 loads around indirect calls on ppc64 should not be deleted.

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

12 years agoDon't crash when a glue node contains an internal CopyToReg
Hal Finkel [Fri, 24 Feb 2012 17:53:59 +0000 (17:53 +0000)]
Don't crash when a glue node contains an internal CopyToReg

This is necessary to support the existing ppc lowering code for indirect calls.
Fixes PR12071.

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

12 years agoTeach GVN that x+y is the same as y+x and that x<y is the same as y>x.
Duncan Sands [Fri, 24 Feb 2012 15:16:31 +0000 (15:16 +0000)]
Teach GVN that x+y is the same as y+x and that x<y is the same as y>x.

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

12 years agoSDAGBuilder: Remove register sets that were never read and prune dead code surroundin...
Benjamin Kramer [Fri, 24 Feb 2012 14:01:17 +0000 (14:01 +0000)]
SDAGBuilder: Remove register sets that were never read and prune dead code surrounding it.

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

12 years agotest commit. removing unnecessary whitespace.
Kristof Beyls [Fri, 24 Feb 2012 13:52:45 +0000 (13:52 +0000)]
test commit. removing unnecessary whitespace.

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

12 years agotest/CodeGen/X86/2012-02-23-mmx-inlineasm.ll: Fixup to add -march=x86.
NAKAMURA Takumi [Fri, 24 Feb 2012 13:29:50 +0000 (13:29 +0000)]
test/CodeGen/X86/2012-02-23-mmx-inlineasm.ll: Fixup to add -march=x86.

-mcpu does not choose arch automatically, on non-x86 hosts.

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

12 years agoRemove dead code.
Richard Osborne [Fri, 24 Feb 2012 11:49:08 +0000 (11:49 +0000)]
Remove dead code.

Patch by Ahmed Charles

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

12 years agoWorkaround a miscompilation by gcc-4.3 that showed up as a failure
Duncan Sands [Fri, 24 Feb 2012 09:01:34 +0000 (09:01 +0000)]
Workaround a miscompilation by gcc-4.3 that showed up as a failure
of the StringRef.Split2 unittest on 32 bit machines.

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

12 years agoScheduleDAGInstrs.h:155: warning: suggest parentheses around `&&' within `||'.
Nick Lewycky [Fri, 24 Feb 2012 07:59:05 +0000 (07:59 +0000)]
ScheduleDAGInstrs.h:155: warning: suggest parentheses around `&&' within `||'.

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

12 years agoPostRA sched: speed up physreg tracking by not abusing SparseSet.
Andrew Trick [Fri, 24 Feb 2012 07:04:55 +0000 (07:04 +0000)]
PostRA sched: speed up physreg tracking by not abusing SparseSet.

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

12 years agoARM Thumb symbol references in assembly need the low bit set.
Jim Grosbach [Fri, 24 Feb 2012 05:12:18 +0000 (05:12 +0000)]
ARM Thumb symbol references in assembly need the low bit set.

Add support for a missed case when the symbols in a difference
expression are in the same section but not the same fragment.

rdar://10924681

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

12 years agoTurn avx insert intrinsic calls into INSERT_SUBVECTOR DAG nodes and remove duplicate...
Pete Cooper [Fri, 24 Feb 2012 03:51:49 +0000 (03:51 +0000)]
Turn avx insert intrinsic calls into INSERT_SUBVECTOR DAG nodes and remove duplicate patterns for selecting the intrinsics

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

12 years agocomment fix
Jia Liu [Fri, 24 Feb 2012 02:17:26 +0000 (02:17 +0000)]
comment fix

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

12 years agosome comment fix
Jia Liu [Fri, 24 Feb 2012 02:15:57 +0000 (02:15 +0000)]
some comment fix

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

12 years agocomment fix
Jia Liu [Fri, 24 Feb 2012 02:15:21 +0000 (02:15 +0000)]
comment fix

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

12 years agoreplace a balnk with -
Jia Liu [Fri, 24 Feb 2012 02:05:28 +0000 (02:05 +0000)]
replace a balnk with -

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

12 years agoIf the Address of a variable is an argument then treat the entire
Eric Christopher [Fri, 24 Feb 2012 01:59:08 +0000 (01:59 +0000)]
If the Address of a variable is an argument then treat the entire
variable declaration as an argument because we want that address
anyhow for our debug information.

This seems to fix rdar://9965111, at least we have more debug
information than before and from reading the assembly it appears
to be the correct location.

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

12 years agoTabs, formatting and long lines oh my!
Eric Christopher [Fri, 24 Feb 2012 01:59:01 +0000 (01:59 +0000)]
Tabs, formatting and long lines oh my!

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

12 years ago80 columns of Mips InstPrinter Makefile
Jia Liu [Fri, 24 Feb 2012 01:47:01 +0000 (01:47 +0000)]
80 columns of Mips InstPrinter Makefile

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

12 years agoSwitch ARM target to register masks.
Jakob Stoklund Olesen [Fri, 24 Feb 2012 01:19:29 +0000 (01:19 +0000)]
Switch ARM target to register masks.

I'll let the buildbots determine the compile time improvements from this
change, but 464.h264ref has 5% faster codegen at -O2.

This patch does cause some assembly changes.  Branch folding can make
different decisions about calls with dead return values.
CriticalAntiDepBreaker may choose different registers because its
liveness tracking is affected.  MachineCopyPropagation may sometimes
leave a dead copy behind.

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

12 years agoMake sure the regs are low regs for tMUL size reduction.
Jim Grosbach [Fri, 24 Feb 2012 00:53:11 +0000 (00:53 +0000)]
Make sure the regs are low regs for tMUL size reduction.

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

12 years agoThumb2 size reduction fix for tied operands of tMUL.
Jim Grosbach [Fri, 24 Feb 2012 00:33:36 +0000 (00:33 +0000)]
Thumb2 size reduction fix for tied operands of tMUL.

The tied source operand of tMUL is the second source operand, not the
first like every other two-address thumb instruction. Special case it
in the size reduction pass to make sure we create the tMUL instruction
properly.

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

12 years agoEE/Interpreter/ExternalFunctions.cpp: Staticize lle_X_() entries. They can be mapped...
NAKAMURA Takumi [Fri, 24 Feb 2012 00:20:08 +0000 (00:20 +0000)]
EE/Interpreter/ExternalFunctions.cpp: Staticize lle_X_() entries. They can be mapped in FuncNames[] at the initialization.

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

12 years agoEE/Interpreter/ExternalFunctions.cpp: Prune "C" linkage to suppress warnings with...
NAKAMURA Takumi [Fri, 24 Feb 2012 00:19:58 +0000 (00:19 +0000)]
EE/Interpreter/ExternalFunctions.cpp: Prune "C" linkage to suppress warnings with -Wreturn-type (and MSC's w4190).

In historical reason, Interpreter's external entries had prefix "lle_X_" as C linkage, even for well-known entries in EE/Interpreter.
Now, at least on ToT, they are resolved via FuncNames[] mapper.
We will not need their symbols are expected to be exported any more.

Clang r150128 has introduced the warning <"%0 has C-linkage specified, but returns user-defined type %1 which is incompatible with C">.

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

12 years agoWhen emitting a cmp with 0 for a lowered select, mask out the high
Dan Gohman [Fri, 24 Feb 2012 00:09:36 +0000 (00:09 +0000)]
When emitting a cmp with 0 for a lowered select, mask out the high
bits of the value carying the boolean condition, as their contents
are undefined. This fixes rdar://10887484.

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

12 years agoRelease not for ARM integrated assembler support.
Jim Grosbach [Thu, 23 Feb 2012 23:52:06 +0000 (23:52 +0000)]
Release not for ARM integrated assembler support.

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

12 years agoAllow an integer to be converted into an MMX type when it's used in an inline
Bill Wendling [Thu, 23 Feb 2012 23:25:25 +0000 (23:25 +0000)]
Allow an integer to be converted into an MMX type when it's used in an inline
asm.
<rdar://problem/10106006>

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

12 years agoTypo.
Chad Rosier [Thu, 23 Feb 2012 23:21:22 +0000 (23:21 +0000)]
Typo.

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

12 years agoEmit global ctors into .CRT$XCU instead of .ctors on Win32. Patch by Joe Groff!
Michael J. Spencer [Thu, 23 Feb 2012 21:56:08 +0000 (21:56 +0000)]
Emit global ctors into .CRT$XCU instead of .ctors on Win32. Patch by Joe Groff!

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

12 years agoThe LLVM Getting Started documentation is out of date. It would be nice if
Chad Rosier [Thu, 23 Feb 2012 21:23:24 +0000 (21:23 +0000)]
The LLVM Getting Started documentation is out of date.  It would be nice if
someone could update this, but for now at least reference the Clang Getting
Started document, which is much more current.

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

12 years agoBump SmallString to the minimum required amount for raw_ostream to avoid allocation.
Benjamin Kramer [Thu, 23 Feb 2012 21:15:21 +0000 (21:15 +0000)]
Bump SmallString to the minimum required amount for raw_ostream to avoid allocation.

It's is a bit annoying, we should hide this implementation detail better.

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

12 years agoReplace a DenseSet with SmallPtrSet.
Benjamin Kramer [Thu, 23 Feb 2012 20:53:02 +0000 (20:53 +0000)]
Replace a DenseSet with SmallPtrSet.

SmallSet of pointer is the same as SmallPtrSet, use the latter directly.

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

12 years agoMCize function entry label emission on PowerPC64 properly.
Roman Divacky [Thu, 23 Feb 2012 20:28:39 +0000 (20:28 +0000)]
MCize function entry label emission on PowerPC64 properly.

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

12 years agoBitVectorize loop.
Benjamin Kramer [Thu, 23 Feb 2012 19:29:25 +0000 (19:29 +0000)]
BitVectorize loop.

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

12 years agopost-ra-sched: Turn the KillIndices vector into a bitvector, it only stored two meani...
Benjamin Kramer [Thu, 23 Feb 2012 19:15:40 +0000 (19:15 +0000)]
post-ra-sched: Turn the KillIndices vector into a bitvector, it only stored two meaningful states.

Rename it to LiveRegs to make it more clear what's stored inside.

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

12 years agopost-ra-sched: Replace a std::set of regs with a bitvector.
Benjamin Kramer [Thu, 23 Feb 2012 18:28:32 +0000 (18:28 +0000)]
post-ra-sched: Replace a std::set of regs with a bitvector.

Assuming that a single std::set node adds 3 control words, a bitvector
can store (3*8+4)*8=224 registers in the allocated memory of a single
element in the std::set (x86_64). Also we don't have to call malloc
for every register added.

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

12 years agoUpdated the llvm-mc disassembler C API to support for the X86 target.
Kevin Enderby [Thu, 23 Feb 2012 18:18:17 +0000 (18:18 +0000)]
Updated the llvm-mc disassembler C API to support for the X86 target.
rdar://10873652

As part of this I updated the llvm-mc disassembler C API to always call the
SymbolLookUp call back even if there is no getOpInfo call back.  If there is a
getOpInfo call back that is tried first and then if that gets no information
then the  SymbolLookUp is called.  I also made the code more robust by
memset(3)'ing to zero the LLVMOpInfo1 struct before then setting
SymbolicOp.Value before for the call to getOpInfo.  And also don't use any
values from the  LLVMOpInfo1 struct if getOpInfo returns 0.  And also don't
use any of the ReferenceType or ReferenceName values from SymbolLookUp if it
returns NULL. rdar://10873563 and rdar://10873683

For the X86 target also fixed bugs so the annotations get printed.

Also fixed a few places in the ARM target that was not producing symbolic
operands for some instructions.  rdar://10878166

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

12 years agoFix the numbering of some of the registers and reclassify a couple of them.
Brendon Cahoon [Thu, 23 Feb 2012 18:17:17 +0000 (18:17 +0000)]
Fix the numbering of some of the registers and reclassify a couple of them.
Also, some basic clean up.  Patch by Evandro Menezes.

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

12 years agoMake calls scheduling boundaries post-ra.
Jakob Stoklund Olesen [Thu, 23 Feb 2012 17:54:21 +0000 (17:54 +0000)]
Make calls scheduling boundaries post-ra.

Before register allocation, instructions can be moved across calls in
order to reduce register pressure.  After register allocation, we don't
gain a lot by moving callee-saved defs across calls.  In fact, since the
scheduler doesn't have a good idea how registers are used in the callee,
it can't really make good scheduling decisions.

This changes the schedule in two ways: 1. Latencies to call uses and
defs are no longer accounted for, causing some random shuffling around
calls.  This isn't really a problem since those uses and defs are
inaccurate proxies for what happens inside the callee.  They don't
represent registers used by the call instruction itself.

2. Instructions are no longer moved across calls.  This didn't happen
very often, and the scheduling decision was made on dubious information
anyway.

As with any scheduling change, benchmark numbers shift around a bit,
but there is no positive or negative trend from this change.

This makes the post-ra scheduler 5% faster for ARM targets.

The secret motivation for this patch is the introduction of register
mask operands representing call clobbers.  The most efficient way of
handling regmasks in ScheduleDAGInstrs is to model them as barriers for
physreg live ranges, but not for virtreg live ranges.  That's fine
pre-ra, but post-ra it would have the same effect as this patch.

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

12 years agoReflow code, no functionality change.
Benjamin Kramer [Thu, 23 Feb 2012 17:42:19 +0000 (17:42 +0000)]
Reflow code, no functionality change.

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

12 years agoMake tests less sensitive to scheduling changes.
Jakob Stoklund Olesen [Thu, 23 Feb 2012 17:19:34 +0000 (17:19 +0000)]
Make tests less sensitive to scheduling changes.

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

12 years agoStrip a layer of boilerplate from the VLIWPacketizer by storing the scheduler as...
Benjamin Kramer [Thu, 23 Feb 2012 13:39:13 +0000 (13:39 +0000)]
Strip a layer of boilerplate from the VLIWPacketizer by storing the scheduler as an opaque pointer.

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

12 years agoRemove unused variable.
Duncan Sands [Thu, 23 Feb 2012 11:01:22 +0000 (11:01 +0000)]
Remove unused variable.

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

12 years agoFix to make sure that a comdat group gets generated correctly for a static member
Anton Korobeynikov [Thu, 23 Feb 2012 10:36:04 +0000 (10:36 +0000)]
Fix to make sure that a comdat group gets generated correctly for a static member
of instantiated C++ templates.

Patch by Kristof Beyls!

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

12 years agoUpdate for the removal of Hashing.cpp.
Jay Foad [Thu, 23 Feb 2012 09:33:44 +0000 (09:33 +0000)]
Update for the removal of Hashing.cpp.

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

12 years agoReinstate r151049 now that GeneralHash is fixed.
Jay Foad [Thu, 23 Feb 2012 09:17:40 +0000 (09:17 +0000)]
Reinstate r151049 now that GeneralHash is fixed.

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

12 years agoThe implementation of GeneralHash::addBits broke C++ aliasing rules; fix
Jay Foad [Thu, 23 Feb 2012 09:16:04 +0000 (09:16 +0000)]
The implementation of GeneralHash::addBits broke C++ aliasing rules; fix
it with memcpy. This also fixes a problem on big-endian hosts, where
addUnaligned would return different results depending on the alignment
of the data.

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

12 years agoRemove 'if' from getSuperRegisters, getSubRegisters, and getOverlaps that were added...
Craig Topper [Thu, 23 Feb 2012 08:42:06 +0000 (08:42 +0000)]
Remove 'if' from getSuperRegisters, getSubRegisters, and getOverlaps that were added in r151038.

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

12 years agoAn easy case where GCC should really be able to work out that the value is only
Duncan Sands [Thu, 23 Feb 2012 08:25:25 +0000 (08:25 +0000)]
An easy case where GCC should really be able to work out that the value is only
used if IsInDevelopmentTree is 'true'.  But it doesn't, so help it out.

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

12 years agoGCC warns about a comparison between signed and unsigned values.
Duncan Sands [Thu, 23 Feb 2012 08:23:53 +0000 (08:23 +0000)]
GCC warns about a comparison between signed and unsigned values.

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

12 years agoGCC fails to understand that NextBB is always initialized if EvaluateBlock
Duncan Sands [Thu, 23 Feb 2012 08:23:06 +0000 (08:23 +0000)]
GCC fails to understand that NextBB is always initialized if EvaluateBlock
returns 'true' and emits a warning.  Help it out.

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

12 years agoFix typo.
Rafael Espindola [Thu, 23 Feb 2012 05:38:51 +0000 (05:38 +0000)]
Fix typo.

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

12 years agoMore newline cleanups.
Eric Christopher [Thu, 23 Feb 2012 03:39:43 +0000 (03:39 +0000)]
More newline cleanups.

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

12 years agoAdd some handy-dandy newlines.
Eric Christopher [Thu, 23 Feb 2012 03:39:39 +0000 (03:39 +0000)]
Add some handy-dandy newlines.

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

12 years agomisched: cleanup reaching def computation
Andrew Trick [Thu, 23 Feb 2012 03:16:24 +0000 (03:16 +0000)]
misched: cleanup reaching def computation

Ignore undef uses completely.
Use a more explicit SlotIndex API.
Add more explicit comments.

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

12 years agoCanonicalize (srl (bswap x), 16) to (rotr (bswap x), 16) if the high 16 bits
Evan Cheng [Thu, 23 Feb 2012 02:58:19 +0000 (02:58 +0000)]
Canonicalize (srl (bswap x), 16) to (rotr (bswap x), 16) if the high 16 bits
of x are zero. This optimizes rev + lsr 16 to rev16.

rdar://10750814

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

12 years agoPostRASched: Convert physreg def/use tracking to Jakob's SparseSet.
Andrew Trick [Thu, 23 Feb 2012 01:52:38 +0000 (01:52 +0000)]
PostRASched: Convert physreg def/use tracking to Jakob's SparseSet.

Added array subscript to SparseSet for convenience.
Slight reorg to make it easier to manage the def/use sets.

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

12 years agoHandle regmasks in FixupKills.
Jakob Stoklund Olesen [Thu, 23 Feb 2012 01:22:15 +0000 (01:22 +0000)]
Handle regmasks in FixupKills.

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

12 years agoOptimize a couple of common patterns involving conditional moves where the false
Evan Cheng [Thu, 23 Feb 2012 01:19:06 +0000 (01:19 +0000)]
Optimize a couple of common patterns involving conditional moves where the false
value is zero. Instead of a cmov + op, issue an conditional op instead. e.g.
    cmp   r9, r4
    mov   r4, #0
    moveq r4, #1
    orr   lr, lr, r4

should be:
    cmp   r9, r4
    orreq lr, lr, #1

That is, optimize (or x, (cmov 0, y, cond)) to (or.cond x, y). Similarly extend
this to xor as well as (and x, (cmov -1, y, cond)) => (and.cond x, y).

It's possible to extend this to ADD and SUB but I don't think they are common.

rdar://8659097

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

12 years agoHandle regmasks in CriticalAntiDepBreaker.
Jakob Stoklund Olesen [Thu, 23 Feb 2012 01:15:26 +0000 (01:15 +0000)]
Handle regmasks in CriticalAntiDepBreaker.

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

12 years agoTrack reserved registers separately from RegsAvailable.
Jakob Stoklund Olesen [Thu, 23 Feb 2012 01:13:32 +0000 (01:13 +0000)]
Track reserved registers separately from RegsAvailable.

The bulk masking operations from register mask operands don't account
for reserved registers.

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

12 years agoMC: Fix the MCNullStreamer which was broken in r147763.
Daniel Dunbar [Wed, 22 Feb 2012 23:49:50 +0000 (23:49 +0000)]
MC: Fix the MCNullStreamer which was broken in r147763.

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

12 years agoDon't compute latencies for regmask operands.
Jakob Stoklund Olesen [Wed, 22 Feb 2012 22:52:52 +0000 (22:52 +0000)]
Don't compute latencies for regmask operands.

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

12 years agoHandle regmasks in RegisterScavenging.
Jakob Stoklund Olesen [Wed, 22 Feb 2012 22:50:14 +0000 (22:50 +0000)]
Handle regmasks in RegisterScavenging.

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

12 years agomisched: Use SparseSet for VRegDegs for constant time clear().
Andrew Trick [Wed, 22 Feb 2012 21:59:00 +0000 (21:59 +0000)]
misched: Use SparseSet for VRegDegs for constant time clear().

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

12 years agoAllow the use of an alternate symbol for calculating a function's size.
Hal Finkel [Wed, 22 Feb 2012 21:11:47 +0000 (21:11 +0000)]
Allow the use of an alternate symbol for calculating a function's size.

The standard function epilog includes a .size directive, but ppc64 uses
an alternate local symbol to tag the actual start of each function.

Until recently, binutils accepted the .size directive as:
 .size test1, .Ltmp0-test1
however, using this directive with recent binutils will result in the error:
 .size expression for XXX does not evaluate to a constant
so we must use the label which actually tags the start of the function.

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

12 years agoRemove bad comma from .el file.
Bill Wendling [Wed, 22 Feb 2012 19:38:03 +0000 (19:38 +0000)]
Remove bad comma from .el file.

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

12 years agolibclc is now dual licensed, Tobias and Peter own their respective subprojects.
Chris Lattner [Wed, 22 Feb 2012 19:17:20 +0000 (19:17 +0000)]
libclc is now dual licensed, Tobias and Peter own their respective subprojects.

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