Commit Graph

53866 Commits

Author SHA1 Message Date
Anton Korobeynikov e61e0b9a74 Add few pseudo-source-values
llvm-svn: 86383
2009-11-07 17:13:57 +00:00
Anton Korobeynikov 2a88785685 Initial support for addrmode handling. Tests by Brian Lucas!
llvm-svn: 86382
2009-11-07 17:13:35 +00:00
Anton Korobeynikov 1bbc8d2a86 Some preliminary variable asmprinting
llvm-svn: 86381
2009-11-07 17:12:58 +00:00
Anton Korobeynikov 3b7c712e9e Use '.L' for global private prefix (as mspgcc)
llvm-svn: 86380
2009-11-07 17:12:38 +00:00
Anton Korobeynikov e04fa15cb3 Drop old asmprinter stuff
llvm-svn: 86379
2009-11-07 17:12:21 +00:00
Anton Korobeynikov 226467d6a6 It turns out that the testcase in question uncovered subreg-handling bug.
Add assert in asmprinter to catch such cases and xfail the tests.
PR is to be filled.

llvm-svn: 86375
2009-11-07 15:20:32 +00:00
Chris Lattner a381effe72 add the ability for TargetData to return information about legal integer
datatypes on a given CPU.  This is intended to allow instcombine and other
transformations to avoid converting big sequences of operations to an
inconvenient width, and will help clean up after SRoA.  See also "Adding 
legal integer sizes to TargetData" on Feb 1, 2009 on llvmdev, and PR3451.

Comments welcome.

llvm-svn: 86370
2009-11-07 09:35:34 +00:00
Chris Lattner 91f9582fe1 more cleanup.
llvm-svn: 86369
2009-11-07 09:23:04 +00:00
Chris Lattner d82510e109 add some missing #includes
llvm-svn: 86367
2009-11-07 09:20:54 +00:00
Chris Lattner f819398067 rewrite TargetData to use StringRef/raw_ostream instead of thrashing std::strings.
llvm-svn: 86366
2009-11-07 09:13:23 +00:00
Chris Lattner 6b22952b03 prune #include / layering violation
llvm-svn: 86365
2009-11-07 09:07:01 +00:00
Jeffrey Yasskin db5f24ce77 Make the need-stub variables accurate and consistent. In the case of
MachineRelocations, "stub" always refers to a far-call stub or a
load-a-faraway-global stub, so this patch adds "Far" to the term. (Other stubs
are used for lazy compilation and dlsym address replacement.) The variable was
also inconsistent between the positive and negative sense, and the positive
sense ("NeedStub") was more demanding than is accurate (since a nearby-enough
function can be called directly even if the platform often requires a stub).
Since the negative sense causes double-negatives, I switched to
"MayNeedFarStub" globally.

llvm-svn: 86363
2009-11-07 08:51:52 +00:00
Eric Christopher bd05185ef1 Fix a couple of shuffle patterns to use movhlps instead
of movhps as the constraint.  Changes optimizations so
update testcases as appropriate as well.

llvm-svn: 86360
2009-11-07 08:45:53 +00:00
Nick Lewycky b6a3dd48f4 Teach dead store elimination that certain intrinsics write to memory just like
a store.

llvm-svn: 86359
2009-11-07 08:34:40 +00:00
Chris Lattner c76ce9f208 remove the win32 tree, it's stale and confusing.
llvm-svn: 86358
2009-11-07 08:31:52 +00:00
Chris Lattner 5ff7f5672e reapply 86289, 86278, 86270, 86267, 86266 & 86264 plus a fix
(making pred factoring only happen if threading is guaranteed
to be successful).

This now survives an X86-64 bootstrap of llvm-gcc.

llvm-svn: 86355
2009-11-07 08:05:03 +00:00
Chris Lattner 8e1d7222a7 Fix PR5421 by APInt'izing switch lowering.
llvm-svn: 86354
2009-11-07 07:50:34 +00:00
Nick Lewycky 9b669b3c4f Oops, FunctionContainsEscapingAllocas is really used to mean two different
things. Back out part of r86349 for a moment.

llvm-svn: 86353
2009-11-07 07:42:38 +00:00
Nick Lewycky 5091272fdf Dust off tail recursion elimination. Fix a fixme by applying CaptureTracking
and add a .ll to demo the new capability.

