Commit Graph

18729 Commits

Author SHA1 Message Date
Chris Lattner
f581c3b81e implement reading and writing of constant exprs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36394 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 07:07:11 +00:00
Owen Anderson
3a2b58f3ad Rollback some changes that adversely affected performance. I'm currently rethinking
my approach to this, so hopefully I'll find a way to do this without making this slower.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36392 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 06:40:39 +00:00
Chris Lattner
522b7b104c implement support for reading aggregate constants, including handling forward
constant references, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36391 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 05:48:56 +00:00
Chris Lattner
0eef08046e add supprot for FP constants, wide integers, and fix the encoding of MININT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36390 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 04:04:35 +00:00
Chris Lattner
e16504eb4e read basic constants: null, undef, integers <= 64bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36389 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 03:30:34 +00:00
Chris Lattner
631a8ed3ff fix off-by-one computing size for section abbrevs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36388 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 03:29:47 +00:00
Scott Michel
f147a8d56e Use '-1U' where '-1UL' is obvious overkill, eliminating gcc warnings about
tests always being true in the process.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36387 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 01:24:20 +00:00
Chris Lattner
e84bcb922d move check to the right place :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36386 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 00:21:45 +00:00
Chris Lattner
6dbfd7bfbc track global inits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36385 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 00:18:21 +00:00
Chris Lattner
2edd22b959 Emit module-level constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36384 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-24 00:16:04 +00:00
Dale Johannesen
00d56b96e5 modify per review commentary
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36383 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 23:33:31 +00:00
Devang Patel
2a5fa18997 Fix
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070423/048333.html


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36380 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 22:42:03 +00:00
Chris Lattner
0b2482a1eb Read global symtab
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36378 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 21:26:05 +00:00
Chris Lattner
8c99a8e768 fix off-by one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36377 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 21:23:41 +00:00
Chris Lattner
b992be14bb write out the symtab for globals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36374 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 20:35:01 +00:00
Dale Johannesen
56c42ef3e4 Make Thumb funcs containing islands 4-byte aligned. Fix bugs maintaining
BBOffsets and BBSizes when adjusting conditional branches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36372 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 20:09:04 +00:00
Dale Johannesen
bd24f3f398 add Align field, and use when generating function alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36371 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 20:07:25 +00:00
Dale Johannesen
24fb52da3c add isThumb (unused as yet)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36370 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 20:04:35 +00:00
Dale Johannesen
3bb6283eea Fix generic getInlineAsmLength
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36369 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 20:00:17 +00:00
Dale Johannesen
19f5469be4 make EmitAlignment work the way Chris says it should
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36368 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 19:58:54 +00:00
Chris Lattner
d127c1b5f3 implement reading of abbrevs, and writing of abbreviated global varrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36367 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 18:58:34 +00:00
Chris Lattner
36d5e7d31b first part of implementation of abbrevs. The writer isn't fully there yet and the
reader doesn't handle them at all yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36363 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 16:04:05 +00:00
Reid Spencer
2e40d03290 Cygwin doesn't have the RSS_LIMIT for get/setrlimit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36361 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 07:22:51 +00:00
Lauro Ramos Venancio
ede1d78969 X86 TLS: optimize the implementation of "local exec" model.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36359 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 01:28:10 +00:00
Chris Lattner
47f96bf246 promote LLVMBitCodes to be a public header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36358 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-23 01:01:37 +00:00
Christopher Lamb
95c218a83e PR400 phase 2. Propagate attributed load/store information through DAGs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36356 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 23:15:30 +00:00
Lauro Ramos Venancio
7d2cc2b983 X86 TLS: fix and optimize the implementation of "initial exec" model.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36355 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 22:50:52 +00:00
Christopher Lamb
032507d989 PR400 phase 1 implementation feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36354 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 22:22:02 +00:00
Jeff Cohen
dc4cb35105 Have compiler enforce this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36353 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 22:16:55 +00:00
Christopher Lamb
a7f0d3ce22 Support alignment queries for degenerate (length 1) vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36352 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 21:54:13 +00:00
Christopher Lamb
5c10424842 Regenerated
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36350 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 20:09:11 +00:00
Christopher Lamb
43c7f37942 PR400 work phase 1. Add attributed load/store instructions for volatile/align to LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36349 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 19:24:39 +00:00
Jeff Cohen
cb403d69fb Fix build problem with Gentoo 4.1.1-r3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36348 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 18:49:32 +00:00
Reid Spencer
b90909e405 For PR1136:
Add reference counting to ParamAttrsList and make use of it in Function,
CallInst and InvokeInst classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36346 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 17:28:03 +00:00
Chris Lattner
b9707d50f7 add llvm ir bitcode definition file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36337 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 07:03:00 +00:00
Chris Lattner
6742b4df5c build the bitcode dir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36332 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 06:26:05 +00:00
Chris Lattner
fd57cecd2c Initial support for writing bitcode files. This currently only writes types,
the type symtab, and global/function protos, and is missing the important
size optimization, but it is a place to start.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36331 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 06:24:45 +00:00
Chris Lattner
caee0dccff Initial support for reading bitcode files. They currently only read types,
the type symtab, and global/function protos, and are missing the important
size optimization, but it is a place to start.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36330 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 06:23:29 +00:00
Reid Spencer
4f859aa532 For PR1146:
Make ParamAttrsList objects unique. You can no longer directly create or
destroy them but instead must go through the ParamAttrsList::get()
interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36327 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 05:46:44 +00:00
Lauro Ramos Venancio
0ae4a3357a Implement PIC for arm-linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36324 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 00:04:12 +00:00
Lauro Ramos Venancio
2c5c111b6c X86 TLS: Implement review feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36318 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-21 20:56:26 +00:00
Reid Spencer
c67bdc288a Revert Christopher Lamb's load/store alignment changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36309 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-21 18:36:27 +00:00
Reid Spencer
b3b0727032 We only need one putchar which gives it a shot at getting matched by its
users.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36305 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-21 17:11:45 +00:00
Christopher Lamb
2330e4d4c4 add support for alignment attributes on load/store instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36301 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-21 08:16:25 +00:00
Owen Anderson
1b7f584fd8 Make PredicateSimplifier not use DominatorTree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36300 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-21 07:38:12 +00:00
Owen Anderson
cdacc498e4 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36299 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-21 07:12:44 +00:00
Devang Patel
3831c553e3 Reset vertex.
Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/048092.html


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36294 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-21 00:36:45 +00:00
Chris Lattner
d1458f1d30 Fix a bug that prevented the JIT from working correctly after llvm_shutdown.
Pass info objects are initialized by static ctors, so deleting them at
llvm_shutdown time prevents resurrection from working.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36292 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-21 00:12:18 +00:00
Chris Lattner
cd070759c4 Fix regressions introduced by my previous patch: opt calls verifier in a
way that the "Mod" ivar was not getting set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36291 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 23:59:29 +00:00
Lauro Ramos Venancio
0d3b67809c Allow the lowering of ISD::GLOBAL_OFFSET_TABLE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36290 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 23:02:39 +00:00
Chris Lattner
108ec4b1ca avoid mutating a global in an accessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36289 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 22:57:20 +00:00
Chris Lattner
f7e968a2a2 fit in 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36288 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 22:40:40 +00:00
Jeff Cohen
09b362cee6 Comment out usage of write() for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36287 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 22:40:10 +00:00
Chris Lattner
2c639add5f rename JIT::state -> JIT::jitstate to avoid shadowing ExecutionEngine::state
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36286 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 22:40:05 +00:00
Chris Lattner
a5f5a9c8e2 Fix a problem where primitive types lose their name after llvm_shutdown is called.
This also reduces the amount of work done at static construction time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36285 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 22:33:47 +00:00
Chris Lattner
19b6dcdfa9 catch a case that was biting jeffc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36284 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 21:48:08 +00:00
Lauro Ramos Venancio
b3a0417cad Implement "general dynamic", "initial exec" and "local exec" TLS models for
X86 32 bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36283 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 21:38:10 +00:00
Evan Cheng
ba647becb9 Specify S registers as D registers' sub-registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36280 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 21:20:10 +00:00
Evan Cheng
6120433e9e Specify sub-register relations. e.g. RAX: [EAX], EAX: [AX], AX: [AL,AH].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36279 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 21:15:21 +00:00
Evan Cheng
3cafbf7e5f Add sub-registers sets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36278 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 21:13:46 +00:00
Chris Lattner
93305bc462 add a crazy idea
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36273 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 20:18:43 +00:00
Devang Patel
58d7fbf250 Avoid recursion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36272 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 20:04:37 +00:00
Owen Anderson
df07335b46 Move more passes to using ETForest instead of DominatorTree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36271 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 06:27:13 +00:00
Jeff Cohen
5d4d7f1580 Make Microsoft assembler and linker happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36265 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 00:33:54 +00:00
Chris Lattner
3e1b03f98d Fix a message, patch by Christopher Lamb.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36264 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-19 18:42:38 +00:00
Lauro Ramos Venancio
267bfb553e Fix a bug in getFrameRegister.
Reported by Raul Herbster.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36262 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-19 14:09:38 +00:00
Zhou Sheng
843f0767ac Make use of ConstantInt::isZero instead of ConstantInt::isNullValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36261 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-19 05:39:12 +00:00
Zhou Sheng
223d65b651 Make the operations of APInt variables more efficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36260 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-19 05:35:00 +00:00
Evan Cheng
cc045d5df8 Revert Owen's last check-in. This is breaking Mac OS X / PPC llvm-gcc bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36258 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 22:39:00 +00:00
Dan Gohman
23420c09c0 Fix the spelling of the prefetchnta instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36256 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 14:09:14 +00:00
Owen Anderson
a65064bb3d Revert changes that caused breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36255 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 06:46:57 +00:00
Owen Anderson
325171eed8 Switch more uses of DominatorTree over to ETForest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36254 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 05:43:13 +00:00
Owen Anderson
fb4b3d117f Use ETForest instead of DominatorTree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36252 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 05:25:43 +00:00
Evan Cheng
f44c72817e VarInfo::UsedBlocks is no longer used. Remove.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36250 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 05:04:38 +00:00
Owen Anderson
ca2563d2d8 Use ETForest instead of DominatorTree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36249 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 04:55:33 +00:00
Owen Anderson
ee6dcaf906 Use new ETForest accessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36248 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 04:46:35 +00:00
Owen Anderson
26c37b1fdc Use ETForest instead of DominatorTree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36247 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 04:39:32 +00:00
Chris Lattner
61a4c072b9 allow SRL to simplify its operands, as it doesn't demand all bits as input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36245 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 03:06:49 +00:00
Chris Lattner
ec06e9a670 When replacing a node in SimplifyDemandedBits, if the old node used any
single-use nodes, they will be dead soon.  Make sure to remove them before
processing other nodes.  This implements CodeGen/X86/shl_elim.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36244 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 03:05:22 +00:00
Chris Lattner
0a16a1f738 fix a pasto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36242 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 03:01:40 +00:00
Evan Cheng
faf05bbaea Don't populate TryAgainList when coalescing only physical registers with virtual registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36240 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 02:30:19 +00:00
Devang Patel
5a713cc72f Cache DT[*SI] lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36239 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 01:19:55 +00:00
Chris Lattner
8dcd2f1a5b don't access argument list of prototypes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36238 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 00:57:22 +00:00
Devang Patel
7cc6dcf6e0 Fix
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/047971.html


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36236 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 00:53:01 +00:00
Evan Cheng
3fefc182a0 Increment use count of new virtuals created during PHI elimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36233 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 00:36:11 +00:00
Chris Lattner
b1b2f0bc44 Be more careful when inserting reused instructions. This fixes CodeGen/Generic/2007-04-17-lsr-crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36231 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 23:43:50 +00:00
Evan Cheng
7be6368cac Oops. Didn't mean to check in a quick hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36227 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 23:33:39 +00:00
Chris Lattner
8c7d2d56bf Fix a bug in my previous patch, grabbing the shift amount width from the
wrong operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36223 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 22:53:02 +00:00
Chris Lattner
120fba91a3 dag combiner just got better at pruning bits. This fixes CodeGen/ARM/rev.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36222 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 22:39:58 +00:00
Chris Lattner
895c4ab564 Fold (x << c1)>> c2 into a single shift if the bits shifted out aren't used.
This compiles:
int baz(long long a) { return (short)(((int)(a >>24)) >> 9); }

