oota-llvm.git
12 years agoAdd the source file with trivial definitions in it that was missing from
Chandler Carruth [Thu, 1 Mar 2012 18:58:59 +0000 (18:58 +0000)]
Add the source file with trivial definitions in it that was missing from
r151822, sorry sorry. =[

We need 'git svn nothave' or some such...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151824 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRewrite LLVM's generalized support library for hashing to follow the API
Chandler Carruth [Thu, 1 Mar 2012 18:55:25 +0000 (18:55 +0000)]
Rewrite LLVM's generalized support library for hashing to follow the API
of the proposed standard hashing interfaces (N3333), and to use
a modified and tuned version of the CityHash algorithm.

Some of the highlights of this change:
 -- Significantly higher quality hashing algorithm with very well
    distributed results, and extremely few collisions. Should be close to
    a checksum for up to 64-bit keys. Very little clustering or clumping of
    hash codes, to better distribute load on probed hash tables.
 -- Built-in support for reserved values.
 -- Simplified API that composes cleanly with other C++ idioms and APIs.
 -- Better scaling performance as keys grow. This is the fastest
    algorithm I've found and measured for moderately sized keys (such as
    show up in some of the uniquing and folding use cases)
 -- Support for enabling per-execution seeds to prevent table ordering
    or other artifacts of hashing algorithms to impact the output of
    LLVM. The seeding would make each run different and highlight these
    problems during bootstrap.

This implementation was tested extensively using the SMHasher test
suite, and pased with flying colors, doing better than the original
CityHash algorithm even.

I've included a unittest, although it is somewhat minimal at the moment.
I've also added (or refactored into the proper location) type traits
necessary to implement this, and converted users of GeneralHash over.

My only immediate concerns with this implementation is the performance
of hashing small keys. I've already started working to improve this, and
will continue to do so. Currently, the only algorithms faster produce
lower quality results, but it is likely there is a better compromise
than the current one.

Many thanks to Jeffrey Yasskin who did most of the work on the N3333
paper, pair-programmed some of this code, and reviewed much of it. Many
thanks also go to Geoff Pike Pike and Jyrki Alakuijala, the original
authors of CityHash on which this is heavily based, and Austin Appleby
who created MurmurHash and the SMHasher test suite.

Also thanks to Nadav, Tobias, Howard, Jay, Nick, Ahmed, and Duncan for
all of the review comments! If there are further comments or concerns,
please let me know and I'll jump on 'em.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151822 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove getSubRegIndex out of generated code into MCRegisterInfo, devirtualize it.
Benjamin Kramer [Thu, 1 Mar 2012 18:16:35 +0000 (18:16 +0000)]
Move getSubRegIndex out of generated code into MCRegisterInfo, devirtualize it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151821 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r151816 as Jim has the appropriate fix.
Chad Rosier [Thu, 1 Mar 2012 17:41:19 +0000 (17:41 +0000)]
Revert r151816 as Jim has the appropriate fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151818 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix testcases from r151807.
Chad Rosier [Thu, 1 Mar 2012 17:31:30 +0000 (17:31 +0000)]
Fix testcases from r151807.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151816 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove TargetRegisterInfo::getSubReg() to MCRegisterInfo.
Jim Grosbach [Thu, 1 Mar 2012 17:30:39 +0000 (17:30 +0000)]
Move TargetRegisterInfo::getSubReg() to MCRegisterInfo.

Allows us to de-virtualize the function and provides access to it in
the instruction printer, which is useful for handling composite
physical registers (e.g., ARM register lists).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151815 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert "Emit the SubRegTable with the smallest possible integer type."
Jim Grosbach [Thu, 1 Mar 2012 17:30:35 +0000 (17:30 +0000)]
Revert "Emit the SubRegTable with the smallest possible integer type."

This reverts commit 151760.

We want to move getSubReg() from TargetRegisterInfo into MCRegisterInfo,
but to do that, the type of the lookup table needs to be the same for
all targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151814 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd missing triple for tests.
Jim Grosbach [Thu, 1 Mar 2012 17:30:32 +0000 (17:30 +0000)]
Add missing triple for tests.

