Commit Graph

44948 Commits

Author SHA1 Message Date
Owen Anderson
a33b6254bb Remove dead variable, const-ref-ize an APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123248 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 18:26:37 +00:00
Chris Lattner
f73b99ab43 this pass claims to preserve scev, make sure to tell it about deletions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123247 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 18:14:50 +00:00
Bob Wilson
6c562f69fe Fix a comment: We now have intrinsics for vcvtr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123246 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 17:56:41 +00:00
Chris Lattner
6038a6351e some comment improvements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123243 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 17:11:59 +00:00
Chris Lattner
3a5004dc3e Fix PR8946, a missing reg/reg form of movdqu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123242 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 17:04:55 +00:00
Daniel Dunbar
3771dd041f McARM: Sketch some logic for determining when to add carry set and predication code operands based on the "canonical mnemonic".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123239 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 15:59:53 +00:00
Daniel Dunbar
352e148cbe McARM: Add more hard coded logic to SplitMnemonicAndCC to also split out the
carry setting flag from the mnemonic.

Note that this currently involves me disabling a number of working cases in
arm_instructions.s, this is a hopefully short term evil which will be rapidly
fixed (and greatly surpassed), assuming my current approach flies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123238 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 15:59:50 +00:00
Jay Foad
67c619ba3e FixedNumOperandTraits and VariadicOperandTraits assumed that, given a
"this" pointer for any subclass of User, you could static_cast it to
User* and then reinterpret_cast that to Use* to get the end of the
operand list. This isn't a safe assumption in general, because the
static_cast might adjust the "this" pointer. Fixed by having these
OperandTraits classes take an extra template parameter, which is the
subclass of User. This is groundwork for PR889.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123235 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 15:07:38 +00:00
Frits van Bommel
65fdded319 Factor the actual simplification out of SimplifyIndirectBrOnSelect and into a new helper function so it can be reused in e.g. an upcoming SimplifySwitchOnSelect.
No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123234 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 12:52:11 +00:00
Kalle Raiskila
b9505f6bed Fix a thinko in 123226 that caused test failures on "other" platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123229 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 11:27:56 +00:00
Kalle Raiskila
76020ed6f3 Add a "nop filler" pass to SPU.
Filling no-ops is done just before emitting of assembly,
when the instruction stream is final. No-ops are inserted
to align the instructions so the dual-issue of the pipeline
is utilized. This speeds up generated code with a minimum of 
1% on a select set of algorithms.

This pass may be redundant if the instruction scheduler and 
all subsequent passes that modify the instruction stream 
(prolog+epilog inserter, register scavenger, are there others?)
are made aware of the instruction alignments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123226 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 09:07:54 +00:00
Eric Christopher
87376839a6 Temporarily revert 123133, it's causing some regressions and I'm trying
to get a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123225 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 09:02:09 +00:00
Chris Lattner
3077ca97bd update memdep when an instruction is deleted. This code isn't
actually reached in the testcase in PR8954, but it's safe and good
practice.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123224 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 08:19:16 +00:00
Chris Lattner
b6810991a9 when MergeBlockIntoPredecessor merges two blocks, update MemDep if it
is floating around in the ether.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123223 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 08:16:49 +00:00
Chris Lattner
b5b7997fd0 Fix FoldSingleEntryPHINodes to update memdep and AA when it deletes
phi nodes.  It is called from MergeBlockIntoPredecessor which is 
called from GVN, which claims to preserve these.