into:
_baz:
        srwi r2, r3, 1
        extsh r3, r2
        blr

on PPC, instead of:
_baz:
        slwi r2, r3, 8
        srwi r2, r2, 9
        extsh r3, r2
        blr

GCC produces:
_baz:
        srwi r10,r4,24
        insrwi r10,r3,24,0
        srawi r9,r3,24
        srawi r3,r10,9
        extsh r3,r3
        blr

This implements CodeGen/PowerPC/shl_elim.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36221 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 21:14:16 +00:00
Evan Cheng
20b0abc24f Copy coalescing change to prevent a physical register from being pin to a
long live interval that has low usage density.
1. Change order of coalescing to join physical registers with virtual
   registers first before virtual register intervals become too long.
2. Check size and usage density to determine if it's worthwhile to join.
3. If joining is aborted, assign virtual register live interval allocation
   preference field to the physical register.
4. Register allocator should try to allocate to the preferred register
   first (if available) to create identify moves that can be eliminated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36218 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 20:32:26 +00:00
Evan Cheng
e52eef8e9a Add a register allocation preference field; add a method to compute size of a live interval.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36216 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 20:25:11 +00:00
Evan Cheng
eff03db46d Change getAllocatableSet() so it returns allocatable registers for a specific register class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36215 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 20:23:34 +00:00
Evan Cheng
38b7ca6651 Keep track of number of uses within the function per virtual register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36214 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 20:22:11 +00:00
Anton Korobeynikov
e060b5385f Add comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36213 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 19:34:00 +00:00
Chris Lattner
95a5e0507e SIGN_EXTEND_INREG does not demand its top bits. Give SimplifyDemandedBits
a chance to hack on it.  This compiles:

int baz(long long a) { return (short)(((int)(a >>24)) >> 9); }

into:
_baz:
        slwi r2, r3, 8
        srwi r2, r2, 9
        extsh r3, r2
        blr

instead of:

_baz:
        srwi r2, r4, 24
        rlwimi r2, r3, 8, 0, 23
        srwi r2, r2, 9
        extsh r3, r2
        blr

This implements CodeGen/PowerPC/sign_ext_inreg1.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36212 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 19:03:21 +00:00
Dan Gohman
747603e39e Spell doFinalization right, so that it is a proper virtual override and
gets called.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36208 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 18:21:36 +00:00
Chris Lattner
261cdfbe5e remove use of BasicBlock::getNext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36205 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 18:09:47 +00:00
Chris Lattner
3c30d10b04 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36203 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 18:03:00 +00:00
Chris Lattner
e24c92a698 remove use of BasicBlock::getNext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36202 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:54:12 +00:00
Chris Lattner
8e8f865227 Remove use of Instruction::getNext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36201 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:52:45 +00:00
Chris Lattner
a0e1b0e98d eliminate use of Instruction::getNext()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36200 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:51:03 +00:00
Chris Lattner
decb0ca18b remove use of Instruction::getNext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36199 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:47:54 +00:00
Chris Lattner
b8e237bb86 eliminate use of Instruction::getPrev(). Patch by Gabor Greif in 2005.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36198 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:38:28 +00:00
Chris Lattner
4d8c16f15a eliminate a use of Instruction::getPrev(), patch by Gabor Greif in 2005.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36197 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:36:12 +00:00
Chris Lattner
d15dff24c6 rename X86FunctionInfo to X86MachineFunctionInfo to match the header file
it is defined in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36196 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:21:52 +00:00
Anton Korobeynikov
57fc00d5cf Implemented correct stack probing on mingw/cygwin for dynamic alloca's.
Also, fixed static case in presence of eax livin. This fixes PR331

