Commit Graph

83903 Commits

Author SHA1 Message Date
David Chisnall
23a62cbaf5 ELF does not imply GNU/Linux. Do not assume GNU conventions just because we
are targeting an ELF platform.  Only fold gs-relative (and fs-relative) loads
if it is actually sensible to do so for the target platform.

This fixes PR13438.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160687 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24 20:04:16 +00:00
Anshuman Dasgupta
9dc5b3e6c4 Add new interfaces to support ldd's ReaderElf.cpp.
Patch by Sid Manning!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160685 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24 19:48:24 +00:00
Nuno Lopes
0841e63ede TargetLibraryInfo: add strn?cat, strn?cpy, and strn?len
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160678 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24 17:25:06 +00:00
Nuno Lopes
9827c8e1c9 teach objectsize about strdup() and strndup()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160676 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24 16:28:13 +00:00
Nadav Rotem
a94d6e87c4 Clean whitespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160668 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24 10:51:42 +00:00
Nick Lewycky
8899d5c6fb Teach globalopt to not nuke all stores to globals. Keep them around of they
might be deliberate "one time" leaks, so that leak checkers can find them.
This is a reapply of r160602 with the fix that this time I'm committing the
code I thought I was committing last time; the I->eraseFromParent() goes
*after* the break out of the loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160664 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24 07:21:08 +00:00
Craig Topper
ea0ca84647 Change llvm_unreachable in SplitVectorOperand to report_fatal_error. Keeps release builds from crashing if code uses an intrinsic with an illegal type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160661 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24 04:11:21 +00:00
Akira Hatanaka
b57134523c Fix function MipsCodeEmitter::emitExternalSymbolAddress to pass test
ExecutionEngine/test-fp.ll.
 
Patch by Petar Jovanovic.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160653 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24 00:08:26 +00:00
Akira Hatanaka
3ee306cbc0 Add basic ability to setup call frame, and make procedure calls.
Hello world will compile and execute with this patch.

Patch by Reed Kotler.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160651 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 23:45:54 +00:00
Eric Christopher
581a739226 Fix a "Bad fd number" error on some platforms due to a less portable
redirection in the system call.

Patch by Andy Gibbs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160644 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 20:54:17 +00:00
Nuno Lopes
b42729b53a make ConstantRange::zeroExtend() optimal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160643 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 20:33:29 +00:00
Richard Trieu
5e31044e11 Add operator== to APSInt. This will compare the signed bit before doing
the comparison.  This prevents large unsigned integers from being equal to
signed negative integers of the same bit width.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160642 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 20:24:23 +00:00
Dan Gohman
c72d3be389 An objc_retain can serve as a may-use for a different pointer.
rdar://11931823.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160637 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 19:27:31 +00:00
Akira Hatanaka
ec5e97f5c8 Add comment for relocations MO_HIGHER and HIGHEST in MipsBaseInfo.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160636 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 19:19:20 +00:00
Micah Villmow
9a7963947c Test revert of test changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160632 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 16:42:45 +00:00
Micah Villmow
f79c031bdc Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160631 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 16:37:24 +00:00
Nadav Rotem
c1deb67d78 Suppress a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160629 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 13:44:15 +00:00
Nadav Rotem
f4341e4155 Doxygenify the comments of ISD nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160623 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 09:04:00 +00:00
Sylvestre Ledru
c8e41c5917 Fix a typo (the the => the)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160621 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 08:51:15 +00:00
Nadav Rotem
ed1a335ece Fixed DAGCombine optimizations which generate select_cc for targets
that do not support it (X86 does not lower select_cc).

PR: 13428

Together with Michael Kuperstein <michael.m.kuperstein@intel.com>



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160619 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 07:59:50 +00:00
Craig Topper
f093393b9a Tidy up. Fix indentation and remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160617 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 05:38:07 +00:00
Craig Topper
200e04c3fd Change llvm_unreachable in SplitVectorResult to report_fatal_error. Keeps release builds from crashing if code uses an intrinsic with an illegal type. For instance 256-bit AVX intrinsics without having AVX enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160616 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 04:34:49 +00:00
Chandler Carruth
9b4df49d39 Move the initialization of the bounds checking pass. The pass itself
moved earlier. This fixes some layering issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160611 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-22 05:19:32 +00:00
NAKAMURA Takumi
956994c2ed ExecutionEngine/TargetSelect.cpp: Override default triple as LLVM_HOSTTRIPLE.
In current implementation, JIT should run only on host.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160610 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-22 03:04:57 +00:00
NAKAMURA Takumi
2864de7c2d autoconf: Re-introduce LLVM_HOSTTRIPLE since r143500, as rework of PR11060.
cmake: Add LLVM_HOSTTRIPLE. For now, it is same as TARGET_TRIPLE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160609 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-22 03:04:52 +00:00
Nick Lewycky
c7088c9a9c Revert r160602.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160603 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-21 09:03:15 +00:00
Nick Lewycky
61e2ff8f82 Teach globalopt to play nice with leak checkers. This is a reapplication of
r160529 that was subsequently reverted. The fix was to not call
GV->eraseFromParent() right before the caller does the same. The existing
testcases already caught this bug if run under valgrind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160602 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-21 08:29:45 +00:00
Akira Hatanaka
60287963c7 Fix Mips long branch pass.
This pass no longer requires that the global pointer value be saved to the
stack or register since it uses bal instruction to compute branch distance.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160601 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-21 03:30:44 +00:00
Akira Hatanaka
b22c9289b0 Add HIGHER and HIGHEST relocations to Mips backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160599 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-21 03:09:04 +00:00
Akira Hatanaka
fef904d0e8 Revert accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160598 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-21 02:20:33 +00:00
Akira Hatanaka
b7dd9fc678 Add VK_Mips_HIGHER and VK_Mips_HIGHEST to MCSymbolRefExpr::VariantKind.
Test case will be added later when long branch patch is checked in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160597 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-21 02:15:19 +00:00
Nuno Lopes
c606c3ff91 baby steps toward fixing some problems with inbound GEPs that overflow, as discussed 2 months ago or so.
Make sure we do not emit index computations with NSW flags so that we dont get an undef value if the GEP overflows

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160589 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 23:07:40 +00:00
Nuno Lopes
78435f6bb7 move the bounds checking pass to the instrumentation folder, where it belongs. I dunno why in the world I dropped it in the Scalar folder in the first place.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160587 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 22:39:33 +00:00
Benjamin Kramer
e288cd100f Remove unused private member variables uncovered by the recent changes to clang's -Wunused-private-field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160583 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 22:05:57 +00:00
Galina Kistanova
428ff6a644 Fix few warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160576 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 21:30:52 +00:00
Jakob Stoklund Olesen
2ec0cda5d5 Avoid folding loads that are unsafe to move.
LiveRangeEdit::foldAsLoad() can eliminate a register by folding a load
into its only use. Only do that when the load is safe to move, and it
won't extend any live ranges.

