Commit Graph

10457 Commits

Author SHA1 Message Date
Benjamin Kramer 56ffa48473 Make NORETURN working with MSVC. MSVC only accepts NORETURN in front of the
decl so move it there. GCC accepts it both in front and after decls.

llvm-svn: 88791
2009-11-14 14:14:58 +00:00
Daniel Dunbar 241d01b590 Add llvm::sys::getHostCPUName, for detecting the LLVM name for the host CPU.
- This is an initial step towards -march=native support in Clang, and towards
   eliminating host dependencies in the targets. See PR5389.

 - Patch by Roman Divacky!

llvm-svn: 88768
2009-11-14 10:09:12 +00:00
Evan Cheng 16797a1f55 Added getSubRegIndex(A,B) that returns subreg index of A to B. Use it to replace broken code in VirtRegRewriter.
llvm-svn: 88753
2009-11-14 03:42:17 +00:00
Evan Cheng 6ad7da96fe - Change TargetInstrInfo::reMaterialize to pass in TargetRegisterInfo.
- If destination is a physical register and it has a subreg index, use the
  sub-register instead.
This fixes PR5423.

llvm-svn: 88745
2009-11-14 02:55:43 +00:00
Dan Gohman 81132465d3 Add an option for running GVN with redundant load processing disabled.
llvm-svn: 88742
2009-11-14 02:27:51 +00:00
Lang Hames 6b7233afc6 Added an API to the SlotIndexes pass to allow new instructions to be inserted into the numbering.
PreAllocSplitting is now using this API to insert code.

llvm-svn: 88725
2009-11-14 00:02:51 +00:00
Dan Gohman 6e99014947 Move the FixedStackPseudoSourceValueVal enum value before InstructionVal
so that isa<Instructon> doesn't return true for FixedStackPseudoSourceValue
values. This fixes a variety of problems, including crashes with -debug
and -print-machineinstrs. Also, add a comment to warn about this.

llvm-svn: 88711
2009-11-13 22:24:13 +00:00
Jakob Stoklund Olesen 27440e71fc Add MachineFunction::verify() to call the machine code verifier directly.
llvm-svn: 88706
2009-11-13 21:56:09 +00:00
Dan Gohman 7474546e4d Use .data() instead of .c_str() when nul-termination is not needed.
llvm-svn: 88703
2009-11-13 21:55:31 +00:00
Devang Patel 452c1646c6 Do not use value handle to wrap MDNode in DIDescriptor.
llvm-svn: 88700
2009-11-13 21:45:04 +00:00
David Goodwin b9fe5d5d02 Allow target to specify regclass for which antideps will only be broken along the critical path.
llvm-svn: 88682
2009-11-13 19:52:48 +00:00
David Greene a32c214b23 Remove duplicate APIs and state WRT spill objects.
llvm-svn: 87106
2009-11-13 14:42:06 +00:00
Devang Patel 76a06074eb Revert r87059 for now. It is failing clang tests.
llvm-svn: 87070
2009-11-13 02:27:33 +00:00
Rafael Espindola 7c6854995d Switch to smallvector. Also fix issue with using unsigend for MaxSplit.
llvm-svn: 87068
2009-11-13 02:18:25 +00:00
Dale Johannesen 5f4eecf961 Adjust isConstantSplat to allow for big-endian targets.
PPC is such a target; make it work.

llvm-svn: 87060
2009-11-13 01:45:18 +00:00
Victor Hernandez 41e7648e09 Remove unnecessary llvm.dbg.declare bitcast
llvm-svn: 87059
2009-11-13 01:44:55 +00:00
Rafael Espindola d554e44092 Add a new split method to StringRef that puts the substrings in a vector.
llvm-svn: 87058
2009-11-13 01:24:40 +00:00
David Greene 2f4c37425b Fix a bootstrap failure.
Provide special isLoadFromStackSlotPostFE and isStoreToStackSlotPostFE
interfaces to explicitly request checking for post-frame ptr elimination
operands.  This uses a heuristic so it isn't reliable for correctness.

