oota-llvm.git
12 years agoFix PR12089
Derek Schuff [Mon, 27 Feb 2012 20:31:47 +0000 (20:31 +0000)]
Fix PR12089
http://llvm.org/bugs/show_bug.cgi?id=12089

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

12 years agoReapply r151278 with fixes.
Roman Divacky [Mon, 27 Feb 2012 20:20:47 +0000 (20:20 +0000)]
Reapply r151278 with fixes.

MCize function entry label emission on PowerPC64 properly.

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

12 years agoAdd q suffix aliases for the fistp and fisttp mnemonics.
Chad Rosier [Mon, 27 Feb 2012 19:43:12 +0000 (19:43 +0000)]
Add q suffix aliases for the fistp and fisttp mnemonics.
rdar://10921670
PR11935

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

12 years agoRemove unnecessary template parameters.
Akira Hatanaka [Mon, 27 Feb 2012 19:17:53 +0000 (19:17 +0000)]
Remove unnecessary template parameters.

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

12 years agoFix instruction predicates that were not set correctly.
Akira Hatanaka [Mon, 27 Feb 2012 19:09:08 +0000 (19:09 +0000)]
Fix instruction predicates that were not set correctly.

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

12 years agoUpdate machine code verifier.
Jakob Stoklund Olesen [Mon, 27 Feb 2012 18:24:30 +0000 (18:24 +0000)]
Update machine code verifier.

After the SlotIndex slot names were updated, it is possible to apply
stricter checks to live intervals.

Also treat bundles as bags of operands when checking live intervals.

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

12 years agoFix the symbolic operand added for the C disassmbler API for the ARM bl
Kevin Enderby [Mon, 27 Feb 2012 18:15:15 +0000 (18:15 +0000)]
Fix the symbolic operand added for the C disassmbler API for the ARM bl
thumb instruction.  The PC adjustment is +4 in Thumb mode and +8 in ARM mode.

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

12 years agoAdd a MachineOperand iterator class.
Jakob Stoklund Olesen [Mon, 27 Feb 2012 18:09:36 +0000 (18:09 +0000)]
Add a MachineOperand iterator class.

The MIOperands iterator can visit operands on a single instruction, or
all operands in a bundle.  This simplifies code like the register
allocator that treats bundles as a set of operands.

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

12 years agoPlog a memleak in GlobalOpt.
Benjamin Kramer [Mon, 27 Feb 2012 12:48:24 +0000 (12:48 +0000)]
Plog a memleak in GlobalOpt.

Found by valgrind.

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

12 years agoMicro-optimization, no functionality change.
Duncan Sands [Mon, 27 Feb 2012 12:11:41 +0000 (12:11 +0000)]
Micro-optimization, no functionality change.

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

12 years agoHelp the compiler to eliminate some dead code when hashing an array of T
Jay Foad [Mon, 27 Feb 2012 11:00:17 +0000 (11:00 +0000)]
Help the compiler to eliminate some dead code when hashing an array of T
where sizeof (T) is a multiple of 4.

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

12 years agoThe value numbering function is recursive, so it is possible for multiple new
Duncan Sands [Mon, 27 Feb 2012 09:54:35 +0000 (09:54 +0000)]
The value numbering function is recursive, so it is possible for multiple new
value numbers to be assigned when calculating any particular value number.
Enhance the logic that detects new value numbers to take this into account,
for a tiny compile time speedup.  Fix a comment typo while there.

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

12 years agoWhen performing a conditional branch depending on the value of a comparison
Duncan Sands [Mon, 27 Feb 2012 08:14:30 +0000 (08:14 +0000)]
When performing a conditional branch depending on the value of a comparison
%cmp (eg: A==B) we already replace %cmp with "true" under the true edge, and
with "false" under the false edge.  This change enhances this to replace the
negated compare (A!=B) with "false" under the true edge and "true" under the
false edge.  Reported to improve perlbench results by 1%.

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