llvm-svn: 86349
2009-11-07 07:10:01 +00:00
Mikhail Glushenkov 0fa9474836 llvmc: Add a '-time' option.
llvm-svn: 86348
2009-11-07 06:33:58 +00:00
Mikhail Glushenkov 358607dfa3 Trailing whitespace.
llvm-svn: 86347
2009-11-07 06:33:12 +00:00
Mikhail Glushenkov b53593d320 80-col violation.
llvm-svn: 86346
2009-11-07 06:33:01 +00:00
Chris Lattner 74ab6efbe8 merge cmp1 into cmp0 and filecheckize.
llvm-svn: 86345
2009-11-07 06:19:20 +00:00
Lang Hames bc247dce4d Update some globals to use ManagedStatic.
llvm-svn: 86342
2009-11-07 05:50:28 +00:00
Mon P Wang fc032ced22 Fix memoizing of CvtRndSatSDNode
llvm-svn: 86340
2009-11-07 04:46:25 +00:00
Mon P Wang 5321dd8823 Fixed Overload table bug noticed by Jakob
llvm-svn: 86332
2009-11-07 04:07:33 +00:00
Evan Cheng 16e1c31da2 Missed this.
llvm-svn: 86331
2009-11-07 04:07:30 +00:00
Evan Cheng a8e8a7c976 Refactor code. Fix a potential missing check. Teach isIdentical() about tLDRpci_pic.
llvm-svn: 86330
2009-11-07 04:04:34 +00:00
Evan Cheng 7ff831962a - Add TargetInstrInfo::isIdentical(). It's similar to MachineInstr::isIdentical
except it doesn't care if the definitions' virtual registers differ. This is
  used by machine LICM and other MI passes to perform CSE.
- Teach Thumb2InstrInfo::isIdentical() to check two t2LDRpci_pic are identical.
  Since pc relative constantpool entries are always different, this requires it
  it check if the values can actually the same.

llvm-svn: 86328
2009-11-07 03:52:02 +00:00
Ted Kremenek 50dddc8b07 Update CMake file.
llvm-svn: 86325
2009-11-07 03:26:59 +00:00
Kenneth Uildriks 07119737aa Add code to check at SelectionDAGISel::LowerArguments time to see if return values can be lowered to registers. Coming soon, code to perform sret-demotion if return values cannot be lowered to registers
llvm-svn: 86324
2009-11-07 02:11:54 +00:00
Jakob Stoklund Olesen 4141d8ee92 Fix inverted conflict test in -early-coalesce.
A non-identity copy cannot be coalesced when the phi join destination register
is live at the copy site.

Also verify the condition that the PHI join source register is only used in
the PHI join. Otherwise the coalescing is invalid.

llvm-svn: 86322
2009-11-07 01:58:40 +00:00
Devang Patel 3a42e7ac65 Revert following patches to fix llvmgcc bootstrap.
86289, 86278, 86270, 86267, 86266 & 86264
Chris, please take a look.

llvm-svn: 86321
2009-11-07 01:32:59 +00:00
Johnny Chen 3467dcb12d My previous patch (r84124) for setting the encoding bits 4 and 7 of DPSoRegFrm
was wrong and too aggressive in the sense that DPSoRegFrm includes both constant
shifts (with Inst{4} = 0) and register controlled shifts (with Inst{4} = 1 and
Inst{7} = 0).  The 'rr' fragment of the multiclass definitions actually means
register/register with no shift, see A8-11.

llvm-svn: 86319
2009-11-07 00:54:36 +00:00
Victor Hernandez bde558c536 - new SROA mallocs should have the mallocs running-or'ed, not the malloc's bitcast
- fix ProcessInternalGlobal() debug output

llvm-svn: 86317
2009-11-07 00:41:19 +00:00
Victor Hernandez e04ed0c68f Fit in 80 columns
llvm-svn: 86316
2009-11-07 00:36:50 +00:00
Jeffrey Yasskin 8f77e948e5 Avoid "ambiguous 'else'" warning from gcc.
llvm-svn: 86314
2009-11-07 00:26:47 +00:00
Victor Hernandez f3db915294 Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.
Here is the original commit message:

This commit updates malloc optimizations to operate on malloc calls that have constant int size arguments.

Update CreateMalloc so that its callers specify the size to allocate:
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.

Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.

Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses.  The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.

Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses.  The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.

Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.

Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.

llvm-svn: 86311
2009-11-07 00:16:28 +00:00
Jim Grosbach 79d70e3e65 80-columns
llvm-svn: 86310
2009-11-07 00:13:30 +00:00
Jeffrey Yasskin ba78dcd90d Give the JITResolver a direct pointer to its JITEmitter, and use that instead
of going through the global TheJIT variable.  This makes it easier to use
features of JITEmitter that aren't in JITCodeEmitter for fixing PR5201.