llvm-svn: 87047
2009-11-13 00:29:53 +00:00
David Greene 033d65581d Do some cleanups suggested by Chris.
llvm-svn: 87034
2009-11-12 21:49:55 +00:00
Daniel Dunbar 5fb4e7553c StringRef(const char*) should not be used to turn null pointers into empty
strings.

llvm-svn: 87031
2009-11-12 21:26:11 +00:00
Daniel Dunbar c71bf467d5 Remove my Value.h build fix.
llvm-svn: 87029
2009-11-12 21:07:02 +00:00
David Greene f3ecd97cd8 Fix a build error by providing a missing enum value.
llvm-svn: 87028
2009-11-12 21:04:19 +00:00
David Greene be851acfb0 Make the MachineFunction argument of getFrameRegister const.
This also fixes a build error.

llvm-svn: 87027
2009-11-12 21:00:03 +00:00
David Greene 70fdd57dc1 Add hasLoadFromStackSlot and hasStoreToStackSlot to return whether a
machine instruction loads or stores from/to a stack slot.  Unlike
isLoadFromStackSlot and isStoreFromStackSlot, the instruction may be
something other than a pure load/store (e.g. it may be an arithmetic
operation with a memory operand).  This helps AsmPrinter determine when
to print a spill/reload comment.

This is only a hint since we may not be able to figure this out in all
cases.  As such, it should not be relied upon for correctness.

Implement for X86.  Return false by default for other architectures.

llvm-svn: 87026
2009-11-12 20:55:29 +00:00
Daniel Dunbar 22b75873b9 Attempt to unbreak LLVM build, David G. please check.
llvm-svn: 87025
2009-11-12 20:53:56 +00:00
David Greene 1fbe054450 Add a bool flag to StackObjects telling whether they reference spill
slots.  The AsmPrinter will use this information to determine whether to
print a spill/reload comment.

Remove default argument values.  It's too easy to pass a wrong argument
value when multiple arguments have default values.  Make everything
explicit to trap bugs early.

Update all targets to adhere to the new interfaces..

llvm-svn: 87022
2009-11-12 20:49:22 +00:00
Benjamin Kramer 68e4945c03 Add compare_lower and equals_lower methods to StringRef. Switch all users of
StringsEqualNoCase (from StringExtras.h) to it.

llvm-svn: 87020
2009-11-12 20:36:59 +00:00
David Greene 81eb42d8ca Make FixedStackPseudoSourceValue a first-class PseudoSourceValue by
making it visible to clients and adding LLVM-style cast capability.
This will be used by AsmPrinter to determine when to emit spill comments
for an instruction.

llvm-svn: 87019
2009-11-12 20:25:07 +00:00
David Greene 815863f157 Add AsmPrinter comment flags to machine instructions so that AsmPrinter
can emit extra information in comments.

llvm-svn: 87018
2009-11-12 20:21:09 +00:00
David Greene 33935767b9 Add comment flags so AsmPrinter can output additional information when
emitting comments.  These flags carry semantic information not otherwise
easily derivable from the IR text.

llvm-svn: 87016
2009-11-12 20:13:34 +00:00
Devang Patel 2904aa9f6e "Attach debug info with llvm instructions" mode was enabled a month ago. Now make it permanent and remove old way of inserting intrinsics to encode debug info for line number and scopes.
llvm-svn: 87014
2009-11-12 19:02:56 +00:00
Dan Gohman 29271e7585 Mark DBG_LABEL, EH_LABEL, and GC_LABEL as not-duplicable, since
they really are not duplicable.

llvm-svn: 87009
2009-11-12 18:36:19 +00:00
Benjamin Kramer 3628bdab14 Silence a warning on targets with unsigned chars.
llvm-svn: 87002
2009-11-12 17:59:45 +00:00
Nuno Lopes 60d5b1cfdb implement shl, ashr, and lshr methods. shl is not fully implemented as it is quite tricky.
llvm-svn: 86986
2009-11-12 14:53:53 +00:00
Evan Cheng 85a9f430e9 - Teach LSR to avoid changing cmp iv stride if it will create an immediate that
cannot be folded into target cmp instruction.
- Avoid a phase ordering issue where early cmp optimization would prevent the
  later count-to-zero optimization.
- Add missing checks which could cause LSR to reuse stride that does not have
  users.