I'm skeptical that this is the actual problem behind PR8954, but
this is a stab in the right direction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123222 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 08:13:40 +00:00
Chris Lattner
b298db7253 random cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123221 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 08:00:40 +00:00
Chris Lattner
93767fdb61 remove a bogus assertion: the latch block of a loop is not
neccesarily an uncond branch to the header.  This fixes 
PR8955 (the assertion tripping).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123219 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 07:47:59 +00:00
Chris Lattner
9651870815 the GEP faq says that only inbounds geps are guaranteed to not overflow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123218 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 06:44:41 +00:00
Jakob Stoklund Olesen
f7624bc6dd Revert r123207: "Turn on memdep's verifyRemoved() in an attempt to smoke out the cause of our gcc bootstrap miscompare."
It didn't.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123215 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 04:05:39 +00:00
Michael J. Spencer
218dc3e2fe Support/Path: Deprecate PathV1::isDirectory and replace all uses with PathV2::is_directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123209 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 01:21:55 +00:00
Jakob Stoklund Olesen
121704d738 Turn on memdep's verifyRemoved() in an attempt to smoke out the cause of our gcc bootstrap miscompare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123207 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 01:18:03 +00:00
Chandler Carruth
15ed90c859 Teach constant folding to perform conversions from constant floating
point values to their integer representation through the SSE intrinsic
calls. This is the last part of a README.txt entry for which I have real
world examples.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123206 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 01:07:24 +00:00
Owen Anderson
da1c122da5 Fix a random missed optimization by making InstCombine more aggressive when determining which bits are demanded by
a comparison against a constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123203 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 00:36:45 +00:00
Eric Christopher
93c70426f5 Move ExpandAtomic into the integer expansion routines - it's only used there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123202 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 00:36:08 +00:00
Eric Christopher
94bb7b561c Even if we don't have 7 bytes of stack space we may need to save and
restore the stack pointer from the frame pointer on thumbv6.

Fixes rdar://8819685


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123196 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 00:16:04 +00:00
Eric Christopher
4dd312f233 Expand on the safeness of restoring the sp from the fp a bit more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123193 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 23:10:59 +00:00
Dale Johannesen
97fd9a58de Fix PR 8916 (qv for analysis), at least the immediate problem.
There's an inherent tension in DAGCombine between assuming
that things will be put in canonical form, and the Depth
mechanism that disables transformations when recursion gets
too deep.  It would not surprise me if there's a lot of little
bugs like this one waiting to be discovered.  The mechanism
seems fragile and I'd suggest looking at it from a design viewpoint.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123191 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 21:53:07 +00:00
Chris Lattner
4a6fb94c40 +0.0 vs -0.0 differences can be handled by looking at the user of the
operation in some cases.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 21:01:17 +00:00
Daniel Dunbar
8ab1112bdc McARM: Flush out hard coded known non-predicated mnemonic list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123189 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 21:01:03 +00:00
Daniel Dunbar
8d66b7852a McARM: Mark some T2 ...s instructions as codegen only, they aren't real
instructions but are restricted pseudo forms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123177 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 15:26:39 +00:00
Daniel Dunbar
238100aaa7 ARM/MC: Mark several '...S' instructions as codegen only, they aren't real
instructions but are restricted pseudo forms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123176 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 15:26:35 +00:00
Daniel Dunbar
6a5c22ed89 MC/ARM/AsmParser: Minor nitty fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123175 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 15:26:21 +00:00
Anton Korobeynikov
2c8bd754de Fix merge fallout
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123172 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 12:56:18 +00:00
Anton Korobeynikov
7af6fad0a7 Update CMake stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123171 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 12:39:23 +00:00
Anton Korobeynikov
16c29b5f28 Rename TargetFrameInfo into TargetFrameLowering. Also, put couple of FIXMEs and fixes here and there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123170 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 12:39:04 +00:00
Daniel Dunbar
badbd2fde9 MC/ARM/AsmParser: Split out SplitMnemonicAndCC().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123169 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 12:24:52 +00:00
Chandler Carruth
f4db877cff Cleanup some of the constant folding code to consistently test intrinsic
IDs when available rather than using a mixture of IDs and textual name
comparisons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123165 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 09:02:58 +00:00
Chris Lattner
622a11bc07 fit in 80 cols and use MBB::isSuccessor instead of a hand
rolled std::find.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123164 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 07:51:31 +00:00
Chandler Carruth
9cc9f50abc Teach instcombine about the rest of the SSE and SSE2 conversion
intrinsics element dependencies. Reviewed by Nick.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123161 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 07:19:37 +00:00
Jakob Stoklund Olesen
c9df025e33 Simplify a bunch of isVirtualRegister() and isPhysicalRegister() logic.
These functions not longer assert when passed 0, but simply return false instead.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123155 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 02:58:51 +00:00
Michael J. Spencer
83a113b77c Fix Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123152 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 02:34:40 +00:00
Michael J. Spencer
54453f2978 Support/Path: Deprecate PathV1::exists and replace all uses with PathV2::fs::exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123151 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 02:34:23 +00:00
Chris Lattner
f4afaa81f2 another random stab in the dark trying to fix llvm-gcc-i386-linux-selfhost
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123149 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 02:34:11 +00:00
Chris Lattner
a806be66c1 another (more) aggressive attempt to bring llvm-gcc-i386-linux-selfhost
back to life.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123146 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 00:47:34 +00:00
Chris Lattner
00a35d0f14 expand on a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123145 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 00:33:01 +00:00
Chris Lattner
d8408270f3 temporarily disable memset formation from memsets in an effort to restore buildbot stability.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123144 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 23:52:48 +00:00
Chris Lattner
66d7a5793c typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123142 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 23:48:41 +00:00
Chris Lattner
7cc4e304a6 xref a PR #
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123141 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 23:42:22 +00:00
Chris Lattner
bd9d53cc65 add a fixme: ir isn't expressive enough.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123139 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 23:02:10 +00:00
Chris Lattner
53e1d45adb Step #4 in improving trip count analysis: HowFarToZero can analyze
NUW AddRec's much more aggressively.  We now get a trip count
for @test2 in nsw.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123138 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 22:58:47 +00:00
Chris Lattner
7975e3ebba rearrange some code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123136 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 22:39:48 +00:00
Chandler Carruth
fb00e2715b Add a note about the inability to model FP -> int conversions which
perform rounding other than truncation in the IR. Common C code for this
turns into really an LLVM intrinsic call that blocks a lot of further
optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123135 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 22:36:18 +00:00
Chris Lattner
ad19c8c63c Step #3 to improving trip count analysis: If we fold
a + {b,+,stride} into {a+b,+,stride}  (because a is LIV),
then the resultant AddRec is NUW/NSW if the client says it
is.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123133 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 22:31:26 +00:00
Chris Lattner
992efb0378 Step #2 to improve trip count analysis for loops like this:
void f(int* begin, int* end) { std::fill(begin, end, 0); }