This fixes PR13414.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160575 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 21:29:31 +00:00
Chandler Carruth
7325f06051 Fix a dangling StringRef bug in the auto upgrader. In one case, we reset
CI's name, and then used the StringRef pointing at its old name. I'm
fixing it by storing the name in a std::string, and hoisting the
renaming logic to happen always. This is nicer anyways as it will allow
the upgraded IR to have the same names as the input IR in more cases.

Another bug found by AddressSanitizer. Woot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160572 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 21:09:18 +00:00
Jakob Stoklund Olesen
c321a20b2e Split loop exiting edges more aggressively.
PHIElimination splits critical edges when it predicts it can resolve
interference and eliminate copies. It doesn't split the edge if the
interference wouldn't be resolved anyway because the phi-use register is
live in the critical edge anyway.

Teach PHIElimination to split loop exiting edges with interference, even
if it wouldn't resolve the interference. This removes the necessary
copies from the loop, which is still an improvement from injecting the
copies into the loop.

The test case demonstrates the improvement. Before:

LBB0_1:
  cmpb  $0, (%rdx)
  leaq  1(%rdx), %rdx
  movl  %esi, %eax
  je  LBB0_1

After:

LBB0_1:
  cmpb  $0, (%rdx)
  leaq  1(%rdx), %rdx
  je  LBB0_1

  movl  %esi, %eax

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160571 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 20:49:53 +00:00
Benjamin Kramer
bb3c4fab45 Try to unbreak the windows build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160567 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 19:49:33 +00:00
Daniel Dunbar
a7eb58378a SourceMgr: Use has_colors() instead of just is_displayed() before trying to use
color.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160559 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 18:29:44 +00:00
Daniel Dunbar
d79637b940 raw_ostream: Add a has_colors() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160558 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 18:29:41 +00:00
Daniel Dunbar
7d83658140 Process: Add sys::Process::FileDescriptorHasColors().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160557 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 18:29:38 +00:00
Daniel Dunbar
b1a4642796 lit: Use close_fds=True on UNIX, to avoid file descriptor pollution of
subprocesses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160556 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 18:29:34 +00:00
Richard Osborne
dd2fb6c10b Fix assertion in jump threading (PR13405).
GetBestDestForJumpOnUndef() assumes there is at least 1 successor, which isn't
true if the block ends in an indirect branch with no successors. Fix this by
bailing out earlier in this case.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160546 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 10:36:17 +00:00
Kostya Serebryany
f7b08226eb [asan] make sure that the crash callbacks do not get merged (Chandler's idea: insert an empty InlineAsm). Change the order in which the new BBs are inserted: the slow path BB is insert between old BBs, the crash BB is inserted at the end. Don't create an empty BB (introduced by recent commits). Update the test. The experimental code that does manual crash callback merge will most likely be deleted later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160544 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 09:54:50 +00:00
Craig Topper
f654554ee0 Don't use implicit register operands to calculate L-bit for AVX instructions. Needed because super reg defs and kills are added as implicit operands on 128-bit instructions. Fixes PR13349. Patch by Jose Fonseca.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160543 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 07:03:46 +00:00
Owen Anderson
0fcaaafd1a Make RegisterOperand a subclass of DAGOperand so that RegisterOperands can be passed into multiclasses that take DAGOperands as multiclass parameters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160540 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 03:38:19 +00:00
Nick Lewycky
4a96d0e44b Revert r160529 due to crashes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160532 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 23:59:21 +00:00
Pete Cooper
b97c57a8b7 Fix crash in machine verifier when trying to print the def of a register which has no def
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160531 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 23:40:38 +00:00
Nick Lewycky
39e357fafe Don't wipe out global variables that are probably storing pointers to heap
memory. This makes clang play nice with leak checkers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160529 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19 22:35:28 +00:00