Make darwin bots happier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151813 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agorplace Alpha with ARM in docs/WritingAnLLVMBackend.html, patch by chenwj
Jia Liu [Thu, 1 Mar 2012 15:14:19 +0000 (15:14 +0000)]
rplace Alpha with ARM in docs/WritingAnLLVMBackend.html, patch by chenwj

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151811 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a codegen fault in which log2 or exp2 could be dead-code eliminated even though...
James Molloy [Thu, 1 Mar 2012 14:32:18 +0000 (14:32 +0000)]
Fix a codegen fault in which log2 or exp2 could be dead-code eliminated even though they could have sideeffects.

Only allow log2/exp2 to be converted to an intrinsic if they are declared "readnone".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151807 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake TargetRegisterClasses non-virtual by making the only virtual function a function...
Benjamin Kramer [Thu, 1 Mar 2012 13:37:55 +0000 (13:37 +0000)]
Make TargetRegisterClasses non-virtual by making the only virtual function a function pointer.

This allows us to make TRC non-polymorphic and value-initializable, eliminating a huge static
initializer and a ton of cruft from the generated code.

Shrinks ARMBaseRegisterInfo.o by ~100k.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151806 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agollvm/test/CMakeLists.txt: Update dependencies to add llvm-readobj to "check".
NAKAMURA Takumi [Thu, 1 Mar 2012 03:14:13 +0000 (03:14 +0000)]
llvm/test/CMakeLists.txt: Update dependencies to add llvm-readobj to "check".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151795 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEmit the "is an intrinsic overloaded" table as a bitfield.
Benjamin Kramer [Thu, 1 Mar 2012 02:16:57 +0000 (02:16 +0000)]
Emit the "is an intrinsic overloaded" table as a bitfield.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151792 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPass endian information to constructors. Define separate functions to create
Akira Hatanaka [Thu, 1 Mar 2012 01:53:15 +0000 (01:53 +0000)]
Pass endian information to constructors. Define separate functions to create
objects for big endian and little endian targets.

Patch by Jack Carter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151788 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake InlineSpiller bundle-aware.
Jakob Stoklund Olesen [Thu, 1 Mar 2012 01:43:25 +0000 (01:43 +0000)]
Make InlineSpiller bundle-aware.

Simply treat bundles as instructions. Spill code is inserted between
bundles, never inside a bundle.  Rewrite all operands in a bundle at
once.

Don't attempt and memory operand folding inside bundles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151787 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[Object]
David Meyer [Thu, 1 Mar 2012 01:36:50 +0000 (01:36 +0000)]
[Object]
* Add begin_dynamic_table() / end_dynamic_table() private interface to ELFObjectFile.
* Add begin_libraries_needed() / end_libraries_needed() interface to ObjectFile, for grabbing the list of needed libraries for a shared object or dynamic executable.
* Implement this new interface completely for ELF, leave stubs for COFF and MachO.
* Add 'llvm-readobj' tool for dumping ObjectFile information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151785 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove getBundleStart() into MachineInstrBundle.h.
Jakob Stoklund Olesen [Thu, 1 Mar 2012 01:26:01 +0000 (01:26 +0000)]
Move getBundleStart() into MachineInstrBundle.h.

This allows the function to be inlined, and makes it suitable for use in
getInstructionIndex().

Also provide a const version. C++ is great for touch typing practice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151782 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEmit the intrinsic modref info as a lookup table instead of a huge switch.
Benjamin Kramer [Thu, 1 Mar 2012 01:18:32 +0000 (01:18 +0000)]
Emit the intrinsic modref info as a lookup table instead of a huge switch.

Shrinks BasicAliasAnalysis.o from 106k to 56k on i386.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151781 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't redundantly copy implicit operands when rematerializing.
Lang Hames [Thu, 1 Mar 2012 00:41:17 +0000 (00:41 +0000)]
Don't redundantly copy implicit operands when rematerializing.