PS: Why don't we still have push/pop instructions? :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36195 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 09:20:00 +00:00
Chris Lattner
18feb92e91 merge several fields in GlobalValue to use the same word, move CallingConv
field into SubclassData in Value.  This shrinks GlobalVAlue from 48->40
bytes, Function from 88->76, and GlobalVariable from 76->68.  This trims
4640 bytes off my testcase, reading a bc file without materializing any
functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36192 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 04:31:29 +00:00
Andrew Lenharth
15b7823006 Use this nifty Constraints thing and fix the inverted conditional moves
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36191 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 04:07:59 +00:00
Chris Lattner
f8dfef7437 The (negative) offset from a SymbolTableListTraits-using ilist to its container
object is always constant.  As such, evaluate it at compile time instead of storing
it as an ivar in SymbolTableListTraits.  This shrinks every SymbolTableListTraits
ilist by a word, shrinking BasicBlock from 44->40 bytes, Function from 96->88 bytes,
and Module from 60->52 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36189 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 04:04:14 +00:00
Chris Lattner
17fcdd5e1b Refactor SymbolTableListTraits to only have a single pointer in it, instead
of two.  This shrinkifies Function by 8 bytes (104->96) and Module by 8
bytes (68->60).  On a testcase of mine, this reduces the memory used to
read a module header from 565680b to 561024, a little over 4K.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36188 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 03:26:42 +00:00
Chris Lattner
56ecbf3013 SSE4 is apparently public now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36185 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 00:02:37 +00:00
Reid Spencer
e8501ab492 Make long line fit in 80 cols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36183 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 23:32:28 +00:00
Devang Patel
ac58516cdc Fix
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/047888.html


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36182 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 23:03:45 +00:00
Reid Spencer
9a9203b894 Fix problems in the PartSet lowering having to do with incorrect bit width.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36180 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 22:21:14 +00:00
Reid Spencer
ed48de2375 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36179 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 22:02:23 +00:00
Reid Spencer
ce1e8efc43 Okay, yes there *is* a getKeyLength method on ValueName. And, it should be
used because we *do* want to allow nulls in names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36178 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 22:01:57 +00:00
Jeff Cohen
c398709525 In the event that some really old non-Intel or -AMD CPU is encountered...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36177 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 21:59:44 +00:00
Reid Spencer
4ccf462b99 Implement @sext and @zext parameter attribute handling properly instead of
forcing every small argument of every function regardless of attributes or
calling convention to be expanded.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36174 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 21:50:40 +00:00
Jeff Cohen
22114c319a Before assuming that the original code didn't work for Athlon64, the person who
replaced it with a FIXME should have determined what did work.  Then he would have
realized that the code was in fact correct, and would have avoided breaking it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36173 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 21:48:58 +00:00
Devang Patel
6b1df0e863 Proivde getAnalysis<FPAnalysis>(Func) support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36159 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:56:24 +00:00
Devang Patel
f4bd76a035 Do not assert during analysis implementation initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36158 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:44:16 +00:00
Devang Patel
693941bb6e Print and delete on the fly pass managers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36157 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:39:59 +00:00
Reid Spencer
36fdde18c3 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36156 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:35:38 +00:00
Reid Spencer
43e607303b Check length of string before we walk off the end of it.
Thanks, Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36155 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:31:06 +00:00
Devang Patel
0ed8df38c2 Update module pass manager to support module passes that require
function passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36154 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:27:05 +00:00
Devang Patel
569a6fd9d5 Give each pass manager chance to manage lower level analysis pass, which is
pass required by one of pass managed by the manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36153 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:12:57 +00:00
Anton Korobeynikov
bed2946a96 Removed tabs everywhere except autogenerated & external files. Add make
target for tabs checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36146 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 18:10:23 +00:00
Reid Spencer
2eb203a1a9 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36144 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 17:47:06 +00:00
Reid Spencer
5b35fbe6b9 Use a more optimal way to get the name of a function. Thanks, Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36143 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 17:45:50 +00:00
Reid Spencer
9c15de11f1 Don't return 0 if the len == 5, let the assert handle that case.
Thanks, Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36139 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 16:56:54 +00:00
Reid Spencer
2b85c4595e For PR1336:
Subtarget option names must be given in lower case in order to be
recognized. Fixes test/CodeGen/Alpha/ctlz.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36125 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 14:06:19 +00:00
Reid Spencer
085659f040 Fix test/CodeGen/Generic/vector-constantexpr.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36123 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 07:08:44 +00:00
Reid Spencer
7780acb76a Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36122 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 06:56:07 +00:00
Reid Spencer
ebff55ce38 For PR1328:
Use the new parameter on Function::getIntrinsicID to identify cases where
a function is being called with an "llvm." name but it isn't actually an
intrinsic. In such cases generate an error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36121 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 06:55:42 +00:00
Reid Spencer
2db15e2b42 For PR1328:
Don't assert everytime an intrinsic name isn't recognized. Instead, make
the assert optional when callin getIntrinsicID(). This allows the assembler
to handle invalid intrinsic names gracefully.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36120 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 06:54:34 +00:00
Reid Spencer
3e35c8d15e Revert last patch. It was already fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36102 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 02:24:41 +00:00
Reid Spencer
b4a7fea7fd For PR1336:
Fix a div-by-zero bug noticed by APInt. This fixes:
test/Transforms/IndVarsSimplify/exit_value_tests.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36099 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 01:48:37 +00:00
Owen Anderson
e934fefd6b Tabs -> Spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36094 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 23:14:18 +00:00
Chris Lattner
a6a996d319 Fix PR1335 and Transforms/Inline/2007-04-15-InlineEH.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36090 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 21:38:06 +00:00
Chris Lattner
fe560b8c85 Fix a nasty bug introduced when apint'ified. This fixes
Transforms/IndVarsSimplify/exit_value_tests.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36081 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 19:52:49 +00:00
Owen Anderson
3dc6776b33 Remove ImmediateDominator analysis. The same information can be obtained from DomTree. A lot of code for
constructing ImmediateDominator is now folded into DomTree construction.

