Commit Graph

27227 Commits

Author SHA1 Message Date
Evan Cheng
f2b14715d1 Oops. Last second clean up messed things up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64373 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 09:52:13 +00:00
Evan Cheng
6d209c413e If availability info is kept when fallthrough into a bb, add the available registers to live-in set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64372 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 09:43:23 +00:00
Evan Cheng
8182347d70 Replace one of burr scheduling heuristic with something more sensible. Now calcMaxScratches simply compute the number of true data dependencies. This actually improve a couple of tests in dejagnu suite as many tests in llvm nightly test suite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64369 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 08:59:45 +00:00
Julien Lerouge
9430fe7092 Fix MingW build, patch by Kenneth Boyd!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64366 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 07:39:10 +00:00
Chris Lattner
af9985c6b9 Fix a nasty bug (PR3550) where the inline pass could incorrectly mark
calls with the tail marker when inlining them through an invoke.  Patch,
testcase, and perfect analysis by Jay Foad!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 07:06:42 +00:00
Chris Lattner
0aefc0eb2c improve naming of values in GVN, patch by Jay Foad!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 07:00:35 +00:00
Chris Lattner
65c02fbf9b fix PR3537: if resetting bbi back to the start of a block, we need to
forget about already inserted expressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 06:56:08 +00:00
Nick Lewycky
b7c9eeeede Don't mark all args to strtod and friends as nocapture.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64352 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 03:18:34 +00:00
Bill Wendling
d1c321a89a Move debug loc info along when the spiller creates new instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64342 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 00:02:55 +00:00
Evan Cheng
f412f7c417 Apparently some MachineBasicBlock's don't have corresponding llvm basic blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64340 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 23:42:39 +00:00
Evan Cheng
ce7f5a1e50 Remove a bogus assertion. It's possible a live-in available value is used by a previous instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64339 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 23:41:57 +00:00
Nate Begeman
7b25467d06 the two non-mask arguments to a shufflevector must be the same width, but they do not have to be the same
width as the result value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64335 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 22:36:25 +00:00
Bill Wendling
fbef3101a5 Propagate DebugLoc info for spiller call-backs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64329 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 21:51:19 +00:00
Dan Gohman
c7fa16f782 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64328 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 21:32:08 +00:00
Dan Gohman
c8db34cb07 Don't use special heuristics for nodes with no data predecessors
unless they actually have data successors, and likewise for nodes
with no data successors unless they actually have data precessors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64327 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 21:29:39 +00:00
Dan Gohman
cc994ea36b Delete the heuristic for non-livein CopyFromReg nodes. Non-liveinness
is determined by whether the node has a Flag operand. However, if the
node does have a Flag operand, it will be glued to its register's
def, so the heuristic would end up spuriously applying to whatever
node is the def.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 20:25:59 +00:00
Dan Gohman
d293e0d2dc Don't try to set an EFLAGS operand to dead if no instruction was created.
This fixes a bug introduced by r61215.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64316 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 19:50:24 +00:00
Dale Johannesen
85b0edec46 Make a transformation added in 63266 a bit less aggressive.
It was transforming (x&y)==y to (x&y)!=0 in the case where
y is variable and known to have at most one bit set (e.g. z&1).
This is not correct; the expressions are not equivalent when y==0.
I believe this patch salvages what can be salvaged, including
all the cases in bt.ll.  Dan, please review.
Fixes gcc.c-torture/execute/20040709-[12].c



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64314 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 19:19:41 +00:00
Bill Wendling
905c7e9a04 Revert r64300 and r64301. These were causing the following errors respectively:
During llvm-gcc bootstrap:

Undefined symbols:
  "llvm::FPPassManager::doFinalization(llvm::Module&)", referenced from:
      (anonymous namespace)::CGPassManager::doFinalization(llvm::CallGraph&, llvm::Module&)
        in libLLVMipa.a(CallGraphSCCPass.o)
  "llvm::FPPassManager::doInitialization(llvm::Module&)", referenced from:
      (anonymous namespace)::CGPassManager::doInitialization(llvm::CallGraph&, llvm::Module&)
        in libLLVMipa.a(CallGraphSCCPass.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/obj-llvm/Release/bin/opt] Error 1

During an LLVM release build:

/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-register-desc -o  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenRegisterInfo.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td
llvm[3]: Building X86.td instruction names with tblgen
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-instr-enums -o  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenInstrNames.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td
llvm[3]: Building X86.td instruction information with tblgen
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-instr-desc -o  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenInstrInfo.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td
llvm[3]: Building X86.td assembly writer with tblgen
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-asm-writer -o  /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenAsmWriter.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td
llvm[3]: Compiling InstructionCombining.cpp for Release build 
if /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~dst/Developer/usr/bin/llvm-g++-4.2 -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Transforms/Scalar  -D_DEBUG  -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3  -fno-exceptions  -Woverloaded-virtual -pedantic -Wall -W -Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter  -fstrict-aliasing -Wstrict-aliasing -c -MMD -MP -MF "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d.tmp" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.lo" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.o" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d" /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Transforms/Scalar/InstructionCombining.cpp -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.o ; \
           then /bin/mv -f "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d.tmp" "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Trans



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64311 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 18:19:24 +00:00
Duncan Sands
b91a2a17d3 These uses of "inline" can cause strange link-time
failures when building with optimization.  Just get
rid of them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64301 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 12:25:15 +00:00
Duncan Sands
af068750a7 Make sure the SCC pass manager initializes any contained
function pass managers.  Without this, simplify-libcalls
would add nocapture attributes when run on its own, but
not when run as part of -std-compile-opts or similar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64300 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 09:58:43 +00:00
Evan Cheng
752272a5e5 Implement PR3495: local spiller optimization. The local spiller can now keep availability information over BB boundaries. It visits BB's in depth first order. After visiting a BB if it find a successor which has a single predecessor it visits the successor next without clearing the availability information. This allows the successor to omit reloads or change them into copies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64298 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 08:24:21 +00:00
Dan Gohman
47ac0f0c7c When scheduling a block in parts, keep track of the overall
instruction index across each part. Instruction indices are used
to make live range queries, and live ranges can extend beyond
scheduling region boundaries.