While we're at it - don't copy vreg implicit operands while rematerializing.
This fixes PR12138.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151779 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix flags for test in MC/MachO/ARM/empty-function-nop.ll
Richard Trieu [Thu, 1 Mar 2012 00:29:09 +0000 (00:29 +0000)]
Fix flags for test in MC/MachO/ARM/empty-function-nop.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151778 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixed the 32-bit runtime dynamic loader to allocate
Sean Callanan [Thu, 1 Mar 2012 00:15:29 +0000 (00:15 +0000)]
Fixed the 32-bit runtime dynamic loader to allocate
code sections when needed.  It just had a conditional
the wrong way around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151777 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement getSubRegIndex as a linear search on the SubRegTable instead of using a...
Benjamin Kramer [Wed, 29 Feb 2012 23:46:50 +0000 (23:46 +0000)]
Implement getSubRegIndex as a linear search on the SubRegTable instead of using a big switch.

- The search bounds are constant, in the worst case (ARM target) it will scan over 30 uint16_ts.
- This method isn't very hot, I had problems finding a testcase where it's called more than a dozen of times (no perf impact).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151773 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdded annotations for x86 pc relative loads to llvm's 'C' disassembler.
Kevin Enderby [Wed, 29 Feb 2012 22:58:34 +0000 (22:58 +0000)]
Added annotations for x86 pc relative loads to llvm's 'C' disassembler.

So with darwin's otool(1) an x86_64 hello world .o file will print:
leaq L_.str(%rip), %rax ## literal pool for: Hello world

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151769 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTidy up. 80 columns.
Jim Grosbach [Wed, 29 Feb 2012 22:07:56 +0000 (22:07 +0000)]
Tidy up. 80 columns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151764 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEmit the SubRegTable with the smallest possible integer type.
Benjamin Kramer [Wed, 29 Feb 2012 21:57:08 +0000 (21:57 +0000)]
Emit the SubRegTable with the smallest possible integer type.

Doesn't help ARM with its massive register set, but halves the size on x86 and all other targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151760 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTidy up. Spelling.
Jim Grosbach [Wed, 29 Feb 2012 21:46:32 +0000 (21:46 +0000)]
Tidy up. Spelling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151758 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove the subregister indicies enum into the REGINFO_ENUM section.
Jim Grosbach [Wed, 29 Feb 2012 21:43:16 +0000 (21:43 +0000)]
Move the subregister indicies enum into the REGINFO_ENUM section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151756 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBitstreamWriter: Use SmallVector::append instead of multiple push_back calls.
Daniel Dunbar [Wed, 29 Feb 2012 21:02:05 +0000 (21:02 +0000)]
BitstreamWriter: Use SmallVector::append instead of multiple push_back calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151755 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSwitch TargetRegisterInfo::getSubReg() to use a lookup table.
Jim Grosbach [Wed, 29 Feb 2012 20:31:17 +0000 (20:31 +0000)]
Switch TargetRegisterInfo::getSubReg() to use a lookup table.

Instead of nested switch statements, use a lookup table. On ARM, this replaces
a 23k (x86_64 release build) function with a 16k table. Its not unlikely to
be faster, as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151751 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBitstreamWriter: Change primary output buffer to be a SmallVector instead of an
Daniel Dunbar [Wed, 29 Feb 2012 20:31:09 +0000 (20:31 +0000)]
BitstreamWriter: Change primary output buffer to be a SmallVector instead of an
std::vector.
 - Good for 1-2% speedup on writing PCH for Cocoa.h.
 - Clang side API match to follow shortly, there wasn't an easy way to make this
   non-breaking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151750 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBitstreamWriter: Isolate access to the underlying buffer.
Daniel Dunbar [Wed, 29 Feb 2012 20:31:05 +0000 (20:31 +0000)]
BitstreamWriter: Isolate access to the underlying buffer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151749 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBitcodeWriter: Expose less implementation details -- make BackpatchWord private
Daniel Dunbar [Wed, 29 Feb 2012 20:31:01 +0000 (20:31 +0000)]
BitcodeWriter: Expose less implementation details -- make BackpatchWord private
and remove getBuffer().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151748 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBitcode: Don't expose WriteBitcodeToStream to clients.
Daniel Dunbar [Wed, 29 Feb 2012 20:30:56 +0000 (20:30 +0000)]
Bitcode: Don't expose WriteBitcodeToStream to clients.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151747 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntel Atom instruction itineraries for mov sign extension and mov zero extension.
Andrew Trick [Wed, 29 Feb 2012 19:44:41 +0000 (19:44 +0000)]
Intel Atom instruction itineraries for mov sign extension and mov zero extension.