This is part of the ongoing work for PR217.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36063 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 08:47:27 +00:00
Chris Lattner
83ae2fcacc fix SimplifyLibCalls/IsDigit.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36047 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 05:38:40 +00:00
Chris Lattner
31755a024d Extend store merging to support the 'if/then' version in addition to if/then/else.
This sinks the two stores in this example into a single store in cond_next.  In this
case, it allows elimination of the load as well:

        store double 0.000000e+00, double* @s.3060
        %tmp3 = fcmp ogt double %tmp1, 5.000000e-01             ; <i1> [#uses=1]
        br i1 %tmp3, label %cond_true, label %cond_next
cond_true:              ; preds = %entry
        store double 1.000000e+00, double* @s.3060
        br label %cond_next
cond_next:              ; preds = %entry, %cond_true
        %tmp6 = load double* @s.3060            ; <double> [#uses=1]

This implements Transforms/InstCombine/store-merge.ll:test2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36040 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 01:02:18 +00:00
Chris Lattner
3284d1f18a refactor some code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36037 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-15 00:07:55 +00:00
Owen Anderson
9a341ff3c1 Fix some unsafe code. Also, tabs -> spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36035 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 23:57:00 +00:00
Owen Anderson
690c684fc6 Make ETForest depend on DomTree rather than IDom. This is the first step
in the long process that will be fixing PR 217.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36034 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 23:49:24 +00:00
Chris Lattner
e34e9a29dc fix long lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36031 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 23:32:02 +00:00
Chris Lattner
7c162645ae add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36028 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 23:06:09 +00:00
Chris Lattner
b7300fa8d2 Implement Transforms/InstCombine/vec_extract_elt.ll, transforming:
define i32 @test(float %f) {
        %tmp7 = insertelement <4 x float> undef, float %f, i32 0
        %tmp17 = bitcast <4 x float> %tmp7 to <4 x i32>
        %tmp19 = extractelement <4 x i32> %tmp17, i32 0
        ret i32 %tmp19
}

into:

define i32 @test(float %f) {
        %tmp19 = bitcast float %f to i32                ; <i32> [#uses=1]
        ret i32 %tmp19
}

On PPC, this is the difference between:

_test:
        mfspr r2, 256
        oris r3, r2, 8192
        mtspr 256, r3
        stfs f1, -16(r1)
        addi r3, r1, -16
        addi r4, r1, -32
        lvx v2, 0, r3
        stvx v2, 0, r4
        lwz r3, -32(r1)
        mtspr 256, r2
        blr

and:

_test:
        stfs f1, -4(r1)
        nop
        nop
        nop
        lwz r3, -4(r1)
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36025 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 23:02:14 +00:00
Chris Lattner
6987833651 Implement InstCombine/vec_demanded_elts.ll:test2. This allows us to turn
unsigned test(float f) {
 return _mm_cvtsi128_si32( (__m128i) _mm_set_ss( f*f ));
}

into:

_test:
        movss 4(%esp), %xmm0
        mulss %xmm0, %xmm0
        movd %xmm0, %eax
        ret

instead of:

_test:
        movss 4(%esp), %xmm0
        mulss %xmm0, %xmm0
        xorps %xmm1, %xmm1
        movss %xmm0, %xmm1
        movd %xmm1, %eax
        ret

GCC gets:

_test:
        subl    $28, %esp
        movss   32(%esp), %xmm0
        mulss   %xmm0, %xmm0
        xorps   %xmm1, %xmm1
        movss   %xmm0, %xmm1
        movaps  %xmm1, %xmm0
        movd    %xmm0, 12(%esp)
        movl    12(%esp), %eax
        addl    $28, %esp
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36020 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 22:29:23 +00:00
Chris Lattner
d6b7a1648c avoid copying sets and vectors around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36017 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 22:10:17 +00:00
Jeff Cohen
ac58a16f85 Fix PR1329.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36016 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 21:50:21 +00:00
Chris Lattner
1c35968d4d disable switch lowering using shift/and. It still breaks ppc bootstrap for
some reason.  :(  Will investigate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36011 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 19:39:41 +00:00
Chris Lattner
ae143ceb83 avoid iterator invalidation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36002 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 18:06:52 +00:00
Jeff Cohen
98a72203d7 An even better fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35998 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 17:18:29 +00:00
Jeff Cohen
e4aee1d3a4 Fix recent regression that broke several llvm-tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35996 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 16:55:19 +00:00
Anton Korobeynikov
e01017bba4 Fix PR1325: Case range optimization was performed in the case it
shouldn't. Also fix some "latent" bug on 64-bit platforms


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35990 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 13:25:55 +00:00
Chris Lattner
3ff981749b disable shift/and lowering to work around PR1325 for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35985 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 02:26:56 +00:00
Chris Lattner
35b9b49fd1 Implement a few missing xforms: printf("foo\n") -> puts. printf("x") -> putchar
printf("") -> noop.  Still need to do the xforms for fprintf.

This implements Transforms/SimplifyLibCalls/Printf.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35984 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 01:17:48 +00:00
Chris Lattner
8264a9fcca in addition to merging, constantmerge should also delete trivially dead globals,
in order to clean up after simplifylibcalls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35982 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 01:11:54 +00:00
Chris Lattner
6fe5541003 Implement PR1201 and test/Transforms/InstCombine/malloc-free-delete.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35981 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 00:20:02 +00:00
Chris Lattner
f25646bfb3 use an accessor to simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35979 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 00:17:39 +00:00
Chris Lattner
6f771d4351 add GetElementPtrInst::hasAllZeroIndices, a long-overdue helper method.
Writing it twice in the same day was too much for me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35978 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 00:12:57 +00:00
Reid Spencer
0468ab3025 We want the number of bits needed, not the power of 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35977 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-14 00:00:10 +00:00
Jeff Cohen
614408dc48 Silence VC++ warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35975 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-13 22:52:03 +00:00
Chris Lattner
c5494af8a9 Now that codegen prepare isn't defeating me, I can finally fix what I set
out to do! :)

This fixes a problem where LSR would insert a bunch of code into each MBB
that uses a particular subexpression (e.g. IV+base+C).  The problem is that
this code cannot be CSE'd back together if inserted into different blocks.

This patch changes LSR to attempt to insert a single copy of this code and
share it, allowing codegenprepare to duplicate the code if it can be sunk
into various addressing modes.  On CodeGen/ARM/lsr-code-insertion.ll,
for example, this gives us code like:

        add r8, r0, r5
        str r6, [r8, #+4]
..
        ble LBB1_4      @cond_next
LBB1_3: @cond_true
        str r10, [r8, #+4]
LBB1_4: @cond_next
...
LBB1_5: @cond_true55
        ldr r6, LCPI1_1
        str r6, [r8, #+4]

instead of:

        add r10, r0, r6
        str r8, [r10, #+4]
...
        ble LBB1_4      @cond_next
LBB1_3: @cond_true
        add r8, r0, r6
        str r10, [r8, #+4]
LBB1_4: @cond_next
...
LBB1_5: @cond_true55
        add r8, r0, r6
        ldr r10, LCPI1_1
        str r10, [r8, #+4]

Besides being smaller and more efficient, this makes it immediately
obvious that it is profitable to predicate LBB1_3 now :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35972 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-13 20:42:26 +00:00
Chris Lattner
dd77df3cbc Completely rewrite addressing-mode related sinking of code. In particular,
this fixes problems where codegenprepare would sink expressions into load/stores
that are not valid, and fixes cases where it would miss important valid ones.

This fixes several serious codesize and perf issues, particularly on targets
with complex addressing modes like arm and x86.  For example, now we compile
CodeGen/X86/isel-sink.ll to:

_test:
        movl 8(%esp), %eax
        movl 4(%esp), %ecx
        cmpl $1233, %eax
        ja LBB1_2       #F
LBB1_1: #T
        movl $4, (%ecx,%eax,4)
        movl $141, %eax
        ret
LBB1_2: #F
        movl (%ecx,%eax,4), %eax
        ret

instead of:

_test:
        movl 8(%esp), %eax
        leal (,%eax,4), %ecx
        addl 4(%esp), %ecx
        cmpl $1233, %eax
        ja LBB1_2       #F
LBB1_1: #T
        movl $4, (%ecx)
        movl $141, %eax
        ret
LBB1_2: #F
        movl (%ecx), %eax
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35970 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-13 20:30:56 +00:00
Reid Spencer
57ae4f5f01 Implement a getBitsNeeded method to determine how many bits are needed to
represent a string in binary form by an APInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35968 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-13 19:19:07 +00:00
Devang Patel
4beccb897d Remove use of SlowOperationInformer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35967 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-13 18:58:18 +00:00
Devang Patel
60b0d84594 Undo previous check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35966 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-13 18:35:15 +00:00
Devang Patel
02c768608a Hello uses LLVMSupport.a (SlowerOperationInformer)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35965 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-13 18:28:23 +00:00
Anton Korobeynikov
8085bcfdca Fix PR1323 : we haven't updated phi nodes in good manner :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35963 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-13 06:53:51 +00:00
Chris Lattner
5a3d40d88f arm has r+r*s and r+i addr modes, but no r+i+r*s addr modes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35962 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-13 06:50:55 +00:00
Zhou Sheng
daacf22537 Make the apint construction more effective.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35960 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-13 05:57:32 +00:00
Chris Lattner
7fec90ebf4 CSE simple binary expressions when they are inserted. This makes LSR produce
less huge code that needs to be cleaned up by sdisel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35959 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-13 05:04:18 +00:00
Reid Spencer
57c5b1815d Implement review feedback .. don't double search a set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35957 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 21:57:15 +00:00
Reid Spencer
df41353497 Make sure intrinsics that are lowered to functions make the function weak
linkage so we only end up with one of them in a program. These are, after
all overloaded and templatish in nature.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35956 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 21:53:38 +00:00
Reid Spencer
69f80a63a2 Provide support for intrinsics that lower themselves to a function body.
This can happen for intrinsics that are overloaded.  In such cases it is
necessary to emit a function prototype before the body of the function
that calls the intrinsic and to ensure we don't emit it multiple times.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35954 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 21:00:45 +00:00
Lauro Ramos Venancio
26ca64c884 Implement Thread Local Storage (TLS) in CBackend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35951 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 18:42:08 +00:00
Lauro Ramos Venancio
c763552299 Implement the "thread_local" keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35950 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 18:32:50 +00:00
Reid Spencer
eeedcb6905 Fix bugs in generated code for part_select and part_set so that llc doesn't
barf when CBE is run with a program that contains these intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35946 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 13:30:14 +00:00
Reid Spencer
37958093c6 Fix a bug in PartSet. The replacement value needs to be zext or trunc to
the size of the value, not just zext. Also, give better names to two BBs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35945 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 12:46:33 +00:00
Chris Lattner
3a508c94a6 the result of an inline asm copy can be an arbitrary VT that the register
class supports.  In the case of vectors, this means we often get the wrong
type (e.g. we get v4f32 instead of v8i16).  Make sure to convert the vector
result to the right type.  This fixes CodeGen/X86/2007-04-11-InlineAsmVectorResult.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35944 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 06:00:20 +00:00
Chris Lattner
4829b1c6ab fold noop vbitconvert instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35943 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 05:58:43 +00:00
Chris Lattner
c2941779c3 Fix weirdness handling single element vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35941 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 04:44:28 +00:00
Chris Lattner
6c284d716e Fix mmx paddq, add support for the 'y' register class, though it isn't tested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35940 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 04:14:49 +00:00
Reid Spencer
f75b874957 For PR1284:
Implement the "part_set" intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35938 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 02:48:46 +00:00
Chris Lattner
69d6f1358c improve the patch for PR1318 to also support grouped options with custom
handlers (like the pass list).  My previous fix only supported *new* command
line options, not additions to old ones.

This fixes test/Feature/load_module.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35935 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-12 00:36:29 +00:00
Chris Lattner
a1b253f58e Fix CodeGen/X86/2007-03-24-InlineAsmPModifier.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35926 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 22:29:46 +00:00
Reid Spencer
3234b3e1f2 Build Hello by default so it can be used in test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35922 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 21:03:37 +00:00
Chris Lattner
c24bbaddf8 fix an infinite loop compiling ldecod, notice by JeffC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35910 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 16:51:53 +00:00
Chris Lattner
e11529438c Fix incorrect fall-throughs in addr mode code. This fixes CodeGen/ARM/arm-negative-stride.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35909 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 16:17:12 +00:00
Chris Lattner
ab46275683 Fix Transforms/ScalarRepl/union-pointer.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35906 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 15:45:25 +00:00
Chris Lattner
159b0a4340 Fix PR1318 by reacting appropriately to a mutating option list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35905 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 15:35:18 +00:00
Reid Spencer
97c0e2107b Fix a bug where ICmpInst objects instantiated directly with a name would
not retain that name. Not noticed because AsmParser always sets name after
construction. However, llvm2cpp noticed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35903 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 13:04:48 +00:00
Reid Spencer
2cd43e402a Fix an approximate calculation in an assertion not to give false negatives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35901 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 13:00:04 +00:00
Chris Lattner
8a9f571052 Turn stuff like:
icmp slt i32 %X, 0              ; <i1>:0 [#uses=1]
        sext i1 %0 to i32               ; <i32>:1 [#uses=1]

into:

        %X.lobit = ashr i32 %X, 31              ; <i32> [#uses=1]

This implements InstCombine/icmp.ll:test[34]


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35891 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 06:57:46 +00:00
Chris Lattner
a2e2c9bbf3 Simplify some comparisons to arithmetic, this implements:
Transforms/InstCombine/icmp.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35890 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 06:53:04 +00:00
Chris Lattner
1eba01e9a0 Fix this harder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35888 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 06:50:51 +00:00
Chris Lattner
c56a81dff1 don't create shifts by zero, fix some problems with my previous patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35887 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 06:43:25 +00:00
Chris Lattner
ba41783dbb canonicalize (x <u 2147483648) -> (x >s -1) and (x >u 2147483647) -> (x <s 0)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35886 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 06:12:58 +00:00
Chris Lattner
66bc325bff fix a miscompilation of:
define i32 @test(i32 %X) {
entry:
        %Y = and i32 %X, 4              ; <i32> [#uses=1]
        icmp eq i32 %Y, 0               ; <i1>:0 [#uses=1]
        sext i1 %0 to i32               ; <i32>:1 [#uses=1]
        ret i32 %1
}

by moving code out of commonIntCastTransforms into visitZExt.  Simplify the
APInt gymnastics in it etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35885 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 05:45:39 +00:00
Chris Lattner
b062000c23 done
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35884 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 05:34:00 +00:00
Chris Lattner
20a35c3fa5 Teach the codegen to turn [aez]ext (setcc) -> selectcc of 1/0, which often
allows other simplifications.  For example, this compiles:
int isnegative(unsigned int X) {
   return !(X < 2147483648U);
}

Into this code:

x86:
        movl 4(%esp), %eax
        shrl $31, %eax
        ret
arm:
        mov r0, r0, lsr #31
        bx lr
thumb:
        lsr r0, r0, #31
        bx lr

instead of:

x86:
        cmpl $0, 4(%esp)
        sets %al
        movzbl %al, %eax
        ret

arm:
        mov r3, #0
        cmp r0, #0
        movlt r3, #1
        mov r0, r3
        bx lr

thumb:
        mov r2, #1
        mov r1, #0
        cmp r0, #0
        blt LBB1_2      @entry
LBB1_1: @entry
        cpy r2, r1
LBB1_2: @entry
        cpy r0, r2
        bx lr

Testcase here: test/CodeGen/Generic/ispositive.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35883 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 05:32:27 +00:00
Chris Lattner
1982ef20c4 Codegen integer abs more efficiently using the trick from the PPC CWG. This
improves codegen on many architectures.  Tests committed as CodeGen/*/iabs.ll

X86 Old:			X86 New:
_test:				_test:
   movl 4(%esp), %ecx		   movl 4(%esp), %eax
   movl %ecx, %eax		   movl %eax, %ecx
   negl %eax			   sarl $31, %ecx
   testl %ecx, %ecx		   addl %ecx, %eax
   cmovns %ecx, %eax		   xorl %ecx, %eax
   ret				   ret

PPC Old:			PPC New:
_test:				_test:
   cmpwi cr0, r3, -1		   srawi r2, r3, 31
   neg r2, r3			   add r3, r3, r2
   bgt cr0, LBB1_2 ;		   xor r3, r3, r2
LBB1_1: ;			   blr
   mr r3, r2
LBB1_2: ;
   blr

ARM Old:			ARM New:
_test:				_test:
   rsb r3, r0, #0		   add r3, r0, r0, asr #31
   cmp r0, #0			   eor r0, r3, r0, asr #31
   movge r3, r0			   bx lr
   mov r0, r3
   bx lr

Thumb Old:			Thumb New:
_test:				_test:
   neg r2, r0			   asr r2, r0, #31
   cmp r0, #0			   add r0, r0, r2
   bge LBB1_2			   eor r0, r2
LBB1_1: @			   bx lr
   cpy r0, r2
LBB1_2: @
   bx lr


Sparc Old:			Sparc New:
test:				test:
   save -96, %o6, %o6		   save -96, %o6, %o6
   sethi 0, %l0			   sra %i0, 31, %l0
   sub %l0, %i0, %l0		   add %i0, %l0, %l1
   subcc %i0, -1, %l1		   xor %l1, %l0, %i0
   bg .BB1_2			   restore %g0, %g0, %g0
   nop				   retl
.BB1_1:				   nop
   or %g0, %l0, %i0
.BB1_2:
   restore %g0, %g0, %g0
   retl
   nop

It also helps alpha/ia64 :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35881 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 05:11:38 +00:00
Chris Lattner
ed4e51e58e fix a regression introduced by my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35879 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 03:27:24 +00:00
Chris Lattner
ade7592085 Hack to get sys::Path to recognize macho dylibs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 03:15:35 +00:00
Reid Spencer
18da072088 For PR1146:
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35877 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 02:44:20 +00:00
Reid Spencer
947aa7de67 Teach sys::Path how to recognize different kinds of object files for ELF
and Mach-O systems. Additionally, correct the Mach-O logic code to look at
byte 12 not byte 15. Hopefully this fixes the llvm-ld warning on Darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35876 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 02:02:09 +00:00
Chris Lattner
f4b1818728 Simplify SROA conversion to integer in some ways, make it more general in others.
We now tolerate small amounts of undefined behavior, better emulating what
would happen if the transaction actually occurred in memory.  This fixes
SingleSource/UnitTests/2007-04-10-BitfieldTest.c on PPC, at least until
Devang gets a chance to fix the CFE from doing undefined things with bitfields :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35875 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 00:57:54 +00:00
Reid Spencer
410aa020a2 Make isDynamicLibrary detect more than just an ELF file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35874 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 00:49:39 +00:00
Bill Wendling
bb1ee05253 Add support for our first SSSE3 instruction "pmulhrsw".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35869 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-10 22:10:25 +00:00
Chris Lattner
bae3bd7c19 new micro optzn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35867 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-10 21:14:01 +00:00
Chris Lattner
eb13d1b710 restore support for negative strides
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35859 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-10 03:48:29 +00:00
Chris Lattner
c6eb6d7255 apparently some people commit without building the tree, or they forget to
commit a LOT of files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35858 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-10 03:20:39 +00:00
Chris Lattner
466b9bd757 unbreak the build :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35857 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-10 03:18:19 +00:00
Jeff Cohen
a838321648 Fix build problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35856 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-10 03:10:46 +00:00
Chris Lattner
81973ef7cb Strengthen the boundary conditions of this fold, implementing
InstCombine/set.ll:test25


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35852 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 23:52:13 +00:00
Jeff Cohen
2da8da46ba No longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35850 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 23:42:32 +00:00
Owen Anderson
cc221cdf0c Re-constify things that don't break the build. Last patch in this
series, I promise.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35848 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 23:38:18 +00:00
Chris Lattner
2b95fd67da remove dead target hooks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35847 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 23:34:08 +00:00
Chris Lattner
37caf8c68e remove dead target hooks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35846 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 23:33:39 +00:00
Chris Lattner
eb8c74ddf2 remove some dead hooks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35845 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 23:31:19 +00:00
Chris Lattner
9fda270e2c eliminate the last uses of some TLI methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35844 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 23:29:07 +00:00
Owen Anderson
f7c83188cd Unconst-ify stuff that broke the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35843 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 23:08:26 +00:00
Owen Anderson
ad19014591 Const-ify some parameters, and some cosmetic cleanups. No functionality
change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35842 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 22:54:50 +00:00
Owen Anderson
0cd0461873 Tabs -> Spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35841 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 22:31:43 +00:00
Chris Lattner
b445d0cbb9 remove some dead target hooks, subsumed by isLegalAddressingMode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35840 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 22:27:04 +00:00
Owen Anderson
17cba6d232 Improve some _slow_ behavior introduced in my patches the last few days.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35839 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 22:25:09 +00:00
Chris Lattner
579633cd10 switch LSR to use isLegalAddressingMode instead of other simpler hooks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35837 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 22:20:14 +00:00
Devang Patel
6c36157f3d Check _all_ PHINodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35836 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 22:20:10 +00:00
Chris Lattner
7c7ba9d2d5 Fix a bug in PPCTargetLowering::isLegalAddressingMode, scales other than 0/1/2
are always unsupported.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35835 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 22:10:05 +00:00
Anton Korobeynikov
54e2b142be Use integer log for metric calculation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35834 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 21:57:03 +00:00
Devang Patel
c415afc726 Insert new pre-header before new header. Original pre-header may
happen to be an entry, in such case, it is not a good idea to
insert new block before entry.

Also fix typo in assertion check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35833 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 21:40:43 +00:00
Chris Lattner
24e90d3c5b Fix a bug where calling materializeModule could corrupt the module, reading
multiple copies of the function into the Function*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35831 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 20:28:40 +00:00
Devang Patel
5464b96073 Preserve canonical loop form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35829 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 20:19:46 +00:00
Jeff Cohen
44f5fb46b0 When the number of elements is zero, don't malloc 32GB on 64-bit systems.
Fixes unexpected failures on FreeBSD/amd64 of:
  CFrontend/2005-09-24-BitFieldCrash.c:
  CFrontend/2007-02-04-EmptyStruct.c:
  CFrontend/2007-03-26-ZeroWidthBitfield.c:
  CodeGen/Generic/2005-10-18-ZeroSizeStackObject.ll:


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35828 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 19:26:30 +00:00
Reid Spencer
9101d8647f Don't link against System or Support library. These things will already
be in the opt tool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35827 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 19:17:47 +00:00
Devang Patel
e98815469c Do not create new pre-header. Reuse original pre-header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35825 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 19:04:21 +00:00
Reid Spencer
fa3e91242f For PR1146:
* Add ParamAttrs to InvokeInst class too.
* Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0
* Destruct the ParamAttrs in Call/Invoke destructors to avoid memory
  leaks. This will change when ParamAttrsList is uniquified but needs to
  be correct until then.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35824 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 18:00:57 +00:00
Reid Spencer
3aad26e4da Remove a memory leak, until ParamAttrsList is uniqued.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35823 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 17:20:18 +00:00
Devang Patel
4522c8a44c Simpler for() loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35822 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 17:09:13 +00:00
Devang Patel
cfde9594d1 Fix future bug. Of course, Chris spotted this.
Handle Argument or Undef as an incoming PHI value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35821 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 16:41:46 +00:00
Devang Patel
24a1c49172 More cosmetic changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35820 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 16:21:29 +00:00
Devang Patel
322313376a Only cosmetic changes. Zero functionality Change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35819 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 16:11:48 +00:00
Reid Spencer
4746ecf16e For PR1146:
* Add ParamAttrList pointers to Function and CallInst.
* Move the implementation of ParamAttrList from Type.cpp to Function.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 15:01:12 +00:00
Jeff Cohen
efc3662636 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35817 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 14:32:59 +00:00
Anton Korobeynikov
4198c58c71 Next stage into switch lowering refactoring
1. Fix some bugs in the jump table lowering threshold
2. Implement much better metric for optimal pivot selection
3. Tune thresholds for different lowering methods
4. Implement shift-and trick for lowering small (<machine word
length) cases with few destinations. Good testcase will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35816 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 12:31:58 +00:00
Chris Lattner
a9f120bd9f Convert ImmediateDominators::DFSPass from being recursive to being iterative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35815 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 06:44:42 +00:00