- Fix a bug in count-to-zero optimization code which failed to find the pre-inc
  iv's phi node.
- Remove, tighten, loosen some incorrect checks disable valid transformations.
- Quite a bit of code clean up.

llvm-svn: 86969
2009-11-12 07:35:05 +00:00
Evan Cheng 15b80e4a9f isLegalICmpImmediate should take a signed integer; code clean up.
llvm-svn: 86964
2009-11-12 07:13:11 +00:00
Oscar Fuentes 700205c49f CMake: Hopefully unbreak the build by mimicking the changes on the
other build system about the new C_INCLUDE_DIRS configure option.

llvm-svn: 86960
2009-11-12 06:48:09 +00:00
Rafael Espindola d95960be25 Add the --with-c-include-dirs to llvm's configure.
The clang patch is next.

llvm-svn: 86955
2009-11-12 05:46:09 +00:00
Oscar Fuentes d533e1d46b CMake: Pass -lm to check_symbol_exists for detecting several math
functions like floorf, ceilf, ... Add test for detecting nearbyintf.

This change was prompted by test/Transforms/SimplifyLibCalls/floor.ll

llvm-svn: 86954
2009-11-12 05:36:09 +00:00
Chris Lattner 565ee2f1bd Add a new getPredicateOnEdge method which returns more rich information for
constant constraints.  Improve the LVI lattice to include inequality 
constraints.

llvm-svn: 86950
2009-11-12 04:36:58 +00:00
Jim Grosbach 801b33b17c Move the utility function UpdateTerminator() from CodePlacementOpt() into
MachineBasicBlock so other passes can utilize it.

llvm-svn: 86947
2009-11-12 03:55:33 +00:00
Nick Lewycky 9f3e73b0f6 Add CreateNUWAdd and CreateNUWSub to complement the existing CreateNSWAdd and
CreateNSWSub functions.

llvm-svn: 86930
2009-11-12 02:08:11 +00:00
Chris Lattner d5e25436a1 expose edge information and switch j-t to use it.
llvm-svn: 86920
2009-11-12 01:29:10 +00:00
Devang Patel 862ef782de Do not use StringRef in DebugInfo interface.
This allows StringRef to skip controversial if(str) check in constructor.
Buildbots, wait for corresponding clang and llvm-gcc FE check-ins!

llvm-svn: 86914
2009-11-12 00:50:58 +00:00
Jakob Stoklund Olesen 4f7fd3baeb Fix liveness calculation when splitting critical edges during PHI elimination.
- Edges are split before any phis are eliminated, so the code is SSA.

- Create a proper IR BasicBlock for the split edges.

- LiveVariables::addNewBlock now has same syntax as
  MachineDominatorTree::addNewBlock. Algorithm calculates predecessor live-out
  set rather than successor live-in set.

This feature still causes some miscompilations.

llvm-svn: 86867
2009-11-11 19:31:31 +00:00
Devang Patel 717b246b19 Add SetDebugLocation() variant to
add debug info location to an instruction.

llvm-svn: 86859
2009-11-11 19:06:06 +00:00
Evan Cheng 3d3c24a82c Add TargetLowering::isLegalICmpImmediate. It tells LSR what immediate can be folded into target icmp instructions.
llvm-svn: 86858
2009-11-11 19:05:52 +00:00
Dan Gohman acc57b2446 Fix a copy+pasto in a comment.
llvm-svn: 86852
2009-11-11 18:14:02 +00:00
Duncan Sands ba61fed5d3 Don't trivially delete unused calls to llvm.invariant.start. This allows
llvm.invariant.start to be used without necessarily being paired with a call
to llvm.invariant.end.  If you run the entire optimization pipeline then such
calls are in fact deleted (adce does it), but that's actually a good thing since
we probably do want them to be zapped late in the game.  There should really be
an integration test that checks that the llvm.invariant.start call lasts long
enough that all passes that do interesting things with it get to do their stuff
before it is deleted.  But since no passes do anything interesting with it yet
this will have to wait for later.

llvm-svn: 86840
2009-11-11 15:34:13 +00:00
Chris Lattner 852f2653c4 remove the now dead condprop pass, PR3906.
llvm-svn: 86810
2009-11-11 05:56:35 +00:00