Nate Begeman [Fri, 25 Apr 2008 18:07:40 +0000 (18:07 +0000)]
Pull the code to perform an INSERT_VECTOR_ELT in memory out into its own
function, and then use it to fix a bug in SplitVectorOp that expected inserts
to always have constant insertion indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50273
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Fri, 25 Apr 2008 17:54:21 +0000 (17:54 +0000)]
Update test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50272
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Fri, 25 Apr 2008 17:45:52 +0000 (17:45 +0000)]
Feedback from chris
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50271
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Apr 2008 17:25:00 +0000 (17:25 +0000)]
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50267
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 25 Apr 2008 17:21:40 +0000 (17:21 +0000)]
80 col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50266
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Fri, 25 Apr 2008 16:53:59 +0000 (16:53 +0000)]
Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50265
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 25 Apr 2008 08:55:28 +0000 (08:55 +0000)]
Not checking for intrinsics which do not have a chain operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50260
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 25 Apr 2008 08:22:20 +0000 (08:22 +0000)]
- Switch from std::set to SmallPtrSet.
- Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50259
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 25 Apr 2008 07:56:45 +0000 (07:56 +0000)]
MMX argument passing fixes:
On Darwin / Linux x86-32, v8i8, v4i16, v2i32 values are passed in MM[0-2].
On Darwin / Linux x86-32, v1i64 values are passed in memory.
On Darwin x86-64, v8i8, v4i16, v2i32 values are passed in XMM[0-7].
On Darwin x86-64, v1i64 values are passed in 64-bit GPRs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50257
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Fri, 25 Apr 2008 06:37:06 +0000 (06:37 +0000)]
Teach the PruningFunctionCloner how to look through loads with
ConstantExpression GEPs pointing into constant globals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50256
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Apr 2008 05:13:01 +0000 (05:13 +0000)]
Loosen up an assertion to allow intrinsics. I really have no
idea what this code (findNonImmUse) does, so I'm only guessing
that this is the right thing. It would be really really nice
if this had comments and perhaps switched to SmallPtrSet
(hint hint) :)
This fixes rdar://
5886601, a crash on gcc.target/i386/sse4_1-pblendw.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50252
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 25 Apr 2008 04:12:29 +0000 (04:12 +0000)]
Don't infininitely thread branches when a threaded edge
goes back to the block, e.g.:
Threading edge through bool from 'bb37.us.thread3829' to 'bb37.us' with cost: 1, across block:
bb37.us: ; preds = %bb37.us.thread3829, %bb37.us, %bb33
%D1361.1.us = phi i32 [ %tmp36, %bb33 ], [ %D1361.1.us, %bb37.us ], [ 0, %bb37.us.thread3829 ] ; <i32> [#uses=2]
%tmp39.us = icmp eq i32 %D1361.1.us, 0 ; <i1> [#uses=1]
br i1 %tmp39.us, label %bb37.us, label %bb42.us
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50251
91177308-0d34-0410-b5e6-
96231b3b80d8
Gordon Henriksen [Fri, 25 Apr 2008 03:21:19 +0000 (03:21 +0000)]
PR2245: Misleading parameter name in llvm-c/Core.h:LLVMConstArray
Applying fix by Frits van Bommel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50250
91177308-0d34-0410-b5e6-
96231b3b80d8
Gordon Henriksen [Fri, 25 Apr 2008 02:52:30 +0000 (02:52 +0000)]
PR2202: LLVMCreateInterpreter creates a JIT
Applying fix by Frits van Bommel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50249
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 25 Apr 2008 00:26:43 +0000 (00:26 +0000)]
Fix bug in x86 memcpy / memset lowering. If there are trailing bytes not handled by rep instructions, a new memcpy / memset is introduced for them. However, since source / destination addresses are already adjusted, their offsets should be zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50239
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 24 Apr 2008 23:49:45 +0000 (23:49 +0000)]
Implement != for DenseSet iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50236
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 24 Apr 2008 23:48:12 +0000 (23:48 +0000)]
Added iterator support for DenseSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50235
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 24 Apr 2008 20:01:58 +0000 (20:01 +0000)]
New test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50229
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 24 Apr 2008 18:42:47 +0000 (18:42 +0000)]
Adjust inline cost computation to be less aggressive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50222
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Thu, 24 Apr 2008 17:59:03 +0000 (17:59 +0000)]
Add EXTRA_OPTIONS on the llvmgxx command line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50217
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Thu, 24 Apr 2008 17:54:25 +0000 (17:54 +0000)]
Add EXTRA_OPTIONS on the llvmgcc command line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50216
91177308-0d34-0410-b5e6-
96231b3b80d8
Gabor Greif [Thu, 24 Apr 2008 16:17:27 +0000 (16:17 +0000)]
overlook Output directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50212
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 24 Apr 2008 09:06:33 +0000 (09:06 +0000)]
- Check if a register is livein before removing it. It may have already been removed.
- Do not iterate over SmallPtrSet, the order of iteration is not deterministic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50209
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Apr 2008 06:00:30 +0000 (06:00 +0000)]
% -> @
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50206
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Apr 2008 05:59:56 +0000 (05:59 +0000)]
Doc updates/edits, contributed by Terence Parr!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50205
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Apr 2008 00:21:50 +0000 (00:21 +0000)]
code restructuring, not functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50203
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Apr 2008 00:19:54 +0000 (00:19 +0000)]
Don't replace multiple result of calls with undef,
sccp tracks getresult values, not call values in this
case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50202
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Apr 2008 00:16:28 +0000 (00:16 +0000)]
code cleanup, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50201
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 24 Apr 2008 00:01:19 +0000 (00:01 +0000)]
Split some code out of the main SimplifyCFG loop into its own function.
Fix said code to handle merging return instructions together correctly
when handling multiple return values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50199
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 23 Apr 2008 23:15:23 +0000 (23:15 +0000)]
Make these variables static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50196
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 22:46:24 +0000 (22:46 +0000)]
Disable building of llvm2cpp. The directory will be removed before 2.3 release.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50193
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 22:44:03 +0000 (22:44 +0000)]
Drop dead includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50192
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 22:41:53 +0000 (22:41 +0000)]
Fix tests due to llvm2cpp move to llc target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50191
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 22:37:03 +0000 (22:37 +0000)]
Adjust option names for C++ backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50190
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 22:29:24 +0000 (22:29 +0000)]
First step of implementing PR1538: move llvm2cpp logic to new 'target'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50189
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 23 Apr 2008 21:49:29 +0000 (21:49 +0000)]
Initial CBE support for multiple return values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50187
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 20:33:41 +0000 (20:33 +0000)]
tighten up verifier checks which missed cases where
return instrs operands didn't match up with function results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50182
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 23 Apr 2008 20:25:16 +0000 (20:25 +0000)]
Use isa instead of dyn_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50181
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 23 Apr 2008 20:21:29 +0000 (20:21 +0000)]
Add support to codegen for getresult instructions with undef operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50180
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 23 Apr 2008 20:18:29 +0000 (20:18 +0000)]
Check type instead of no. of operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50179
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 23 Apr 2008 20:11:27 +0000 (20:11 +0000)]
Allow llvm-as to parse a getresult with an undef operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50175
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Wed, 23 Apr 2008 18:34:37 +0000 (18:34 +0000)]
Rewrite previous patch to suit Chris's preference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50174
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:26:03 +0000 (18:26 +0000)]
Unbreak JIT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50173
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:25:44 +0000 (18:25 +0000)]
Disable stack realignment for these tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50172
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:25:16 +0000 (18:25 +0000)]
Fix test becase ABI stack alignment dropped to 'normal' value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50171
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:24:48 +0000 (18:24 +0000)]
Fix test, instruction count is valid only if stack is not realigned
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50170
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:24:25 +0000 (18:24 +0000)]
Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50169
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:23:50 +0000 (18:23 +0000)]
Only allow increase of max alignment value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50168
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:23:30 +0000 (18:23 +0000)]
Be over-conservative: scan for all used virtual registers and calculate maximal stack alignment in assumption, that there will be spill of vector register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50167
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:23:05 +0000 (18:23 +0000)]
Add X86 Maximal Stack Alignment Calculator Pass before RA
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50166
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:22:28 +0000 (18:22 +0000)]
Add facility for pre-RA passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50165
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:21:50 +0000 (18:21 +0000)]
Use precomputed value, if any
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50164
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:21:27 +0000 (18:21 +0000)]
Do proper book-keeping of offsets and prologue/epilogue code for stack realignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50163
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:21:02 +0000 (18:21 +0000)]
If stack realignment is used - incoming args will use EBP as base register and locals - ESP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50162
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:20:17 +0000 (18:20 +0000)]
Eastimate required stack alignment early, so we can decide, whether we will need frame pointer or not
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50161
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:19:47 +0000 (18:19 +0000)]
Cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50160
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:19:23 +0000 (18:19 +0000)]
Cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50159
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:18:36 +0000 (18:18 +0000)]
Simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50158
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:18:10 +0000 (18:18 +0000)]
Make stack alignment options global for all targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50157
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:17:11 +0000 (18:17 +0000)]
Provide option for enabling-disabling stack realignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50156
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:16:43 +0000 (18:16 +0000)]
Disable stack realignment for functions with dynamic-sized alloca's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50155
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:16:16 +0000 (18:16 +0000)]
Provide ABI-correct stack alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50154
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:15:48 +0000 (18:15 +0000)]
Provide convenient helpers for some operations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50153
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Wed, 23 Apr 2008 18:15:11 +0000 (18:15 +0000)]
Whitespace cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50152
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 23 Apr 2008 17:50:15 +0000 (17:50 +0000)]
Fix some whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50151
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 23 Apr 2008 07:13:17 +0000 (07:13 +0000)]
Use the Create static method for some of these objects. They no longer
have public constructors. This should fix PR2246.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50145
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 06:16:27 +0000 (06:16 +0000)]
simplify code for propagation of constant arguments into
callees.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50142
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 05:59:23 +0000 (05:59 +0000)]
Fix a number of bugs in ipconstantprop, simplify the code, fit in 80 cols,
fix read after free bug (PR2238).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50141
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 05:38:20 +0000 (05:38 +0000)]
Rewrite multiple return value handling in SCCP. Before, the -sccp pass
would turn every getresult instruction into undef. This helps with
rdar://
5778210
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50140
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 05:37:08 +0000 (05:37 +0000)]
regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50139
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 05:36:58 +0000 (05:36 +0000)]
Validate that the result of a function type is valid using shared
logic with vmcore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50138
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 05:36:34 +0000 (05:36 +0000)]
Enforce that multiple return values have to have at least one result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50137
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 05:36:04 +0000 (05:36 +0000)]
remove this testcase. It isn't testing loop rotate, it is testing all
of -std-compile-opts and is now failing because other passes are generating
IR that looks different to input of loop rotate. Devang, please
introduce a testcase that only runs loop rotate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50136
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 05:29:14 +0000 (05:29 +0000)]
returning an empty multiple return list is not valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50135
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 04:59:35 +0000 (04:59 +0000)]
fix description of 'ret' to be more correct with multiple return
values. Clarify that it is impossible to 'multiply return' a
struct with zero elements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50131
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 04:06:52 +0000 (04:06 +0000)]
Allow undef as an operand to getresult.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50130
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 04:06:15 +0000 (04:06 +0000)]
Verify that the operand of a getresult instruction is a
call/invoke or undef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50129
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 03:49:32 +0000 (03:49 +0000)]
make this test more interesting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50128
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 23 Apr 2008 03:03:42 +0000 (03:03 +0000)]
distill down the essense of this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50125
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Wed, 23 Apr 2008 01:22:22 +0000 (01:22 +0000)]
new test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50123
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Wed, 23 Apr 2008 01:03:05 +0000 (01:03 +0000)]
Do not change the type of a ByVal argument to a
type of a different size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50121
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Wed, 23 Apr 2008 00:38:06 +0000 (00:38 +0000)]
Don't do: "(X & 4) >> 1 == 2 --> (X & 4) == 4" if there are more than one uses of the shift result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50118
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 22 Apr 2008 21:40:39 +0000 (21:40 +0000)]
Start doing the significantly useful part of jump threading: handle cases
where a comparison has a phi input and that phi is a constant. For example,
stuff like:
Threading edge through bool from 'bb2149' to 'bb2231' with cost: 1, across block:
bb2237: ; preds = %bb2231, %bb2149
%tmp2328.rle = phi i32 [ %tmp2232, %bb2231 ], [ %tmp2232439, %bb2149 ] ; <i32> [#uses=2]
%done.0 = phi i32 [ %done.2, %bb2231 ], [ 0, %bb2149 ] ; <i32> [#uses=1]
%tmp2239 = icmp eq i32 %done.0, 0 ; <i1> [#uses=1]
br i1 %tmp2239, label %bb2231, label %bb2327
or
bb38.i298: ; preds = %bb33.i295, %bb1693
%tmp39.i296.rle = phi %struct.ibox* [ null, %bb1693 ], [ %tmp39.i296.rle1109, %bb33.i295 ] ; <%struct.ibox*> [#uses=2]
%minspan.1.i291.reg2mem.1 = phi i32 [ 32000, %bb1693 ], [ %minspan.0.i288, %bb33.i295 ] ; <i32> [#uses=1]
%tmp40.i297 = icmp eq %struct.ibox* %tmp39.i296.rle, null ; <i1> [#uses=1]
br i1 %tmp40.i297, label %implfeeds.exit311, label %bb43.i301
This triggers thousands of times in spec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50110
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 22 Apr 2008 20:46:09 +0000 (20:46 +0000)]
Dig through multiple levels of AND to thread jumps if needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50106
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 22 Apr 2008 07:12:26 +0000 (07:12 +0000)]
Move MemCpyOpt after GVN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50097
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 22 Apr 2008 07:05:46 +0000 (07:05 +0000)]
Teach jump threading to thread through blocks like:
br (and X, phi(Y, Z, false)), label L1, label L2
This triggers once on 252.eon and 6 times on 176.gcc. Blocks
in question often look like this:
bb262: ; preds = %bb261, %bb248
%iftmp.251.0 = phi i1 [ true, %bb261 ], [ false, %bb248 ] ; <i1> [#uses=4]
%tmp270 = icmp eq %struct.rtx_def* %tmp.0.i, null ; <i1> [#uses=1]
%bothcond = or i1 %iftmp.251.0, %tmp270 ; <i1> [#uses=1]
br i1 %bothcond, label %bb288, label %bb273
In this case, it is clear that it doesn't matter if tmp.0.i is null when coming from bb261. When coming from bb248, it is all that matters.
Another random example:
check_asm_operands.exit: ; preds = %check_asm_operands.exit.thr_comm, %bb30.i, %bb12.i, %bb6.i413
%tmp.0.i420 = phi i1 [ true, %bb6.i413 ], [ true, %bb12.i ], [ true, %bb30.i ], [ false, %check_asm_operands.exit.thr_comm ; <i1> [#uses=1]
call void @llvm.stackrestore( i8* %savedstack ) nounwind
%tmp4389 = icmp eq i32 %added_sets_1.0, 0 ; <i1> [#uses=1]
%tmp4394 = icmp eq i32 %added_sets_2.0, 0 ; <i1> [#uses=1]
%bothcond80 = and i1 %tmp4389, %tmp4394 ; <i1> [#uses=1]
%bothcond81 = and i1 %bothcond80, %tmp.0.i420 ; <i1> [#uses=1]
br i1 %bothcond81, label %bb4398, label %bb4397
Here is the case from 252.eon:
bb290.i.i: ; preds = %bb23.i57.i.i, %bb8.i39.i.i, %bb100.i.i, %bb100.i.i, %bb85.i.i110
%myEOF.1.i.i = phi i1 [ true, %bb100.i.i ], [ true, %bb100.i.i ], [ true, %bb85.i.i110 ], [ true, %bb8.i39.i.i ], [ false, %bb23.i57.i.i ] ; <i1> [#uses=2]
%i.4.i.i = phi i32 [ %i.1.i.i, %bb85.i.i110 ], [ %i.0.i.i, %bb100.i.i ], [ %i.0.i.i, %bb100.i.i ], [ %i.3.i.i, %bb8.i39.i.i ], [ %i.3.i.i, %bb23.i57.i.i ] ; <i32> [#uses=3]
%tmp292.i.i = load i8* %tmp16.i.i100, align 1 ; <i8> [#uses=1]
%tmp293.not.i.i = icmp ne i8 %tmp292.i.i, 0 ; <i1> [#uses=1]
%bothcond.i.i = and i1 %tmp293.not.i.i, %myEOF.1.i.i ; <i1> [#uses=1]
br i1 %bothcond.i.i, label %bb202.i.i, label %bb301.i.i
Factoring out 3 common predecessors.
On the path from any blocks other than bb23.i57.i.i, the load and compare
are dead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50096
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 22 Apr 2008 06:51:41 +0000 (06:51 +0000)]
Added command line option -no-lazy to disable JIT lazy compilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50095
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 22 Apr 2008 06:36:15 +0000 (06:36 +0000)]
refactor some code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50094
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 22 Apr 2008 06:35:14 +0000 (06:35 +0000)]
add a basic testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50093
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Tue, 22 Apr 2008 05:20:06 +0000 (05:20 +0000)]
Whoops! Undo r50087, unbreak the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50088
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Tue, 22 Apr 2008 05:16:51 +0000 (05:16 +0000)]
Reverse r47989. Part of removing 'unwinds to' support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50087
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Tue, 22 Apr 2008 05:16:02 +0000 (05:16 +0000)]
Start removing 'unwinds to' support from mainline in preparation for 2.3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50086
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 22 Apr 2008 03:57:36 +0000 (03:57 +0000)]
Add MemCpyOpt to LTO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50081
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 22 Apr 2008 03:21:48 +0000 (03:21 +0000)]
remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50080
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 22 Apr 2008 02:53:33 +0000 (02:53 +0000)]
optimize "p != gep p, ..." better. This allows us to compile
getelementptr-seteq.ll into:
define i1 @test(i64 %X, %S* %P) {
%C = icmp eq i64 %X, -1 ; <i1> [#uses=1]
ret i1 %C
}
instead of:
define i1 @test(i64 %X, %S* %P) {
%A.idx.mask = and i64 %X,
4611686018427387903 ; <i64> [#uses=1]
%C = icmp eq i64 %A.idx.mask,
4611686018427387903 ; <i1> [#uses=1]
ret i1 %C
}
And fixes the second half of PR2235. This speeds up the insertion sort
case by 45%, from 1.12s to 0.77s. In practice, this will significantly
speed up for loops structured like:
for (double *P = Base + N; P != Base; --P)
...
Which happens frequently for C++ iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50079
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 22 Apr 2008 02:45:44 +0000 (02:45 +0000)]
more fallout from Nicholas' asmprinter patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50078
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 21 Apr 2008 23:59:07 +0000 (23:59 +0000)]
Implement an x86-64 ABI detail of passing structs by hidden first
argument. The x86-64 ABI requires the incoming value of %rdi to
be copied to %rax on exit from a function that is returning a
large C struct.
Also, add a README-X86-64 entry detailing the missed optimization
opportunity and proposing an alternative approach.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50075
91177308-0d34-0410-b5e6-
96231b3b80d8
Gabor Greif [Mon, 21 Apr 2008 21:31:55 +0000 (21:31 +0000)]
fix some residual old API that fell thru the cracks of the conversion script, closes llvm.org/bugs/show_bug.cgi?id=2246
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50062
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 21 Apr 2008 20:07:30 +0000 (20:07 +0000)]
Fix an out-of-bounds access in -view-sunit-dags in the case of an
empty ScheduleDAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50054
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 21 Apr 2008 19:52:29 +0000 (19:52 +0000)]
Fix the encoding of the MMX movd that moves from MMX to 64-bit GPR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50053
91177308-0d34-0410-b5e6-
96231b3b80d8