Patch by Tyler Nowicki!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151743 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd myself to the credits file
Hal Finkel [Wed, 29 Feb 2012 16:43:11 +0000 (16:43 +0000)]
Add myself to the credits file

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151732 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoLegalizeIntegerTypes: Reorder operations in the "big shift by small amount" optimizat...
Benjamin Kramer [Wed, 29 Feb 2012 13:27:00 +0000 (13:27 +0000)]
LegalizeIntegerTypes: Reorder operations in the "big shift by small amount" optimization, making the lives of later passes easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151722 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoHave GVN also do condition propagation when the right-hand side is not
Duncan Sands [Wed, 29 Feb 2012 11:12:03 +0000 (11:12 +0000)]
Have GVN also do condition propagation when the right-hand side is not
a constant.  This fixes PR1768.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151713 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhere the alloca'd space actually lives in ram is undefined, and attempting to
Nick Lewycky [Wed, 29 Feb 2012 08:26:44 +0000 (08:26 +0000)]
Where the alloca'd space actually lives in ram is undefined, and attempting to
pin it down is undefined behaviour.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151710 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[Object] Add symbol attribute flags: ST_ThreadLocal, ST_Common, and ST_Undefined...
David Meyer [Wed, 29 Feb 2012 02:11:55 +0000 (02:11 +0000)]
[Object] Add symbol attribute flags: ST_ThreadLocal, ST_Common, and ST_Undefined. Implement these completely for ELF.
Rename ST_External to ST_Unknown, and slightly change its semantics. It now only indicates that the symbol's type
is unknown, not that the symbol is undefined. (For that, use ST_Undefined).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151696 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTestcase for r151691.
Bill Wendling [Wed, 29 Feb 2012 01:53:13 +0000 (01:53 +0000)]
Testcase for r151691.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151694 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRestrict this transformation to equality conditions.
Bill Wendling [Wed, 29 Feb 2012 01:46:50 +0000 (01:46 +0000)]
Restrict this transformation to equality conditions.

This transformation is not correct for not-equal conditions:

(trunc x) != C1 & (and x, CA) != C2 -> (and x, CA|CMAX) != C1|C2

Let
  C1 == 0
  C2 == 0
  CA == 0xFF0000
  CMAX == 0xFF
and truncating to i8.

The original truth table:

    x   | A: trunc x != 0 | B: x & 0xFF0000 != 0 | A & B != 0
--------------------------------------------------------------
0x00000 |        0        |          0           |     0
0x00001 |        1        |          0           |     0
0x10000 |        0        |          1           |     0
0x10001 |        1        |          1           |     1

The truth table of the replacement:

    x   | x & 0xFF00FF != 0
----------------------------
0x00000 |        0
0x00001 |        1
0x10000 |        1
0x10001 |        1

So they are different.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151691 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd an analyzeVirtReg() function.
Jakob Stoklund Olesen [Wed, 29 Feb 2012 01:40:37 +0000 (01:40 +0000)]
Add an analyzeVirtReg() function.

This function does more or less the same as
MI::readsWritesVirtualRegister(), but it supports bundles as well.

It also determines if any constraint requires reading and writing
operands to use the same register.  Most clients want to know.

Use the more modern MO.readsReg() instead of trying to sort out undefs
and partial redefines.  Stop supporting the extra full <imp-def> operand
as an alternative to <def,undef> sub-register defines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151690 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake MemoryObject accessor members const again
Derek Schuff [Wed, 29 Feb 2012 01:09:06 +0000 (01:09 +0000)]
Make MemoryObject accessor members const again

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151687 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSupport/PathV2: Fix namespace qualifier in make_absolute(), for Win32.
Daniel Dunbar [Wed, 29 Feb 2012 00:46:46 +0000 (00:46 +0000)]
Support/PathV2: Fix namespace qualifier in make_absolute(), for Win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151685 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove the operand iterator into MachineInstrBundle.h where it belongs.
Jakob Stoklund Olesen [Wed, 29 Feb 2012 00:33:41 +0000 (00:33 +0000)]
Move the operand iterator into MachineInstrBundle.h where it belongs.