12 years agoRemove HexagonGenIntrinsics.inc from Hexagon cmake file. It does not appear in the...
Craig Topper [Mon, 27 Feb 2012 02:59:43 +0000 (02:59 +0000)]
Remove HexagonGenIntrinsics.inc from Hexagon cmake file. It does not appear in the Makefile and the output it produces isn't used. The Hexagon intrinsics are all in the global Intrinsics.gen.

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

12 years agoUpdate tblgen command guide. Remove unused tblgen InstrEnumEmitter files.
Craig Topper [Mon, 27 Feb 2012 02:31:09 +0000 (02:31 +0000)]
Update tblgen command guide. Remove unused tblgen InstrEnumEmitter files.

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

12 years agodelete useless comment&blank
Jia Liu [Mon, 27 Feb 2012 02:21:34 +0000 (02:21 +0000)]
delete useless comment&blank

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

12 years agoFix this assert. IP can point to an instruction with strange dominance
Rafael Espindola [Mon, 27 Feb 2012 02:13:03 +0000 (02:13 +0000)]
Fix this assert. IP can point to an instruction with strange dominance
properties (invoke). Just assert that the instruction we return dominates
the insertion point.

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

12 years agoX86 disassembler support for jcxz, jecxz, and jrcxz. Fixes PR11643. Patch by Kay...
Craig Topper [Mon, 27 Feb 2012 01:54:29 +0000 (01:54 +0000)]
X86 disassembler support for jcxz, jecxz, and jrcxz. Fixes PR11643. Patch by Kay Tiong Khoo.

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

12 years agoRemove more GCC FE build stuff.
Chad Rosier [Sun, 26 Feb 2012 22:26:37 +0000 (22:26 +0000)]
Remove more GCC FE build stuff.

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

12 years agoInstalling the GCC front end is no longer supported.
Chad Rosier [Sun, 26 Feb 2012 22:17:05 +0000 (22:17 +0000)]
Installing the GCC front end is no longer supported.

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

12 years agoCleanup the LLVM Getting Started page.
Chad Rosier [Sun, 26 Feb 2012 22:12:59 +0000 (22:12 +0000)]
Cleanup the LLVM Getting Started page.

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

12 years agoAdd href to clang in overview.
Chad Rosier [Sun, 26 Feb 2012 21:34:02 +0000 (21:34 +0000)]
Add href to clang in overview.

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

12 years agoRemove references to llvm-gcc from overview and tutorial.
Chad Rosier [Sun, 26 Feb 2012 21:31:25 +0000 (21:31 +0000)]
Remove references to llvm-gcc from overview and tutorial.

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

12 years agoAdd support for random constant vectors.
Nadav Rotem [Sun, 26 Feb 2012 13:56:18 +0000 (13:56 +0000)]
Add support for random constant vectors.

Patch by Joey Gouly.

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

12 years agoStyle fix: Remove unneeded parentheses.
Nadav Rotem [Sun, 26 Feb 2012 12:34:17 +0000 (12:34 +0000)]
Style fix: Remove unneeded parentheses.

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

12 years agoFix a bug in the code that checks if a store value is a vector of i1s
Nadav Rotem [Sun, 26 Feb 2012 12:00:22 +0000 (12:00 +0000)]
Fix a bug in the code that checks if a store value is a vector of i1s

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

12 years agoFix compilation on MSVC. Rename "_BB" to "Block"
Nadav Rotem [Sun, 26 Feb 2012 08:59:25 +0000 (08:59 +0000)]
Fix compilation on MSVC. Rename "_BB" to "Block"

Thanks zygoloid.

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

12 years agofix a copy-and-paste error in the docs
Nadav Rotem [Sun, 26 Feb 2012 08:43:43 +0000 (08:43 +0000)]
fix a copy-and-paste error in the docs

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

12 years agoAdd a random .LL file generator to stress-test different llvm components.
Nadav Rotem [Sun, 26 Feb 2012 08:35:53 +0000 (08:35 +0000)]
Add a random .LL file generator to stress-test different llvm components.

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

12 years agoAdd testcase for the previous commit.
Rafael Espindola [Sun, 26 Feb 2012 05:49:57 +0000 (05:49 +0000)]
Add testcase for the previous commit.

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

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