llvm-svn: 86305
2009-11-07 00:00:10 +00:00
Evan Cheng 207b246650 - Add pseudo instructions tLDRpci_pic and t2LDRpci_pic which does a pc-relative
load of a GV from constantpool and then add pc. It allows the code sequence to
  be rematerializable so it would be hoisted by machine licm.
- Add a late pass to break these pseudo instructions into a number of real
  instructions. Also move the code in Thumb2 IT pass that breaks up t2MOVi32imm
  to this pass. This is done before post regalloc scheduling to allow the
  scheduler to proper schedule these instructions. It also allow them to be
  if-converted and shrunk by later passes.

llvm-svn: 86304
2009-11-06 23:52:48 +00:00
Anton Korobeynikov 9df3acf486 Honour subreg machine operands during asmprinting
llvm-svn: 86303
2009-11-06 23:45:15 +00:00
Bob Wilson d95ccd6c4d Print VMOV (immediate) operands as hexadecimal values. Apple's assembler
will not accept negative values for these.  LLVM's default operand printing
sign extends values, so that valid unsigned values appear as negative
immediates.  Print all VMOV immediate operands as hex values to resolve this.
Radar 7372576.

llvm-svn: 86301
2009-11-06 23:33:28 +00:00
Chris Lattner eb690feaef Fix a bug where we'd call SplitBlockPredecessors with a pred in the
set only once even if it has multiple edges to BB.

llvm-svn: 86299
2009-11-06 23:19:58 +00:00
Bob Wilson db42ca663b Fix a broken test.
llvm-svn: 86298
2009-11-06 23:06:42 +00:00
Bob Wilson b29e155c53 Fix comment typos.
llvm-svn: 86295
2009-11-06 22:38:38 +00:00
Evan Cheng 408aa56fb5 Remove ARMPCLabelIndex from ARMISelLowering. Use ARMFunctionInfo::createConstPoolEntryUId() instead.
llvm-svn: 86294
2009-11-06 22:24:13 +00:00
Victor Hernandez ce99780980 CallInst::CreateMalloc() and CallInst::CreateFree() need to create calls with correct calling convention
llvm-svn: 86290
2009-11-06 21:43:21 +00:00
Eli Friedman a70917b2f4 Remove function left over from other jump threading cleanup.
llvm-svn: 86289
2009-11-06 21:24:57 +00:00
Gabor Greif 445737df6a fix typo
llvm-svn: 86281
2009-11-06 20:10:46 +00:00
Chris Lattner a8b9ce3f07 Fix a problem discovered on self host.
llvm-svn: 86278
2009-11-06 19:21:48 +00:00
Chris Lattner d91a7960bf remove more code subsumed by r86264
llvm-svn: 86270
2009-11-06 18:24:32 +00:00
Devang Patel 33e0c99d67 Tolerate invalid derived type.
llvm-svn: 86269
2009-11-06 18:24:05 +00:00
Chris Lattner 899ef22acb eliminate some more code subsumed by r86264
llvm-svn: 86267
2009-11-06 18:22:54 +00:00
Chris Lattner 2f6184f6aa remove now redundant code, r86264 handles this case.
llvm-svn: 86266
2009-11-06 18:20:58 +00:00
Chris Lattner 68d2417e05 Extend jump threading to support much more general threading
predicates.  This allows us to jump thread things like:

_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit119:
  %tmp1.i24166 = phi i8 [ 1, %bb5.i117 ], [ %tmp1.i24165, %_Z....exit ], [ %tmp1.i24165, %bb4.i114 ] 
  %toBoolnot.i87 = icmp eq i8 %tmp1.i24166, 0     ; <i1> [#uses=1]
  %tmp4.i90 = icmp eq i32 %tmp2.i, 6              ; <i1> [#uses=1]
  %or.cond173 = and i1 %toBoolnot.i87, %tmp4.i90  ; <i1> [#uses=1]
  br i1 %or.cond173, label %bb4.i96, label %_ZN12...

Where it is "obvious" that when coming from %bb5.i117 that the 'and' is always 
false.  This triggers a surprisingly high number of times in the testsuite, 
and gets us closer to generating good code for doug's strswitch testcase.

This also make a bunch of other code in jump threading redundant, I'll rip
out in the next patch.  This survived an enable-checking llvm-gcc bootstrap.

llvm-svn: 86264
2009-11-06 18:15:14 +00:00
Dan Gohman 0080ee2d91 Use WriteAsOperand to print GlobalAddress MachineOperands. This
prints them with the leading '@'.

llvm-svn: 86261
2009-11-06 18:03:10 +00:00
Devang Patel cc11371b77 Do not bother to emit debug info for nameless global variable.
llvm-svn: 86259
2009-11-06 17:58:12 +00:00
Daniel Dunbar ad36e8aceb Pass StringRef by value.
llvm-svn: 86251
2009-11-06 10:58:06 +00:00
Chris Lattner 81f1b31c96 clang++ points out that this is pointless.
llvm-svn: 86239
2009-11-06 06:33:01 +00:00
Chris Lattner 8c12bb8cd7 remove some more Context arguments.
llvm-svn: 86235
2009-11-06 05:59:53 +00:00
Chris Lattner 46b5c642b9 remove a bunch of extraneous LLVMContext arguments
from various APIs, addressing PR5325.

llvm-svn: 86231
2009-11-06 04:27:31 +00:00
Daniel Dunbar 529f913f55 NewNighlytTest: Fix timestamp format to actually make sense (it was missing the hour).
llvm-svn: 86229
2009-11-06 04:12:13 +00:00
Daniel Dunbar 04b3960bfe NewNightlyTest: Add -noclean option, which doesn't run 'make clean' before building LLVM (for testing).
Also, switch to always running 'make clean' in the test-suite directories.

llvm-svn: 86228
2009-11-06 04:12:07 +00:00
Daniel Dunbar 9e0febb2c7 NewNightlyTest: Unbreak passing the build directory via a positional argument.
llvm-svn: 86227
2009-11-06 04:12:02 +00:00
Daniel Dunbar 545ffe6fc1 NewNightlyTest: Add -llvmgccdir as alternative to environment variable.
llvm-svn: 86226
2009-11-06 04:11:29 +00:00
Victor Hernandez b9f5899779 Revert r86077 because it caused crashes in 179.art and 175.vpr on ARM
llvm-svn: 86213
2009-11-06 01:33:24 +00:00
Devang Patel 06ce6506d2 Do not try to emit debug info entry for dead global variable.
llvm-svn: 86212
2009-11-06 01:30:04 +00:00
Dan Gohman 701e4e9b2b Don't print a redundant tab for inline asm, and do use the new printKill.
llvm-svn: 86206
2009-11-06 00:19:43 +00:00
Douglas Gregor 140db51755 Add a bunch of missing "template" keywords to disambiguate dependent template names. GCC eats this ill-formed code, Clang does not. I already filed PR5404 to improve recovery in this case
llvm-svn: 86204
2009-11-06 00:12:53 +00:00
Eric Christopher 80f04dc67d Fix PR5315, original patch by Nicolas Capens!
llvm-svn: 86203
2009-11-06 00:11:57 +00:00
Dan Gohman ee8afcc59d Factor out the printing of the leading tab into printInlineAsm.
llvm-svn: 86199
2009-11-06 00:04:54 +00:00
Dan Gohman 6791639910 Make printImplicitDef and printKill non-virtual, since they don't
need to be overridden.

llvm-svn: 86198
2009-11-06 00:04:05 +00:00
Dan Gohman 006f9353e1 Use SUBREG_TO_REG instead of INSERT_SUBREG to model x86-64's
implicit zero-extend.

llvm-svn: 86196
2009-11-05 23:53:08 +00:00
Dan Gohman a1bf0c0acc Teach LSR to avoid calling SplitCriticalEdge on edges with indirectbr.
llvm-svn: 86193
2009-11-05 23:34:59 +00:00
Dan Gohman 98693a3ac2 Update these tests for the new label names.
llvm-svn: 86192
2009-11-05 23:31:40 +00:00
Dan Gohman d53b5cfe3f Fix the label name generation for address-taken labels to avoid potential
problems with name collisions.

llvm-svn: 86189
2009-11-05 23:14:35 +00:00
Douglas Gregor 5632657208 Make a few more LLVM headers parsable as standalone headers.
Fix some problems with the hidden copy constructors for
ImmutableMap/ImmutableSet found by Clang++.

llvm-svn: 86186
2009-11-05 23:01:30 +00:00
Douglas Gregor 86a947dde9 Teach lit's SyntaxCheckTest two new tricks:
- skip .svn directories
  - add a set of excluded filenames so we can easily skip tests

llvm-svn: 86185
2009-11-05 22:58:04 +00:00
Lang Hames 933c541270 Added support for renumbering existing index list elements. Removed some junk from the initial numbering code in runOnMachineFunction.
llvm-svn: 86184
2009-11-05 22:20:57 +00:00
Dan Gohman 928068a886 Avoid calling getUniqueExitBlocks from within LoopSimplify, as it depends
on loops having dedicated exits, which LoopSimplify can no longer always
guarantee.

llvm-svn: 86181
2009-11-05 21:48:32 +00:00
Dan Gohman dca7ac335b LoopDeletion depends on loops having dedicated exits.
llvm-svn: 86180
2009-11-05 21:47:04 +00:00
Dan Gohman 1ef784db67 The introduction of indirectbr meant the introduction of
unsplittable critical edges, which means the introduction of
loops which cannot be transformed to LoopSimplify form. Fix
LoopSimplify to avoid transforming such loops into invalid
code.

llvm-svn: 86176
2009-11-05 21:14:46 +00:00
Dan Gohman a83ac2d9e7 Update various Loop optimization passes to cope with the possibility that
LoopSimplify form may not be available.

llvm-svn: 86175
2009-11-05 21:11:53 +00:00
David Goodwin bed7cb6c1d Fix bug in aggressive antidep breaking; liveness was not updated correctly for regions that do not have antidep candidates.
llvm-svn: 86172
2009-11-05 21:06:09 +00:00
Dan Gohman 415c64ea3f Teach LoopUnroll how to bail if LoopSimplify can't give it what it needs.
llvm-svn: 86164
2009-11-05 19:44:06 +00:00
Dan Gohman d9fa1c9c1e Call getAnalysis<LoopInfo> the normal way, instead of asking passed-in
LoopPassManager for it.

llvm-svn: 86163
2009-11-05 19:43:25 +00:00
Dan Gohman b632705017 InstrTypes.h includes Instruction.h, so it's not necessary to include both.
llvm-svn: 86162
2009-11-05 19:42:20 +00:00
Dan Gohman 2267f8aa72 Fix IVUsers to avoid assuming that the loop has a unique backedge.
llvm-svn: 86161
2009-11-05 19:41:37 +00:00
Dan Gohman 885c46e387 Delete an unused member variable.
llvm-svn: 86160
2009-11-05 19:33:15 +00:00
Dan Gohman e3a1706e33 Factor out the predicate code for loopsimplify form exit blocks into
a separate helper function.

llvm-svn: 86159
2009-11-05 19:21:41 +00:00
Oscar Fuentes 17feb2a9ee CMake: Detect dotty.
Patch by Arnaud Allard de Grandmaison!

llvm-svn: 86153
2009-11-05 19:03:26 +00:00
Oscar Fuentes 1a0bfb6290 CMake: do not test for pthread and dl libraries on Windows (except
Cygwin). Fixes PR 5368.

llvm-svn: 86152
2009-11-05 18:57:56 +00:00
Dan Gohman 43bdc260d6 Avoid printing a redundant space in SDNode->dump().
llvm-svn: 86151
2009-11-05 18:49:11 +00:00
Dan Gohman b15f4a1cbd Remove uninteresting and confusing debug output.
llvm-svn: 86149
2009-11-05 18:47:09 +00:00
Douglas Gregor e076030f0c Move llvm:🆑:opt's conversion function into the base classes that
actually need that conversion function. Silences a Clang++ warning.

llvm-svn: 86148
2009-11-05 18:30:50 +00:00
Dan Gohman 00c793822e Add an assertion to catch indirectbr in SplitBlockPredecessors. This
makes several optimization passes abort in cases where they're currently
silently miscompiling code.

Remove the indirectbr assertion from SplitEdge. Indirectbr is only
a problem for critical edges, and SplitEdge defers to SplitCriticalEdge
to handle those, and SplitCriticalEdge has its own assertion for
indirectbr.

llvm-svn: 86147
2009-11-05 18:25:44 +00:00
Chris Lattner 06c26d982e add a note from PR5313
llvm-svn: 86146
2009-11-05 18:19:19 +00:00
Chris Lattner a117dd23e9 Declare classes with matched tags, pointed out by a clang++ warning.
llvm-svn: 86144
2009-11-05 17:51:44 +00:00
Benjamin Kramer b971445ab7 Teach SimplifyLibCalls to fold memcmp calls with constant arguments.
llvm-svn: 86141
2009-11-05 17:44:22 +00:00