Extract a base class and provide four specific sub-classes for iterating
over const/non-const bundles/instructions.

This eliminates the mystery bool constructor argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151684 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSupport/PathV2: Fix make_absolute() to match is_absolute() and not expect to
Daniel Dunbar [Wed, 29 Feb 2012 00:20:37 +0000 (00:20 +0000)]
Support/PathV2: Fix make_absolute() to match is_absolute() and not expect to
find root names on Unix.
 - This fixes make_absolute to not basically always call current_path() on
   Unix systems.
 - I think the API probably needs cleanup in this area, but I'll let Michael
   handle that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151681 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix some stray semi-colons.
Daniel Dunbar [Wed, 29 Feb 2012 00:20:33 +0000 (00:20 +0000)]
Fix some stray semi-colons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151680 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix PR12080 by ensuring that MaterializeModule actually reads all the bitcode
Derek Schuff [Wed, 29 Feb 2012 00:07:09 +0000 (00:07 +0000)]
Fix PR12080 by ensuring that MaterializeModule actually reads all the bitcode
in the streaming case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151676 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PathV2] Fix bug in relative_path.
Michael J. Spencer [Wed, 29 Feb 2012 00:06:24 +0000 (00:06 +0000)]
[PathV2] Fix bug in relative_path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151675 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM implement TargetInstrInfo::getNoopForMachoTarget()
Jim Grosbach [Tue, 28 Feb 2012 23:53:30 +0000 (23:53 +0000)]
ARM implement TargetInstrInfo::getNoopForMachoTarget()

Without this hook, functions w/ a completely empty body (including no
epilogue) will cause an MCEmitter assertion failure.

For example,
define internal fastcc void @empty_function() {
  unreachable
}

rdar://10947471

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151673 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoInstructions inside a bundle have the same number as the bundle itself.
Jakob Stoklund Olesen [Tue, 28 Feb 2012 23:52:31 +0000 (23:52 +0000)]
Instructions inside a bundle have the same number as the bundle itself.

SlotIndexes are not assigned to instructions inside bundles, but it is
still valid to look up the index of those instructions.

The reverse getInstructionFromIndex() will return the first instruction
in the bundle.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151672 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), and...
David Meyer [Tue, 28 Feb 2012 23:47:53 +0000 (23:47 +0000)]
In the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), and isWeak(), with a bitset of flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151670 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEnable -Wcovered-switch-default again, but add -Werror to the checks to make
Rafael Espindola [Tue, 28 Feb 2012 23:32:06 +0000 (23:32 +0000)]
Enable -Wcovered-switch-default again, but add -Werror to the checks to make
sure we don't use it with compilers that don't support it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151665 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoKill off LiveRangeEdit::getNewVRegs and LiveRangeEdit::getUselessVRegs. These
Lang Hames [Tue, 28 Feb 2012 22:07:24 +0000 (22:07 +0000)]
Kill off LiveRangeEdit::getNewVRegs and LiveRangeEdit::getUselessVRegs. These
methods are no longer needed now that LinearScan has gone away.

(Contains tweaks trivialSpillEverywhere to enable the removal of getNewVRegs).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151658 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoOn ELF, create relocations to the abbreviation and line sections when producing
Rafael Espindola [Tue, 28 Feb 2012 21:13:05 +0000 (21:13 +0000)]
On ELF, create relocations to the abbreviation and line sections when producing
debug info for assembly files. We were already doing the right thing when
producing debug info for C/C++.

ELF linkers don't know dwarf, so they depend on these relocations to produce
valid dwarf output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151655 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTemporarily revert r151609, which enabled a new warning for LLVM and
Chandler Carruth [Tue, 28 Feb 2012 19:26:56 +0000 (19:26 +0000)]
Temporarily revert r151609, which enabled a new warning for LLVM and
Clang builds. The detection logic for compilers that support the warning
isn't working. Rafael is going to investigate it, but didn't want people
to have to wade through build spam until then.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151649 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM vbit/vbif/vbsl assembly optional size suffix.
Jim Grosbach [Tue, 28 Feb 2012 19:11:07 +0000 (19:11 +0000)]
ARM vbit/vbif/vbsl assembly optional size suffix.

These instructions accept but do not require a size suffix.