which turns into a != exit expression where one pointer is
strided and (thanks to step #1) known to not overflow, and 
the other is loop invariant.

The observation here is that, though the IV is strided by
4 in this case, that the IV *has* to become equal to the
end value.  It cannot "miss" the end value by stepping over
it, because if it did, the strided IV expression would
eventually wrap around.

Handle this by turning A != B into "A-B != 0" where the A-B
part is known to be NUW.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123131 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 22:26:35 +00:00
Jakob Stoklund Olesen
42e9c96392 Remove MachineRegisterInfo::getLastVirtReg(), it was giving wrong results
when no virtual registers have been allocated.

It was only used to resize IndexedMaps, so provide an IndexedMap::resize()
method such that

 Map.grow(MRI.getLastVirtReg());

can be replaced with the simpler

 Map.resize(MRI.getNumVirtRegs());

This works correctly when no virtuals are allocated, and it bypasses the to/from
index conversions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123130 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 21:58:20 +00:00
Chris Lattner
9dddf08eb8 sort this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123129 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 21:31:39 +00:00
Jakob Stoklund Olesen
be97e906e0 Teach TargetRegisterInfo how to cram stack slot indexes in with the virtual and
physical register numbers.

This makes the hack used in LiveInterval official, and lets LiveInterval be
oblivious of stack slots.

The isPhysicalRegister() and isVirtualRegister() predicates don't know about
this, so when a variable may contain a stack slot, isStackSlot() should always
be tested first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123128 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 21:17:37 +00:00
Chandler Carruth
96b1b6c135 Add a note about a missed FP optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123126 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 21:00:19 +00:00
Chris Lattner
f42685004c fix a few old bugs (found by inspection) where we would zap instructions
without informing memdep.  This could cause nondeterminstic weirdness 
based on where instructions happen to get allocated, and will hopefully
breath some life into some broken testers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123124 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 19:26:10 +00:00
Jakob Stoklund Olesen
2cfa5b4934 Add a forgotten VireReg2IndexFunctor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123123 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 18:58:33 +00:00
Tobias Grosser
aa2be84356 Instcombine: Fix pattern where the sext did not dominate the icmp using it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123121 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 16:00:11 +00:00
Cameron Zwarich
e7d7865bfd LoopInstSimplify preserves LoopSimplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123117 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 12:35:16 +00:00
Chandler Carruth
694d753b09 Another missed memset in std::vector initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123116 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 11:29:57 +00:00
Cameron Zwarich
f78df5ebb8 Eliminate some extra hash table lookups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123115 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 10:54:21 +00:00
Cameron Zwarich
e272deed7b Add an informative comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123114 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 10:32:30 +00:00
Chandler Carruth
27a2a13b62 Fix a cut-paste-o so that the sample code is correct for my last note.
Also, switch to a more clear 'sink' function with its declaration to
avoid any confusion about 'g'. Thanks for the suggestion Frits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123113 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 10:10:59 +00:00
Chandler Carruth
e5ca494ae6 Another missed optimization of trivial vector code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123112 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 09:58:36 +00:00
Chandler Carruth
d8723a9b55 Add a note about vector's size-constructor producing dead stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123111 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 09:58:33 +00:00
Jakob Stoklund Olesen
0804ead404 Simplify LiveDebugVariables by storing MachineOperand copies locations instead
of using a Location class with the same information.

When making a copy of a MachineOperand that was already stored in a
MachineInstr, it is necessary to clear the parent pointer on the copy. Otherwise
the register use-def lists become inconsistent.

Add MachineOperand::clearParent() to do that. An alternative would be a custom
MachineOperand copy constructor that cleared ParentMI. I didn't want to do that
because of the performance impact.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123109 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 05:33:21 +00:00
Jakob Stoklund Olesen
00f93fc046 Shrink a BitVector that didn't mean to store bits for all physical registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123108 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 03:45:44 +00:00
Jakob Stoklund Olesen
4314268128 Replace TargetRegisterInfo::printReg with a PrintReg class that also works without a TRI instance.
Print virtual registers numbered from 0 instead of the arbitrary
FirstVirtualRegister. The first virtual register is printed as %vreg0.
TRI::NoRegister is printed as %noreg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123107 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 03:05:53 +00:00
Jakob Stoklund Olesen
994c727b57 Use IndexedMap for MachineRegisterInfo as well. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123106 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 03:05:46 +00:00
Chris Lattner
6d5a2411aa teach SCEV analysis of PHI nodes that PHI recurences formed
with GEP instructions are always NUW, because PHIs cannot wrap
the end of the address space.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123105 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 02:28:48 +00:00
Chris Lattner
f1859891b7 reduce indentation. Print <nuw> and <nsw> when dumping SCEV AddRec's
that have the bit set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123104 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 02:16:18 +00:00
Chandler Carruth
75fbd3793f Add a note about a missed memset optimization from std::fill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123103 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 01:32:55 +00:00
Jakob Stoklund Olesen
b258135301 Fix the last virtual register enumerations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123102 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 23:11:11 +00:00
Jakob Stoklund Olesen
c7d67f90d3 Fix VirtRegMap to use TRI::index2VirtReg and TRI::virtReg2Index instead of
depending on TRI::FirstVirtualRegister.

Also use TRI::printReg instead of printing virtual registers directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123101 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 23:11:07 +00:00
Jakob Stoklund Olesen
98c5476070 Fix a MachineVerifier loop that probably didn't mean to skip the last two
virtual registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123100 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 23:11:02 +00:00
Jakob Stoklund Olesen
b421c566f5 Use an IndexedMap for LiveVariables::VirtRegInfo.
Provide MRI::getNumVirtRegs() and TRI::index2VirtReg() functions to allow
iteration over virtual registers without depending on the representation of
virtual register numbers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123098 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 23:10:57 +00:00
Jakob Stoklund Olesen
358de24dc1 Use an IndexedMap for LiveOutRegInfo to hide its dependence on TargetRegisterInfo::FirstVirtualRegister.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123096 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 23:10:50 +00:00
Cameron Zwarich
7c88186309 Fix coding style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123093 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 22:36:53 +00:00
Chris Lattner
8a629577f8 fix a latent bug in memcpyoptimizer that my recent patches exposed: it wasn't
updating memdep when fusing stores together.  This fixes the crash optimizing
the bullet benchmark.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123091 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 22:19:21 +00:00
Chris Lattner
0468e3e265 tryMergingIntoMemset can only handle constant length memsets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123090 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 22:11:56 +00:00
Chris Lattner
d90a192279 Merge memsets followed by neighboring memsets and other stores into
larger memsets.  Among other things, this fixes rdar://8760394 and
allows us to handle "Example 2" from http://blog.regehr.org/archives/320,
compiling it into a single 4096-byte memset:

_mad_synth_mute:                        ## @mad_synth_mute
## BB#0:                                ## %entry
	pushq	%rax
	movl	$4096, %esi             ## imm = 0x1000
	callq	___bzero
	popq	%rax
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123089 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 21:19:19 +00:00
Chris Lattner
9fa11e94b5 fix an issue in IsPointerOffset that prevented us from recognizing that
P and P+1 are relative to the same base pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123087 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 21:07:56 +00:00
Chris Lattner
06511264f8 enhance memcpyopt to merge a store and a subsequent
memset into a single larger memset.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123086 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 20:54:51 +00:00
Chris Lattner
67a716ab81 constify TargetData references.
Split memset formation logic out into its own
"tryMergingIntoMemset" helper function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123081 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 20:24:01 +00:00
Chris Lattner
5d37370a6f When loop rotation happens, it is *very* common for the duplicated condbr
to be foldable into an uncond branch.  When this happens, we can make a
much simpler CFG for the loop, which is important for nested loop cases
where we want the outer loop to be aggressively optimized.

Handle this case more aggressively.  For example, previously on
phi-duplicate.ll we would get this:


define void @test(i32 %N, double* %G) nounwind ssp {
entry:
  %cmp1 = icmp slt i64 1, 1000
  br i1 %cmp1, label %bb.nph, label %for.end

bb.nph:                                           ; preds = %entry
  br label %for.body

for.body:                                         ; preds = %bb.nph, %for.cond
  %j.02 = phi i64 [ 1, %bb.nph ], [ %inc, %for.cond ]
  %arrayidx = getelementptr inbounds double* %G, i64 %j.02
  %tmp3 = load double* %arrayidx
  %sub = sub i64 %j.02, 1
  %arrayidx6 = getelementptr inbounds double* %G, i64 %sub
  %tmp7 = load double* %arrayidx6
  %add = fadd double %tmp3, %tmp7
  %arrayidx10 = getelementptr inbounds double* %G, i64 %j.02
  store double %add, double* %arrayidx10
  %inc = add nsw i64 %j.02, 1
  br label %for.cond

for.cond:                                         ; preds = %for.body
  %cmp = icmp slt i64 %inc, 1000
  br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge

for.cond.for.end_crit_edge:                       ; preds = %for.cond
  br label %for.end

for.end:                                          ; preds = %for.cond.for.end_crit_edge, %entry
  ret void
}

Now we get the much nicer:

define void @test(i32 %N, double* %G) nounwind ssp {
entry:
  br label %for.body

for.body:                                         ; preds = %entry, %for.body
  %j.01 = phi i64 [ 1, %entry ], [ %inc, %for.body ]
  %arrayidx = getelementptr inbounds double* %G, i64 %j.01
  %tmp3 = load double* %arrayidx
  %sub = sub i64 %j.01, 1
  %arrayidx6 = getelementptr inbounds double* %G, i64 %sub
  %tmp7 = load double* %arrayidx6
  %add = fadd double %tmp3, %tmp7
  %arrayidx10 = getelementptr inbounds double* %G, i64 %j.01
  store double %add, double* %arrayidx10
  %inc = add nsw i64 %j.01, 1
  %cmp = icmp slt i64 %inc, 1000
  br i1 %cmp, label %for.body, label %for.end

for.end:                                          ; preds = %for.body
  ret void
}

With all of these recent changes, we are now able to compile:

void foo(char *X) {
 for (int i = 0; i != 100; ++i) 
   for (int j = 0; j != 100; ++j)
     X[j+i*100] = 0;
}

into a single memset of 10000 bytes.  This series of changes
should also be helpful for other nested loop scenarios as well.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123079 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 19:59:06 +00:00
Chris Lattner
57863b8ee0 make domtree verification print something useful on failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123078 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 19:55:55 +00:00
Chris Lattner
64c24db959 split ssa updating code out to its own helper function. Don't bother
moving the OrigHeader block anymore: we just merge it away anyway so
its code layout doesn't matter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123077 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 19:26:33 +00:00
Chris Lattner
883401a72f Implement a TODO: Enhance loopinfo to merge away the unconditional branch
that it was leaving in loops after rotation (between the original latch
block and the original header.

With this change, it is possible for rotated loops to have just a single
basic block, which is useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123075 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 19:10:28 +00:00
Chris Lattner
dc85f8ab80 various code cleanups, enhance MergeBlockIntoPredecessor to preserve
loop info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123074 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 19:08:40 +00:00
Chris Lattner
a1ae0c74af inline preserveCanonicalLoopForm now that it is simple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123073 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 18:55:50 +00:00
Chris Lattner
0e4a1543ab Three major changes:
1. Rip out LoopRotate's domfrontier updating code.  It isn't
   needed now that LICM doesn't use DF and it is super complex
   and gross.
2. Make DomTree updating code a lot simpler and faster.  The 
   old loop over all the blocks was just to find a block??
3. Change the code that inserts the new preheader to just use
   SplitCriticalEdge instead of doing an overcomplex 
   reimplementation of it.

No behavior change, except for the name of the inserted preheader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123072 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 18:52:51 +00:00
Chris Lattner
b0433d4b2f reduce nesting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123071 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 18:47:43 +00:00
Chris Lattner
2aa6908231 LoopRotate requires canonical loop form, so it always has preheaders
and latch blocks.  Reorder entry conditions to make hte pass faster
and more logical.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123069 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 18:06:22 +00:00
Chris Lattner
66fe0ded05 use the LI ivar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 17:49:51 +00:00
Chris Lattner
4aefc9bf1b some cleanups: remove dead arguments and eliminate ivars
that are just passed to one function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123067 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 17:48:33 +00:00
Chris Lattner
012ca949af fix an issue duncan pointed out, which could cause loop rotate
to violate LCSSA form


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123066 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 17:38:45 +00:00
Cameron Zwarich
b434acb7be Fix coding style issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123065 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 17:07:11 +00:00
Cameron Zwarich
80f6a507d4 Make more passes preserve dominators (or state that they preserve dominators if
they all ready do). This removes two dominator recomputations prior to isel,
which is a 1% improvement in total llc time for 403.gcc.

The only potentially suspect thing is making GCStrategy recompute dominators if
it used a custom lowering strategy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123064 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 17:01:52 +00:00
Rafael Espindola
bea4626f93 First step in fixing PR8927:
Add a unnamed_addr bit to global variables and functions. This will be used
to indicate that the address is not significant and therefore the constant
or function can be merged with others.

If an optimization pass can show that an address is not used, it can set this.

Examples of things that can have this set by the FE are globals created to
hold string literals and C++ constructors.

Adding unnamed_addr to a non-const global should have no effect unless
an optimization can transform that global into a constant.

Aliases are not allowed to have unnamed_addr since I couldn't figure
out any use for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123063 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 16:42:36 +00:00
Cameron Zwarich
8368ac3688 Contract subloop bodies. However, it is still important to visit the phis at the
top of subloop headers, as the phi uses logically occur outside of the subloop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123062 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 15:52:22 +00:00
Frits van Bommel
b686eb9186 Fix a bug in r123034 (trying to sext/zext non-integers) and clean up a little.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123061 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 10:51:36 +00:00
Chris Lattner
d9ec3572f3 Have loop-rotate simplify instructions (yay instsimplify!) as it clones
them into the loop preheader, eliminating silly instructions like
"icmp i32 0, 100" in fixed tripcount loops.  This also better exposes the 
bigger problem with loop rotate that I'd like to fix: once this has been
folded, the duplicated conditional branch *often* turns into an uncond branch.

Not aggressively handling this is pessimizing later loop optimizations 
somethin' fierce by making "dominates all exit blocks" checks fail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123060 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 08:24:46 +00:00
Chris Lattner
b5fa5fcecc Revamp the ValueMapper interfaces in a couple ways:
1. Take a flags argument instead of a bool.  This makes
   it more clear to the reader what it is used for.
2. Add a flag that says that "remapping a value not in the
   map is ok".
3. Reimplement MapValue to share a bunch of code and be a lot
   more efficient.  For lookup failures, don't drop null values
   into the map.
4. Using the new flag a bunch of code can vaporize in LinkModules
   and LoopUnswitch, kill it.

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123058 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 08:15:20 +00:00
Chris Lattner
6ccb365293 two minor changes: switch to the standard ValueToValueMapTy
map from ValueMapper.h (giving us access to its utilities)
and add a fastpath in the loop rotation code, avoiding expensive
ssa updator manipulation for values with nothing to update.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123057 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 07:21:31 +00:00
Evan Cheng
55d4200336 Recognize inline asm 'rev /bin/bash, ' as a bswap intrinsic call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123048 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 01:24:27 +00:00
Evan Cheng
c36b7069b4 Do not model all INLINEASM instructions as having unmodelled side effects.
Instead encode llvm IR level property "HasSideEffects" in an operand (shared
with IsAlignStack). Added MachineInstrs::hasUnmodeledSideEffects() to check
the operand when the instruction is an INLINEASM.

This allows memory instructions to be moved around INLINEASM instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123044 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 23:50:32 +00:00
Bob Wilson
70f85730b1 Add an explanatory message for an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123042 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 23:40:46 +00:00
Matt Beaumont-Gay
697970286a Eliminate variable only used in debug builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123040 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 22:34:58 +00:00
Devang Patel
51a666f0e5 Speculatively revert r123032.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123039 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 22:33:41 +00:00
Bob Wilson
11a1dfffc8 Lower some BUILD_VECTORS using VEXT+shuffle.
Patch by Tim Northover.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123035 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 21:37:30 +00:00
Tobias Grosser
46431d7a93 InstCombine: Match min/max hidden by sext/zext
X = sext x; x >s c ? X : C+1 --> X = sext x; X <s C+1 ? C+1 : X
X = sext x; x <s c ? X : C-1 --> X = sext x; X >s C-1 ? C-1 : X
X = zext x; x >u c ? X : C+1 --> X = zext x; X <u C+1 ? C+1 : X
X = zext x; x <u c ? X : C-1 --> X = zext x; X >u C-1 ? C-1 : X
X = sext x; x >u c ? X : C+1 --> X = sext x; X <u C+1 ? C+1 : X
X = sext x; x <u c ? X : C-1 --> X = sext x; X >u C-1 ? C-1 : X

Instead of calculating this with mixed types promote all to the
larger type. This enables scalar evolution to analyze this
expression. PR8866

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123034 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 21:33:14 +00:00
Tobias Grosser
8d088bd1e4 Some whitespace fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123033 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 21:33:13 +00:00
Devang Patel
1dea232624 Appropriately truncate debug info range in dwarf output.
Enable live debug variables pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123032 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 21:30:41 +00:00
Evan Cheng
30a343aeed DBG_VALUE does not have any side effects; it also makes no sense to mark it cheap as a copy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123031 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 21:08:26 +00:00
Benjamin Kramer
eaff66a895 Revert 122959, it needs more thought. Add it back to README.txt with additional notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123030 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 20:42:20 +00:00
Jay Foad
8e3914d12e Simplify the allocation and freeing of Users' operand lists, now that
every BranchInst has a fixed number of operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123027 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 20:29:02 +00:00
Jay Foad
8f9ffbd056 Remove all uses of the "ugly" method BranchInst::setUnconditionalDest().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123025 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 20:25:56 +00:00
Evan Cheng
a5e1362f96 Revert r122955. It seems using movups to lower memcpy can cause massive regression (even on Nehalem) in edge cases. I also didn't see any real performance benefit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123015 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 19:35:30 +00:00
Bob Wilson
5e8b833707 Add ARM patterns to match EXTRACT_SUBVECTOR nodes.
Also fix an off-by-one in SelectionDAGBuilder that was preventing shuffle
vectors from being translated to EXTRACT_SUBVECTOR.
Patch by Tim Northover.

The test changes are needed to keep those spill-q tests from testing aligned
spills and restores.  If the only aligned stack objects are spill slots, we
no longer realign the stack frame.  Prior to this patch, an EXTRACT_SUBVECTOR
was legalized by loading from the stack, which created an aligned frame index.
Now, however, there is nothing except the spill slot in the stack frame, so
I added an aligned alloca.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122995 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 04:59:04 +00:00
Bob Wilson
67b067d2f9 Fix a comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122994 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 04:58:58 +00:00
Bob Wilson
6736e19f4c Change EXTRACT_SUBVECTOR to require a constant index.
We were never generating any of these nodes with variable indices, and there
was one legalizer function asserting on a non-constant index.  If we ever have
a need to support variable indices, we can add this back again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122993 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 04:58:56 +00:00
Bill Wendling
8d90b7190f Early exit if we don't have invokes. The 'Unwinds' vector isn't modified unless
we have invokes, so there is no functionality change here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122990 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 02:54:45 +00:00
Duncan Sands
d9aa80038f Fix the other problem reported in PR8582. Testcase and patch by
Nadav Rotem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122983 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 23:45:22 +00:00
Eric Christopher
8d93d19076 Add some fairly duplicated code to let type legalization split illegal
typed atomics. This will lower exclusively to libcalls at the moment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122979 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 22:28:56 +00:00
Chris Lattner
01cdc2016d With Benjamin's recent amazing patches, we should be able to do even better things :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122978 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 22:25:00 +00:00
Chris Lattner
f1cadf2899 use isNullValue() to simplify code, add an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122977 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 22:24:29 +00:00
Devang Patel
76a788c886 Emit 128 bit constant.
This fixes PR 8913 crash.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122971 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 21:39:25 +00:00
Bob Wilson
6819dbb6f8 PR8921: LDM/POP do not support interworking prior to v5t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122970 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 19:24:41 +00:00
Bob Wilson
28f1015e36 Remove extra whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 19:24:36 +00:00
Bob Wilson
0fef58465c Fix comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122968 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 19:24:32 +00:00
Benjamin Kramer
fa36680076 Add a note from llvmdev, this time with more info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122966 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 17:35:50 +00:00
Abramo Bagnara
4bb46f43eb Fixed parsing of hex floats.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122963 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 16:55:14 +00:00
Rafael Espindola
2f867a63da Correctly disassemble truncated asm.
Patch by Richard Simth.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122962 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 16:48:42 +00:00
Benjamin Kramer
8143a84c46 InstCombine: Turn _chk functions into the "unsafe" variant if length and max langth are equal.
This happens when we take the (non-constant) length from a malloc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122961 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 14:22:52 +00:00
Benjamin Kramer
7d9f51f4b5 EarlyCSE does this now (and GVN always did it).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122960 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 13:19:46 +00:00
Benjamin Kramer
240d42d185 InstCombine: If we call llvm.objectsize on a malloc call we can replace it with the size passed to malloc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122959 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 13:11:05 +00:00
Benjamin Kramer
783a5c2b69 InstCombine: Teach llvm.objectsize folding to look through GEPs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122958 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 13:07:49 +00:00
Benjamin Kramer
5191e7cc26 Remove dead code and silence warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122957 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 13:01:02 +00:00
Evan Cheng
461f1fc359 Use movups to lower memcpy and memset even if it's not fast (like corei7).
The theory is it's still faster than a pair of movq / a quad of movl. This
will probably hurt older chips like P4 but should run faster on current
and future Intel processors. rdar://8817010


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122955 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 07:58:36 +00:00
Chris Lattner
cce240d26b add a note about object size from drystone, add a poorly optimized loop from 179.art.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122954 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 07:41:22 +00:00
Chris Lattner
c1853e4a03 add a trivial instcombine missed in Dhrystone
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122953 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 07:09:23 +00:00
Evan Cheng
0521928ae7 Re-implement r122936 with proper target hooks. Now getMaxStoresPerMemcpy
etc. takes an option OptSize. If OptSize is true, it would return
the inline limit for functions with attribute OptSize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122952 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 06:52:41 +00:00
Chris Lattner
8cd4efb6a5 implement constant folding support for an exotic constant expr:
ret i64 ptrtoint (i8* getelementptr ([1000 x i8]* @X, i64 1, i64 sub (i64 0, i64 ptrtoint ([1000 x i8]* @X to i64))) to i64)

to "ret i64 1000".  This allows us to correctly compute the trip count
on a loop in PR8883, which occurs with std::fill on a char array.  This
allows us to transform it into a memset with a constant size.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122950 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 06:19:46 +00:00
Evan Cheng
255874ff52 Revert r122936. I'll re-implement the change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122949 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 06:17:53 +00:00
Cameron Zwarich
6cf34abe1c Add the CallInst optimizations that don't involve expanding inline assembly to
OptimizeInst() so that they can be used on a worklist instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122945 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 02:56:42 +00:00
Cameron Zwarich
865ae1a9e7 Move the GEP handling in CodeGenPrepare to OptimizeInst().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122944 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 02:44:52 +00:00
Cameron Zwarich
c061101e03 Split the optimizations in CodeGenPrepare that don't manipulate the iterators
into a separate function, so that it can be called from a loop using a worklist
rather than a loop traversing a whole basic block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122943 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 02:37:26 +00:00