Refactor the ScheduleDAGSDNodes class some more so that it
doesn't have to worry about this additional information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64288 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 04:27:20 +00:00
Devang Patel
bd75b8345f If llvm.dbg.region.end is disappearing then remove corresponding llvm.dbg.func.start also.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64278 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 01:29:06 +00:00
Dan Gohman
7dfa07f794 Don't print extra spaces in vector and array constants. This makes
them visually more consistent with vector and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64267 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 00:25:25 +00:00
Dan Gohman
5cffa6fe27 Use iterators to iterate through the Preds array instead of
an index. This code is on the hot-path because the current
way SDep edges are uniqued has quadratic complexity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 00:12:28 +00:00
Dan Gohman
bed353d016 Consider any instruction that modifies the stack pointer to be
a scheduling region boundary.  This isn't necessary for
correctness; it helps with compile time, as it avoids the need
for data- and anti-dependencies from all spills and reloads on
the stack-pointer modification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64255 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 23:29:38 +00:00
Dan Gohman
9e64bbb322 Factor out more code for computing register live-range informationfor
scheduling, and generalize is so that preserves state across
scheduling regions. This fixes incorrect live-range information around
terminators and labels, which are effective region boundaries.

In place of looking for terminators to anchor inter-block dependencies,
introduce special entry and exit scheduling units for this purpose.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 23:27:53 +00:00
Devang Patel
0464a1431b Ignore dbg intrinsic while folding unconditional branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64242 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 22:14:17 +00:00
Evan Cheng
1d76864df3 Handle llvm.x86.sse2.maskmov.dqu in 64-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 22:06:28 +00:00
Evan Cheng
7403eeaa88 80 col violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64237 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 21:39:44 +00:00
Devang Patel
7afe8fa066 Use early exits. Reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 19:28:07 +00:00
Dan Gohman
d4e1845849 Use const, to support platforms where strrchr returns a const char *.
This fixes PR3535.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64224 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 17:56:28 +00:00
Duncan Sands
35b5107951 Pacify gcc-4.3 (thinks IsConstant may be used
uninitialized).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64220 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 16:24:55 +00:00
Evan Cheng
f0e366a929 Fix PR3457: Ignore control successors when looking for closest scheduled successor. A control successor doesn't read result(s) produced by the scheduling unit being evaluated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 08:30:11 +00:00
Devang Patel
f66d7b5a51 Do not clone llvm.dbg.func.start and corresponding llvm.dbg.region.end during inlining.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 07:48:18 +00:00
Devang Patel
4afc90dacf Enable scalar replacement of AllocaInst whose one of the user is dbg info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64207 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 07:00:59 +00:00
Devang Patel
2303df96b0 Validate file id.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64204 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 06:04:08 +00:00
Sanjiv Gupta
2cc753170b Function temporaries can not overlap with retval or args.See the comment in source code to know the reason. Anything having .auto. in its name is local to a function in nature irrespective of the linkage specified. print static local variables in module level IDATA section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 04:20:26 +00:00
Evan Cheng
a0eedac226 Implement FpSET_ST1_*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64186 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 23:32:07 +00:00
Evan Cheng
4ded02f8bd If the target cannot issue a copy for the given source and dest registers, abort instead of silently continue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 22:47:36 +00:00
Dale Johannesen
1de17d574c Fix PR 3471, and some cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64177 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 22:14:15 +00:00
Evan Cheng
65b52dffe0 Simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 21:01:06 +00:00
Evan Cheng
b1032a8a2f Make sure constant subscript is truncated to ptr size if it may not fit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 20:54:38 +00:00
Dan Gohman
333014e256 Use doxygen comment syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64150 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 18:12:09 +00:00
Dan Gohman
b9070d3f63 Use slightly more correct grammar in error messages.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64148 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 17:41:21 +00:00
Gabor Greif
ccd27fb84b make sure that BranchInst::getSuccessor() does not assert in cast<>
even if the underlying operand is NULL. This may happen in debugging context
within opt with partial loop unrolling (see test/Transforms/LoopUnroll/partial.ll).
After this fix I can resubmit the (backed out) r63459:
* lib/VMCore/AsmWriter.cpp: use precise accessors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 15:45:06 +00:00
Evan Cheng
8f0d99e463 Re-enable machine sinking pass now that the coalescer bugs and the AnalyzeBrnach bug are fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 08:45:39 +00:00
Evan Cheng
190424edcd Fix another case ShortenDeadCopySrcLiveRange is shortening too much. No test case possible since I don't know what to grep for. :-(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64125 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 08:37:45 +00:00
Evan Cheng
dc54d317e7 Turns out AnalyzeBranch can modify the mbb being analyzed. This is a nasty
suprise to some callers, e.g. register coalescer. For now, add an parameter
that tells AnalyzeBranch whether it's safe to modify the mbb. A better
solution is out there, but I don't have time to deal with it right now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64124 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 07:14:22 +00:00