rdar://10947225

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151646 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRe-commit r151623 with fix. Only issue special no-return calls if it's a direct call.
Evan Cheng [Tue, 28 Feb 2012 18:51:51 +0000 (18:51 +0000)]
Re-commit r151623 with fix. Only issue special no-return calls if it's a direct call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151645 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix off-by one in comment.
Benjamin Kramer [Tue, 28 Feb 2012 18:37:06 +0000 (18:37 +0000)]
Fix off-by one in comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151644 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoProperly MCize the section switch, removing a FIXME.
Roman Divacky [Tue, 28 Feb 2012 18:15:25 +0000 (18:15 +0000)]
Properly MCize the section switch, removing a FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151639 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoLegalizeIntegerTypes: Reenable the large shift with small amount optimization.
Benjamin Kramer [Tue, 28 Feb 2012 17:58:00 +0000 (17:58 +0000)]
LegalizeIntegerTypes: Reenable the large shift with small amount optimization.

To avoid problems with zero shifts when getting the bits that move between words
we use a trick: first shift the by amount-1, then do another shift by one. When
amount is 0 (and size 32) we first shift by 31, then by one, instead of by 32.

Also fix a latent bug that emitted the low and high words in the wrong order
when shifting right.

Fixes PR12113.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151637 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r151623 "Some ARM implementaions, e.g. A-series, does return stack prediction...
Daniel Dunbar [Tue, 28 Feb 2012 15:36:07 +0000 (15:36 +0000)]
Revert r151623 "Some ARM implementaions, e.g. A-series, does return stack prediction. ...", it is breaking the Clang build during the Compiler-RT part.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151630 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove stray semi-colon.
Daniel Dunbar [Tue, 28 Feb 2012 15:35:52 +0000 (15:35 +0000)]
Remove stray semi-colon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151629 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCode cleanup following CR by Duncan.
Nadav Rotem [Tue, 28 Feb 2012 14:13:19 +0000 (14:13 +0000)]
Code cleanup following CR by Duncan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151627 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a bug in the code that builds SDNodes from vector GEPs.
Nadav Rotem [Tue, 28 Feb 2012 11:54:05 +0000 (11:54 +0000)]
Fix a bug in the code that builds SDNodes from vector GEPs.

When the GEP index is a vector of pointers, the code that calculated the size
of the element started from the vector type, and not the contained pointer type.
As a result, instead of looking at the data element pointed by the vector, this
code used the size of the vector. This works for 32bit members (on 32bit
systems), but not for other types. Added code to peel the vector type and
added a test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151626 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoremove blanks, and some code format
Jia Liu [Tue, 28 Feb 2012 07:46:26 +0000 (07:46 +0000)]
remove blanks, and some code format

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151625 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSome ARM implementaions, e.g. A-series, does return stack prediction. That is,
Evan Cheng [Tue, 28 Feb 2012 06:42:03 +0000 (06:42 +0000)]
Some ARM implementaions, e.g. A-series, does return stack prediction. That is,
the processor keeps a return addresses stack (RAS) which stores the address
and the instruction execution state of the instruction after a function-call
type branch instruction.

Calling a "noreturn" function with normal call instructions (e.g. bl) can
corrupt RAS and causes 100% return misprediction so LLVM should use a
unconditional branch instead. i.e.
mov lr, pc
b _foo
The "mov lr, pc" is issued in order to get proper backtrace.

