OSDN Git Service
Eric Christopher [Sat, 15 Jan 2011 00:25:09 +0000 (00:25 +0000)]
80-col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123505
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 15 Jan 2011 00:12:35 +0000 (00:12 +0000)]
Generalize LoadAndStorePromoter a bit and switch LICM
to use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123501
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Sat, 15 Jan 2011 00:09:18 +0000 (00:09 +0000)]
Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123497
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 14 Jan 2011 23:50:53 +0000 (23:50 +0000)]
Fix 80-cols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123494
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 14 Jan 2011 22:58:11 +0000 (22:58 +0000)]
Update CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123491
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Fri, 14 Jan 2011 22:58:09 +0000 (22:58 +0000)]
Fix some tablegen issues to allow using zero_reg for InstAlias definitions.
This is needed to allow an InstAlias for an instruction with an "OptionalDef"
result register (like ARM's cc_out) where you want to set the optional register
to reg0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123490
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 14 Jan 2011 22:34:17 +0000 (22:34 +0000)]
Fix memory leak found by clang static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123487
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 14 Jan 2011 22:34:13 +0000 (22:34 +0000)]
'HiReg' is written but never read. Nuke its
declaration and its assignments.
Found by clang static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123486
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 14 Jan 2011 22:31:13 +0000 (22:31 +0000)]
Fix a false-positive warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123480
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Fri, 14 Jan 2011 22:26:16 +0000 (22:26 +0000)]
Delete an assignment to ThisBB which isn't needed, and tidy up some
comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123479
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 14 Jan 2011 22:19:20 +0000 (22:19 +0000)]
Enhance GlobalOpt to be able evaluate initializers that involve stores through
bitcasts, at least in simple cases. This fixes clang's CodeGenCXX/virtual-base-dtor.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123477
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Fri, 14 Jan 2011 21:58:08 +0000 (21:58 +0000)]
Add a possibility to switch between CFI directives- and table-based frame description emission. Currently all the backends use table-based stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123476
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Fri, 14 Jan 2011 21:57:58 +0000 (21:57 +0000)]
Cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123475
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Fri, 14 Jan 2011 21:57:53 +0000 (21:57 +0000)]
Add CFI directives-based frame information emission. Not hooked yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123474
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Fri, 14 Jan 2011 21:57:45 +0000 (21:57 +0000)]
Split stuff as a preparation for CFI directives-based frame information emission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123473
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Fri, 14 Jan 2011 21:57:39 +0000 (21:57 +0000)]
Use common style for .cfi directives
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123472
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Fri, 14 Jan 2011 21:11:41 +0000 (21:11 +0000)]
Support for precise scheduling of the instruction selection DAG,
disabled in this checkin. Sorry for the large diffs due to
refactoring. New functionality is all guarded by EnableSchedCycles.
Scheduling the isel DAG is inherently imprecise, but we give it a best
effort:
- Added MayReduceRegPressure to allow stalled nodes in the queue only
if there is a regpressure need.
- Added BUHasStall to allow checking for either dependence stalls due to
latency or resource stalls due to pipeline hazards.
- Added BUCompareLatency to encapsulate and standardize the heuristics
for minimizing stall cycles (vs. reducing register pressure).
- Modified the bottom-up heuristic (now in BUCompareLatency) to
prioritize nodes by their depth rather than height. As long as it
doesn't stall, height is irrelevant. Depth represents the critical
path to the DAG root.
- Added hybrid_ls_rr_sort::isReady to filter stalled nodes before
adding them to the available queue.
Related Cleanup: most of the register reduction routines do not need
to be templates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123468
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 14 Jan 2011 19:50:47 +0000 (19:50 +0000)]
switch SRoA to use LoadAndStorePromoter instead of its own copy of the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123457
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 14 Jan 2011 19:36:13 +0000 (19:36 +0000)]
Add a new LoadAndStorePromoter class, which implements the general
"promote a bunch of load and stores" logic, allowing the code to
be shared and reused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123456
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Fri, 14 Jan 2011 18:41:56 +0000 (18:41 +0000)]
OperandTraits<>::Layout isn't used for anything. Remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123452
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 14 Jan 2011 17:01:20 +0000 (17:01 +0000)]
Update llvm-gcc's tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123447
91177308-0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Fri, 14 Jan 2011 16:41:03 +0000 (16:41 +0000)]
Reorder macros on config.h.cmake to easily compare it against
config.h.in.
Patch by arrowdodger!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123445
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Fri, 14 Jan 2011 15:55:50 +0000 (15:55 +0000)]
Disable debug mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123443
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 14 Jan 2011 15:26:10 +0000 (15:26 +0000)]
Turn X-(X-Y) into Y. According to my auto-simplifier this is the most common
simplification present in fully optimized code (I think instcombine fails to
transform some of these when "X-Y" has more than one use). Fires here and
there all over the test-suite, for example it eliminates 8 subtractions in
the final IR for 445.gobmk, 2 subs in 447.dealII, 2 in paq8p etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123442
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 14 Jan 2011 14:44:12 +0000 (14:44 +0000)]
Factorize common code out of the InstructionSimplify shift logic. Add in
threading of shifts over selects and phis while there. This fires here and
there in the testsuite, to not much effect. For example when compiling spirit
it fires 5 times, during early-cse, resulting in 6 more cse simplifications,
and 3 more terminators being folded by jump threading, but the final bitcode
doesn't change in any interesting way: other optimizations would have caught
the opportunity anyway, only later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123441
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 14 Jan 2011 14:16:33 +0000 (14:16 +0000)]
Rename this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123440
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 14 Jan 2011 08:21:08 +0000 (08:21 +0000)]
switch the second scalarrepl pass to use SSAUpdater. We run two scalarrepl passes: one
early in the cleanup code and one late interlaced with the inliner. The second one is
important because inlining and other scalar optzns can unpin allocas, allowing them to
be split up and promoted. While important for performance, this is also relatively
rare, and we would previously force a (non-lazy) computation of DomFrontiers, which
happened even if nothing became unpinned.
With this patch, the first pass of scalarrepl still promotes the vast bulk of allocas
in programs, but hte second pass has changed to use SSAUpdater, which is more "sparse"
and lazy. This speeds up opt -O3 time on kimwitu++ (a c++ app) by about 1%. The
numbers are interesting: the first pass promotes ~17500 allocas. The second pass
promotes about 1600. For non-C++ codes, the compile time win should be greater,
because the second pass of scalarrepl does less.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123437
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 14 Jan 2011 08:13:00 +0000 (08:13 +0000)]
split SROA into two passes: one that uses DomFrontiers (-scalarrepl)
and one that uses SSAUpdater (-scalarrepl-ssa)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123436
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Fri, 14 Jan 2011 08:07:43 +0000 (08:07 +0000)]
Remove casts between Value** and Constant**, which won't work if a
static_cast from Constant* to Value* has to adjust the "this" pointer.
This is groundwork for PR889.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123435
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 14 Jan 2011 07:50:47 +0000 (07:50 +0000)]
Implement full support for promoting allocas to registers using SSAUpdater
instead of DomTree/DomFrontier. This may be interesting for reducing compile
time. This is currently disabled, but seems to work just fine.
When this is enabled, we eliminate two runs of dominator frontier, one in the
"early per-function" optimizations and one in the "interlaced with inliner"
function passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123434
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 14 Jan 2011 07:46:33 +0000 (07:46 +0000)]
relax testcase a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123433
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 14 Jan 2011 06:33:45 +0000 (06:33 +0000)]
Try for the third time to teach getFirstTerminator() about debug values.
This time let's rephrase to trick gcc-4.3 into not miscompiling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123432
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 14 Jan 2011 06:14:33 +0000 (06:14 +0000)]
revert my fastisel patch again which apparently still gives the
llvm-gcc-i386-linux-selfhost buildbot heartburn...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123431
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 14 Jan 2011 04:24:28 +0000 (04:24 +0000)]
reapply r123414 now that the botz are calmed down and the fix is already in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123427
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 14 Jan 2011 04:23:53 +0000 (04:23 +0000)]
indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123426
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 14 Jan 2011 02:38:49 +0000 (02:38 +0000)]
Completed :lower16: / :upper16: support for movw / movt pairs on Darwin.
- Fixed :upper16: fix up routine. It should be shifting down the top 16 bits first.
- Added support for Thumb2 :lower16: and :upper16: fix up.
- Added :upper16: and :lower16: relocation support to mach-o object writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123424
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 14 Jan 2011 02:12:54 +0000 (02:12 +0000)]
Revert r123419. It still breaks llvm-gcc-i386-linux-selfhost.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123423
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 14 Jan 2011 02:07:32 +0000 (02:07 +0000)]
r123414 broke llvm-gcc bootstrap apparently, revert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123422
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 14 Jan 2011 01:33:40 +0000 (01:33 +0000)]
Set the insertion point correctly for instructions generated by load folding:
they should go *before* the new instruction not after it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123420
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 14 Jan 2011 01:17:53 +0000 (01:17 +0000)]
Try again to teach getFirstTerminator() about debug values.
Fix some callers to better deal with debug values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123419
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 14 Jan 2011 00:41:11 +0000 (00:41 +0000)]
Rather than doing early instcombine, try doing early CSE instead. This should still handle
most important simplifications, as well as resolving phase ordering issues where instcombine
would inhibit important CSE'ing opportunities, for instance on BitBench/drop3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123418
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 14 Jan 2011 00:37:45 +0000 (00:37 +0000)]
Move some shift transforms out of instcombine and into InstructionSimplify.
While there, I noticed that the transform "undef >>a X -> undef" was wrong.
For example if X is 2 then the top two bits must be equal, so the result can
not be anything. I fixed this in the constant folder as well. Also, I made
the transform for "X << undef" stronger: it now folds to undef always, even
though X might be zero. This is in accordance with the LangRef, but I must
admit that it is fairly aggressive. Also, I added "i32 X << 32 -> undef"
following the LangRef and the constant folder, likewise fairly aggressive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123417
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 14 Jan 2011 00:36:40 +0000 (00:36 +0000)]
Don't bother conditionalizing the use of SROA in -O1 mode. We're already running it unconditionally
later in the pipeline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123416
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 14 Jan 2011 00:01:01 +0000 (00:01 +0000)]
fix PR8961 - a fast isel miscompilation where we'd insert a new instruction
after sext's generated for addressing that got folded. Previously we compiled
test5 into:
_test5: ## @test5
## BB#0:
movq -8(%rsp), %rax ## 8-byte Reload
movq (%rdi,%rax), %rdi
addq %rdx, %rdi
movslq %esi, %rax
movq %rax, -8(%rsp) ## 8-byte Spill
movq %rdi, %rax
ret
which is insane and wrong. Now we produce:
_test5: ## @test5
## BB#0:
movslq %esi, %rax
movq (%rdi,%rax), %rax
addq %rdx, %rax
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123414
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 13 Jan 2011 23:35:53 +0000 (23:35 +0000)]
Better terminator avoidance.
This approach also works when the terminator doesn't have a slot index. (Which
can happen??)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123413
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 13 Jan 2011 23:27:39 +0000 (23:27 +0000)]
Add comment about Thumb2 fixup comments being completely bogus.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123411
91177308-0d34-0410-b5e6-
96231b3b80d8
Tobias Grosser [Thu, 13 Jan 2011 23:18:04 +0000 (23:18 +0000)]
Add single entry / single exit accessors.
Add methods for accessing the (single) entry / exit edge of a region. If no such
edge exists, null is returned. Both accessors return the start block of the
corresponding edge. The edge can finally be formed by utilizing
Region::getEntry() or Region::getExit();
Contributed by: Andreas Simbuerger <simbuerg@fim.uni-passau.de>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123410
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 13 Jan 2011 22:50:36 +0000 (22:50 +0000)]
Recognize alternative register names like ip -> r12.
Fixes <rdar://problem/
8857982>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123409
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 13 Jan 2011 22:47:43 +0000 (22:47 +0000)]
Fix a few more places that should use MBB::getLastNonDebugInstr().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123408
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 13 Jan 2011 22:38:16 +0000 (22:38 +0000)]
As far as I can tell, unified syntax uses c0-c15 instead of cr0-cr15 for mcr and friends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123407
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 13 Jan 2011 22:11:56 +0000 (22:11 +0000)]
typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123406
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 13 Jan 2011 22:08:15 +0000 (22:08 +0000)]
memcpy + metadata = bliss :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123405
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 13 Jan 2011 21:46:02 +0000 (21:46 +0000)]
Add support to the ARM MC infrastructure to support mcr and friends. This requires supporting
the symbolic immediate names used for these instructions, fixing their pretty-printers, and
adding proper encoding information for them.
With this, we can properly pretty-print and encode assembly like:
mrc p15, #0, r3, c13, c0, #3
Fixes <rdar://problem/
8857858>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123404
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 13 Jan 2011 21:45:26 +0000 (21:45 +0000)]
Relax an assertion. On archs like ARM, an immediate field may be scattered. So it's possible for some bits of every 8 bits to be encoded already, and the rest still needs to be fixed up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123403
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 13 Jan 2011 21:28:55 +0000 (21:28 +0000)]
Temporary workaround for an i386 crash in LiveDebugVariables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123400
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 13 Jan 2011 21:28:52 +0000 (21:28 +0000)]
Teach frame lowering to ignore debug values after the terminators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123399
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Thu, 13 Jan 2011 21:10:12 +0000 (21:10 +0000)]
Tidy comments, indentation, and 80-column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123397
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Thu, 13 Jan 2011 20:59:44 +0000 (20:59 +0000)]
Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123396
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 13 Jan 2011 20:32:36 +0000 (20:32 +0000)]
Fix ARMAsmParser::ParseOperand() to allow it to parse . as a branch target and
directional local labels like 1f and 2b.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123393
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Thu, 13 Jan 2011 19:48:54 +0000 (19:48 +0000)]
Little help to debug the bugpoint itself.
Patch by Bob Wilson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123390
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Thu, 13 Jan 2011 19:27:50 +0000 (19:27 +0000)]
Speculatively revert r123384 to make llvm-gcc-i386-linux-selfhost buildbot happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123389
91177308-0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Thu, 13 Jan 2011 19:17:28 +0000 (19:17 +0000)]
Add some platform tests.
Patch by arrowdodger!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123388
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Thu, 13 Jan 2011 19:16:48 +0000 (19:16 +0000)]
When updating a tSpill/tRestore instruction to be a tSTRr/tLDRr, correctly
set up the source operands. The original instr has an immediate operand that
should be replaced with the frame reg operand rather than just adding the
reg operand. Previously, the instruction ended up with too many operands
causing an assert() when adding the default predicate. rdar://
8825456
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123387
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 13 Jan 2011 18:41:05 +0000 (18:41 +0000)]
Teach MachineBasicBlock::getFirstTerminator to ignore debug values.
It will still return an iterator that points to the first terminator or end(),
but there may be DBG_VALUE instructions following the first terminator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123384
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Thu, 13 Jan 2011 18:26:59 +0000 (18:26 +0000)]
Check for empty structs, and for consistency, zero-element arrays.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123383
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Thu, 13 Jan 2011 17:45:11 +0000 (17:45 +0000)]
Extend SROA to handle arrays accessed as homogeneous structs and vice versa.
This is a minor extension of SROA to handle a special case that is
important for some ARM NEON operations. Some of the NEON intrinsics
return multiple values, which are handled as struct types containing
multiple elements of the same vector type. The corresponding return
types declared in the arm_neon.h header have equivalent arrays. We
need SROA to recognize that it can split up those arrays and structs
into separate vectors, even though they are not always accessed with
the same type. SROA already handles loads and stores of an entire
alloca by using insertvalue/extractvalue to access the individual
pieces, and that code works the same regardless of whether the type
is a struct or an array. So, all that needs to be done is to check
for compatible arrays and homogeneous structs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123381
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Thu, 13 Jan 2011 17:45:08 +0000 (17:45 +0000)]
Make SROA more aggressive with allocas containing padding.
SROA only split up structs and arrays one level at a time, so padding can
only cause trouble if it is located in between the struct or array elements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123380
91177308-0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Thu, 13 Jan 2011 15:31:45 +0000 (15:31 +0000)]
Disable RTTI when building unit tests. This avoids errors at link time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123377
91177308-0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Thu, 13 Jan 2011 15:06:32 +0000 (15:06 +0000)]
Platform tests for argz_* functions.
Patch by arrowdodger!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123376
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Thu, 13 Jan 2011 10:43:08 +0000 (10:43 +0000)]
Remove some wrong code which fortunately was never executed (as explained in
the comment I added): an extern weak global may have a null address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123373
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Thu, 13 Jan 2011 08:56:29 +0000 (08:56 +0000)]
The most common simplification missed by instsimplify in unoptimized bitcode
is "X != 0 -> X" when X is a boolean. This occurs a lot because of the way
llvm-gcc converts gcc's conditional expressions. Add this, and a few other
similar transforms for completeness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123372
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 13 Jan 2011 07:58:56 +0000 (07:58 +0000)]
Model :upper16: and :lower16: as ARM specific MCTargetExpr. This is a step
in the right direction. It eliminated some hacks and will unblock codegen
work. But it's far from being done. It doesn't reject illegal expressions,
e.g. (FOO - :lower16:BAR). It also doesn't work in Thumb2 mode at all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123369
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 13 Jan 2011 06:47:10 +0000 (06:47 +0000)]
Experiment with changing the default 32-bit linux stack alignment to
16 bytes for PR8969. Update all testcases accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123367
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 13 Jan 2011 05:12:34 +0000 (05:12 +0000)]
Keep unnamed_addr when linking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123364
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 13 Jan 2011 01:30:30 +0000 (01:30 +0000)]
Reject uses of unnamed_addr in declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123358
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 13 Jan 2011 01:07:01 +0000 (01:07 +0000)]
Add a FIXME and two asserts for now in the ARMAsmParser when it sees .code 16 or
.code 32 if the TargetMachine's isThumb() boolean does not match. The correct
fix is to switch ARM subtargets at that point and is tracked by rdar://
8856789
which is bigger task.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123353
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 13 Jan 2011 01:06:51 +0000 (01:06 +0000)]
Fix r123346 to handle scalar types too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123352
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 13 Jan 2011 00:57:35 +0000 (00:57 +0000)]
Add missing space in debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123351
91177308-0d34-0410-b5e6-
96231b3b80d8
Jason W Kim [Thu, 13 Jan 2011 00:27:00 +0000 (00:27 +0000)]
Change call to Error() to assert()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123350
91177308-0d34-0410-b5e6-
96231b3b80d8
Jason W Kim [Thu, 13 Jan 2011 00:07:51 +0000 (00:07 +0000)]
Style clean up - break up the breaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123347
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 12 Jan 2011 23:56:26 +0000 (23:56 +0000)]
Apply the patch from PR8958, which allows llc to get slightly
further on the associated testcase before aborting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123346
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Wed, 12 Jan 2011 23:55:06 +0000 (23:55 +0000)]
Support/Path: Deprecate PathV1::IsSymlink and replace all uses with PathV2::is_symlink.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123345
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 12 Jan 2011 23:36:21 +0000 (23:36 +0000)]
Try again enabling LiveDebugVariables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123342
91177308-0d34-0410-b5e6-
96231b3b80d8
Jason W Kim [Wed, 12 Jan 2011 23:25:02 +0000 (23:25 +0000)]
Added clarifying comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123341
91177308-0d34-0410-b5e6-
96231b3b80d8
Jason W Kim [Wed, 12 Jan 2011 23:21:49 +0000 (23:21 +0000)]
JimG sez: "The value-kinds look like masks, but they're not consistently used
that way, unfortunately. If you want to change them to work additively instead
of a one-variant-kind-per-symbolref, that's great and I completely agree it's
worth doing, but it really should be a separate patch. Until then, this isn't
correct."
So I am reverting this bit until a more opportune time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123340
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 12 Jan 2011 23:14:07 +0000 (23:14 +0000)]
Don't emit a DBG_VALUE for a spill slot that the rewriter decided not to use after all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123339
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 12 Jan 2011 23:14:04 +0000 (23:14 +0000)]
Fix braino in dominator tree walk.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123338
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 12 Jan 2011 22:37:49 +0000 (22:37 +0000)]
Sometimes, old virtual registers can linger on DBG_VALUE instructions.
Make sure we don't crash in that case, but simply turn them into %noreg instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123335
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 12 Jan 2011 22:28:51 +0000 (22:28 +0000)]
Teach VirtRegRewriter to update slot indexes when erasing instructions.
It was leaving dangling pointers in the slot index maps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123334
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 12 Jan 2011 22:28:48 +0000 (22:28 +0000)]
Annotate VirtRegRewriter debug output with slot indexes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123333
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 12 Jan 2011 21:27:48 +0000 (21:27 +0000)]
Verify slot index ordering.
The slot indexes must be monotonically increasing through the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123324
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 12 Jan 2011 21:27:45 +0000 (21:27 +0000)]
Assert if anybody tries to put a slot index on a DBG_VALUE instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123323
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 12 Jan 2011 21:27:41 +0000 (21:27 +0000)]
Verify that machine instruction parent pointers are consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123322
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 12 Jan 2011 21:20:59 +0000 (21:20 +0000)]
Sort the register list based on the *actual* register numbers rather than the
enum values we give to them. <rdar://problem/
8823730>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123321
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 12 Jan 2011 19:12:45 +0000 (19:12 +0000)]
Use SmallVector instead of SmallPtrSet and avoid non-deterministic behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123318
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Beaumont-Gay [Wed, 12 Jan 2011 18:02:55 +0000 (18:02 +0000)]
Mostly undo r123297, but move the default case in EvaluateAsPCRel to the top
of the switch block to appease GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123317
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Wed, 12 Jan 2011 09:06:19 +0000 (09:06 +0000)]
Add another note taken from the gcc bugzilla.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123315
91177308-0d34-0410-b5e6-
96231b3b80d8
Venkatraman Govindaraju [Wed, 12 Jan 2011 05:08:36 +0000 (05:08 +0000)]
Implement RETURNADDR and FRAMEADDR lowering in SPARC backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123310
91177308-0d34-0410-b5e6-
96231b3b80d8
Venkatraman Govindaraju [Wed, 12 Jan 2011 03:52:59 +0000 (03:52 +0000)]
Remove SPARC backend getpcx instruction's Uses. Also, insert an assert to
ensure %o7 is not assigned as the destination of getpcx instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123304
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 12 Jan 2011 03:25:15 +0000 (03:25 +0000)]
revert 123144, reenabling the rest of memset formation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123302
91177308-0d34-0410-b5e6-
96231b3b80d8