rdar://8979299

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151623 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoConvert generated intrinsic attributes to use an array lookup as Chris suggested...
Craig Topper [Tue, 28 Feb 2012 06:32:00 +0000 (06:32 +0000)]
Convert generated intrinsic attributes to use an array lookup as Chris suggested in PR11951.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151622 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReverted r152620 - DSE: Shorten memset when a later store overwrites the start of...
Pete Cooper [Tue, 28 Feb 2012 05:06:24 +0000 (05:06 +0000)]
Reverted r152620 - DSE: Shorten memset when a later store overwrites the start of it.  There were all sorts of buildbot issues

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151621 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDSE: Shorten memset when a later store overwrites the start of it
Pete Cooper [Tue, 28 Feb 2012 04:27:10 +0000 (04:27 +0000)]
DSE: Shorten memset when a later store overwrites the start of it

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151620 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoOops...Don't commit the other stuff..
Bill Wendling [Tue, 28 Feb 2012 04:01:21 +0000 (04:01 +0000)]
Oops...Don't commit the other stuff..

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151618 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoModify comment to reflect the importance of this code.
Bill Wendling [Tue, 28 Feb 2012 03:47:09 +0000 (03:47 +0000)]
Modify comment to reflect the importance of this code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151617 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd comments.
Akira Hatanaka [Tue, 28 Feb 2012 03:18:43 +0000 (03:18 +0000)]
Add comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151615 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDo not reserve $gp as a dedicated global base register if the target ABI is not O32.
Akira Hatanaka [Tue, 28 Feb 2012 03:17:38 +0000 (03:17 +0000)]
Do not reserve $gp as a dedicated global base register if the target ABI is not O32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151614 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoStrip extraneous information, if present, from the linker version string on
Charles Davis [Tue, 28 Feb 2012 02:55:41 +0000 (02:55 +0000)]
Strip extraneous information, if present, from the linker version string on
Mac OS X. Patch by Fabian Groffen, with a slight tweak by me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151612 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd support for floating point base register + offset register addressing mode
Akira Hatanaka [Tue, 28 Feb 2012 02:55:02 +0000 (02:55 +0000)]
Add support for floating point base register + offset register addressing mode
load and store instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151611 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoHandle regmasks in MachineCSE.
Jakob Stoklund Olesen [Tue, 28 Feb 2012 02:08:50 +0000 (02:08 +0000)]
Handle regmasks in MachineCSE.

Don't attempt to extend physreg live ranges across calls.

<rdar://problem/10942095>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151610 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEnable -Wcovered-switch-default as it matches the switch style used in llvm.
Rafael Espindola [Tue, 28 Feb 2012 02:01:55 +0000 (02:01 +0000)]
Enable -Wcovered-switch-default as it matches the switch style used in llvm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151609 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoHandle regmasks in the machine code verifier.
Jakob Stoklund Olesen [Tue, 28 Feb 2012 01:42:41 +0000 (01:42 +0000)]
Handle regmasks in the machine code verifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151607 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEnable ARM base pointer when calling functions with large arguments.
Jakob Stoklund Olesen [Tue, 28 Feb 2012 01:15:01 +0000 (01:15 +0000)]
Enable ARM base pointer when calling functions with large arguments.

When an outgoing call takes more than 2k of arguments on the stack, we
don't allocate that call frame in the prolog, but adjust the stack
pointer immediately before the call instead.

This causes problems with the emergency spill slot because PEI can't
track stack pointer adjustments on the second pass, and if the outgoing
arguments are too big, SP can't be used to reach the emergency spill
slot at all.

Work around these problems by ensuring there is a base or frame pointer
that can be used to access the emergency spill slot.

<rdar://problem/10917166>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151604 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[Object] Add {begin,end}_dynamic_symbols stubs and implementation for ELF.
Michael J. Spencer [Tue, 28 Feb 2012 00:40:37 +0000 (00:40 +0000)]
[Object] Add {begin,end}_dynamic_symbols stubs and implementation for ELF.
Add -D option to llvm-nm to dump dynamic symbols.

Patch by David Meyer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151600 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix 80-column violation.
Chad Rosier [Tue, 28 Feb 2012 00:23:01 +0000 (00:23 +0000)]
Fix 80-column violation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151599 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAllow llvm-stress to optionally generate the other floating-point types (half, ppcf12...
Hal Finkel [Mon, 27 Feb 2012 23:59:33 +0000 (23:59 +0000)]
Allow llvm-stress to optionally generate the other floating-point types (half, ppcf128, mmx, etc.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151596 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd back removed code. It still causes LLVM to miscompile. But not having it breaks...
Bill Wendling [Mon, 27 Feb 2012 23:48:30 +0000 (23:48 +0000)]
Add back removed code. It still causes LLVM to miscompile. But not having it breaks other things.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151594 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThis patch adds instruction latencies for the SSE instructions
Preston Gurd [Mon, 27 Feb 2012 23:35:03 +0000 (23:35 +0000)]
This patch adds instruction latencies for the SSE instructions
to the instruction scheduler for the Intel Atom.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151590 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agotest commit.
Preston Gurd [Mon, 27 Feb 2012 23:31:51 +0000 (23:31 +0000)]
test commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151588 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDuncan pointed out that if the alignment isn't explicitly specified, it defaults...
Eli Friedman [Mon, 27 Feb 2012 23:16:46 +0000 (23:16 +0000)]
Duncan pointed out that if the alignment isn't explicitly specified, it defaults to the ABI alignment.  Given that, make this code a bit more aggressive in such cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151584 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDelete incorrect reference to inexistent Hexagon architecture manuals.
Evandro Menezes [Mon, 27 Feb 2012 23:00:52 +0000 (23:00 +0000)]
Delete incorrect reference to inexistent Hexagon architecture manuals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151582 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't use #if 0. Just remove until I can address this.
Bill Wendling [Mon, 27 Feb 2012 22:55:40 +0000 (22:55 +0000)]
Don't use #if 0. Just remove until I can address this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151580 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoXFAIL test until <rdar://problem/10913281> is fixed.
Bill Wendling [Mon, 27 Feb 2012 22:53:42 +0000 (22:53 +0000)]
XFAIL test until <rdar://problem/10913281> is fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151578 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThe code that cleans up multiple, isomorphic types has a subtle error that
Bill Wendling [Mon, 27 Feb 2012 22:34:19 +0000 (22:34 +0000)]
The code that cleans up multiple, isomorphic types has a subtle error that
manifests itself when building LLVM with LTO.
<rdar://problem/10913281>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151576 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove duplicate copy of Object/ELF.h that somehow managed to get in.
Michael J. Spencer [Mon, 27 Feb 2012 22:06:44 +0000 (22:06 +0000)]
Remove duplicate copy of Object/ELF.h that somehow managed to get in.

Patch by David Meyer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151575 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix for PR12090: clear def maps of aliases when visiting a copy. e.g.
Evan Cheng [Mon, 27 Feb 2012 21:46:42 +0000 (21:46 +0000)]
Fix for PR12090: clear def maps of aliases when visiting a copy. e.g.
%S5<def> = COPY %S0<kill>
First clear def map of Q1, etc.

No small test case available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151574 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM BL/BLX instruction fixups should use relocations.
Jim Grosbach [Mon, 27 Feb 2012 21:36:23 +0000 (21:36 +0000)]
ARM BL/BLX instruction fixups should use relocations.

We on the linker to resolve calls to the appropriate BL/BLX instruction
to make interworking function correctly. It uses the symbol in the
relocation to do that, so we need to be careful about being too clever.

To enable this for ARM mode, split the BL/BLX fixup kind off from the
unconditional-branch fixups.

rdar://10927209

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151571 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"
Argyrios Kyrtzidis [Mon, 27 Feb 2012 21:08:33 +0000 (21:08 +0000)]
Move "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"
to make it more widely available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151564 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTeach BasicAA about the LLVM IR rules that allow reading past the end of an object...
Eli Friedman [Mon, 27 Feb 2012 20:46:07 +0000 (20:46 +0000)]
Teach BasicAA about the LLVM IR rules that allow reading past the end of an object given sufficient alignment.  Fixes PR12098.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151553 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTest the section specification.
Roman Divacky [Mon, 27 Feb 2012 20:42:19 +0000 (20:42 +0000)]
Test the section specification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151552 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix PR12089
Derek Schuff [Mon, 27 Feb 2012 20:31:47 +0000 (20:31 +0000)]
Fix PR12089
http://llvm.org/bugs/show_bug.cgi?id=12089

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151550 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReapply r151278 with fixes.
Roman Divacky [Mon, 27 Feb 2012 20:20:47 +0000 (20:20 +0000)]
Reapply r151278 with fixes.

MCize function entry label emission on PowerPC64 properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151547 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd q suffix aliases for the fistp and fisttp mnemonics.
Chad Rosier [Mon, 27 Feb 2012 19:43:12 +0000 (19:43 +0000)]
Add q suffix aliases for the fistp and fisttp mnemonics.
rdar://10921670
PR11935

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151543 91177308-0d34-0410-b5e6-96231b3b80d8