oota-llvm.git
10 years agoUse error_code in Module::materializeAll.
Rafael Espindola [Tue, 14 Jan 2014 23:02:01 +0000 (23:02 +0000)]
Use error_code in Module::materializeAll.

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

10 years agoFix Remote MCJIT on Windows
Renato Golin [Tue, 14 Jan 2014 22:59:11 +0000 (22:59 +0000)]
Fix Remote MCJIT on Windows

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

10 years agoAdd testcase for r199263 forgotten in commit.
Eric Christopher [Tue, 14 Jan 2014 22:57:52 +0000 (22:57 +0000)]
Add testcase for r199263 forgotten in commit.

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

10 years agoARM: correctly determine final tBX_LR in Thumb1 functions
Tim Northover [Tue, 14 Jan 2014 22:53:28 +0000 (22:53 +0000)]
ARM: correctly determine final tBX_LR in Thumb1 functions

The changes caused by folding an sp-adjustment into a "pop" previously
disrupted the forward search for the final real instruction in a
terminating block. This switches to a backward search (skipping debug
instrs).

This fixes PR18399.

Patch by Zhaoshi.

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

10 years agoAArch64: don't try to handle [SU]MUL_LOHI nodes
Tim Northover [Tue, 14 Jan 2014 22:53:22 +0000 (22:53 +0000)]
AArch64: don't try to handle [SU]MUL_LOHI nodes

We should set them to expand for now since there are no patterns
dealing with them. Actually, there are no instructions either so I
doubt they'll ever be acceptable.

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

10 years agoAdd the lld root to llvm-lit, so llvm-lit can be used
Joey Gouly [Tue, 14 Jan 2014 22:52:24 +0000 (22:52 +0000)]
Add the lld root to llvm-lit, so llvm-lit can be used
to run lld tests individually.

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

10 years agoEnable use of ranges for translation units in the presence of
Eric Christopher [Tue, 14 Jan 2014 22:44:17 +0000 (22:44 +0000)]
Enable use of ranges for translation units in the presence of
-ffunction-sections and update comments and TODOs about other
places that we should enable this.

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

10 years agoRe-enable remote MCJIT tests on ARMv7
Renato Golin [Tue, 14 Jan 2014 22:43:49 +0000 (22:43 +0000)]
Re-enable remote MCJIT tests on ARMv7

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

10 years agoSanitize MCJIT remote execution
Renato Golin [Tue, 14 Jan 2014 22:43:43 +0000 (22:43 +0000)]
Sanitize MCJIT remote execution

MCJIT remote execution (ChildTarget+RemoteTargetExternal) protocol was in
dire need of refactoring. It was fail-prone, had no error reporting and
implemented the same message logic on every single function.

This patch rectifies it, and makes it work on ARM, where it was randomly
failing. Other architectures shall profit from this change as well, making
their buildbots and releases more reliable.

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

10 years agoDo pointer cast simplifications on addrspacecast
Matt Arsenault [Tue, 14 Jan 2014 20:00:45 +0000 (20:00 +0000)]
Do pointer cast simplifications on addrspacecast

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

10 years agoRemove a check for an illegal condition.
Matt Arsenault [Tue, 14 Jan 2014 19:56:57 +0000 (19:56 +0000)]
Remove a check for an illegal condition.

Bitcasts can't be between address spaces anymore.

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

10 years agoAdd FPExt option to CCValAssign::LocInfo. When generating calling-convention
Lang Hames [Tue, 14 Jan 2014 19:56:36 +0000 (19:56 +0000)]
Add FPExt option to CCValAssign::LocInfo. When generating calling-convention
promotion code, Tablegen will now select FPExt for floating point promotions
(previously it had returned AExt, which is not valid for floating point types).

Any out-of-tree targets that were relying on AExt being returned for FP
promotions will need to update their code check for FPExt instead.

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

10 years agoRevert "[AArch64] Added vselect patterns with float and double types"
Rafael Espindola [Tue, 14 Jan 2014 19:24:08 +0000 (19:24 +0000)]
Revert "[AArch64] Added vselect patterns with float and double types"

This reverts commit r199242.

It is causing CodeGen/AArch64/neon-bsl.ll to fail.

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

10 years agoMake nocapture analysis work with addrspacecast
Matt Arsenault [Tue, 14 Jan 2014 19:11:52 +0000 (19:11 +0000)]
Make nocapture analysis work with addrspacecast

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

10 years agoFix a low hanging use of hasRawTextSupport.
Rafael Espindola [Tue, 14 Jan 2014 18:57:12 +0000 (18:57 +0000)]
Fix a low hanging use of hasRawTextSupport.

This also fixes the placement of the function label comment. It was being
placed next to the mips16 directive instead of next to the label.

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

10 years agoReapply "LTO: add API to set strategy for -internalize"
Duncan P. N. Exon Smith [Tue, 14 Jan 2014 18:52:17 +0000 (18:52 +0000)]
Reapply "LTO: add API to set strategy for -internalize"

Reapply r199191, reverted in r199197 because it carelessly broke
Other/link-opts.ll.  The problem was that calling
createInternalizePass("main") would select
createInternalizePass(bool("main")) instead of
createInternalizePass(ArrayRef<const char *>("main")).  This commit
fixes the bug.

The original commit message follows.

Add API to LTOCodeGenerator to specify a strategy for the -internalize
pass.

This is a new attempt at Bill's change in r185882, which he reverted in
r188029 due to problems with the gold linker.  This puts the onus on the
linker to decide whether (and what) to internalize.

In particular, running internalize before outputting an object file may
change a 'weak' symbol into an internal one, even though that symbol
could be needed by an external object file --- e.g., with arclite.

This patch enables three strategies:

- LTO_INTERNALIZE_FULL: the default (and the old behaviour).
- LTO_INTERNALIZE_NONE: skip -internalize.
- LTO_INTERNALIZE_HIDDEN: only -internalize symbols with hidden
  visibility.

LTO_INTERNALIZE_FULL should be used when linking an executable.

Outputting an object file (e.g., via ld -r) is more complicated, and
depends on whether hidden symbols should be internalized.  E.g., for
ld -r, LTO_INTERNALIZE_NONE can be used when -keep_private_externs, and
LTO_INTERNALIZE_HIDDEN can be used otherwise.  However,
LTO_INTERNALIZE_FULL is inappropriate, since the output object file will
eventually need to link with others.

lto_codegen_set_internalize_strategy() sets the strategy for subsequent
calls to lto_codegen_write_merged_modules() and lto_codegen_compile*().

<rdar://problem/14334895>

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

10 years ago[AArch64] Added vselect patterns with float and double types
Ana Pazos [Tue, 14 Jan 2014 18:45:48 +0000 (18:45 +0000)]
[AArch64] Added vselect patterns with float and double types

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

10 years agoHandle UIDs and GIDs that don't fit in 6 decimal places.
Rafael Espindola [Tue, 14 Jan 2014 17:02:09 +0000 (17:02 +0000)]
Handle UIDs and GIDs that don't fit in 6 decimal places.

Newer unix systems have 32 bit uid and gid types, but the archive format was
not updated. Fortunately, these fields are not normally used. Just truncate
the data to fit in 6 chars.

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

10 years agoTest case micromips-load-effective-address.s renamed to micromips-load-effective...
Zoran Jovanovic [Tue, 14 Jan 2014 16:26:47 +0000 (16:26 +0000)]
Test case micromips-load-effective-address.s renamed to micromips-load-effective-address.ll and moved to test/CodeGen/Mips.

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

10 years agoHandle dllexport for global aliases
Nico Rieck [Tue, 14 Jan 2014 15:23:25 +0000 (15:23 +0000)]
Handle dllexport for global aliases

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

10 years agoDecouple dllexport/dllimport from linkage
Nico Rieck [Tue, 14 Jan 2014 15:22:47 +0000 (15:22 +0000)]
Decouple dllexport/dllimport from linkage

Representing dllexport/dllimport as distinct linkage types prevents using
these attributes on templates and inline functions.

Instead of introducing further mixed linkage types to include linkonce and
weak ODR, the old import/export linkage types are replaced with a new
separate visibility-like specifier:

  define available_externally dllimport void @f() {}
  @Var = dllexport global i32 1, align 4

Linkage for dllexported globals and functions is now equal to their linkage
without dllexport. Imported globals and functions must be either
declarations with external linkage, or definitions with
AvailableExternallyLinkage.

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

10 years agoAVX-512: optimized scalar compare patterns
Elena Demikhovsky [Tue, 14 Jan 2014 15:10:08 +0000 (15:10 +0000)]
AVX-512: optimized scalar compare patterns
removed AVX512SI format, since it is similar to AVX512BI.

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

10 years agoFix valgrind warning for gcc builds.
Patrik Hagglund [Tue, 14 Jan 2014 14:09:00 +0000 (14:09 +0000)]
Fix valgrind warning for gcc builds.

Sorry, I don't understand why the warning is generated (a gcc
bug?). Anyhow, the change should improve readablity. No functionality
change intended.

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

10 years ago[X86] Fix assertion failure caused by a wrong folding of vector shifts by immediate...
Andrea Di Biagio [Tue, 14 Jan 2014 13:17:12 +0000 (13:17 +0000)]
[X86] Fix assertion failure caused by a wrong folding of vector shifts by immediate count.

This fixes a regression intruced by r198113.

Revision r198113 introduced an algorithm that tries to fold a vector shift
by immediate count into a build_vector if the input vector is a known vector
of constants.

However the algorithm only worked under the assumption that the input vector
type and the shift type are exactly the same.

This patch disables the folding of vector shift by immediate count if the
input vector type and the shift value type are not the same.

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

10 years agoARM: add constraint that RdLo != Rn != RdHi for v5 MLA insts.
Tim Northover [Tue, 14 Jan 2014 13:05:47 +0000 (13:05 +0000)]
ARM: add constraint that RdLo != Rn != RdHi for v5 MLA insts.

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

10 years agoARM: remove unused UMAALv5 node
Tim Northover [Tue, 14 Jan 2014 13:05:42 +0000 (13:05 +0000)]
ARM: remove unused UMAALv5 node

It was incorrect anyway, since it didn't have accumulator inputs and wasn't
even supported on v5.

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

10 years agoRevert "Decouple dllexport/dllimport from linkage"
Nico Rieck [Tue, 14 Jan 2014 12:38:32 +0000 (12:38 +0000)]
Revert "Decouple dllexport/dllimport from linkage"

Revert this for now until I fix an issue in Clang with it.

This reverts commit r199204.

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

10 years agoRevert "Handle dllexport for global aliases"
Nico Rieck [Tue, 14 Jan 2014 12:36:54 +0000 (12:36 +0000)]
Revert "Handle dllexport for global aliases"

This reverts commit r199205.

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

10 years agoHandle dllexport for global aliases
Nico Rieck [Tue, 14 Jan 2014 11:55:40 +0000 (11:55 +0000)]
Handle dllexport for global aliases

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

10 years agoDecouple dllexport/dllimport from linkage
Nico Rieck [Tue, 14 Jan 2014 11:55:03 +0000 (11:55 +0000)]
Decouple dllexport/dllimport from linkage

Representing dllexport/dllimport as distinct linkage types prevents using
these attributes on templates and inline functions.

Instead of introducing further mixed linkage types to include linkonce and
weak ODR, the old import/export linkage types are replaced with a new
separate visibility-like specifier:

  define available_externally dllimport void @f() {}
  @Var = dllexport global i32 1, align 4

Linkage for dllexported globals and functions is now equal to their linkage
without dllexport. Imported globals and functions must be either
declarations with external linkage, or definitions with
AvailableExternallyLinkage.

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

10 years agoFix fastcall mangling of dllimported symbols
Nico Rieck [Tue, 14 Jan 2014 11:53:26 +0000 (11:53 +0000)]
Fix fastcall mangling of dllimported symbols

fastcall requires @ as global prefix instead of _ but getNameWithPrefix
wrongly assumes the OutName buffer is empty and replaces at index 0.
For imported functions this buffer is pre-filled with "__imp_" resulting
in broken "@_imp_foo@0" mangling.

Instead replace at the proper index. We also never have to prepend the
@-prefix because this fastcall mangling is only used on 32-bit Windows
targets which have _ has global prefix.

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

10 years agoRevert r199191, "LTO: add API to set strategy for -internalize"
NAKAMURA Takumi [Tue, 14 Jan 2014 09:40:18 +0000 (09:40 +0000)]
Revert r199191, "LTO: add API to set strategy for -internalize"

Please update also Other/link-opts.ll, in next time.

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

10 years agoRemove stray comma in enum to satisfy -Wpedantic.
Craig Topper [Tue, 14 Jan 2014 08:07:10 +0000 (08:07 +0000)]
Remove stray comma in enum to satisfy -Wpedantic.

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

10 years agoSeparate the concept of 16-bit/32-bit operand size controlled by 0x66 prefix and...
Craig Topper [Tue, 14 Jan 2014 07:41:20 +0000 (07:41 +0000)]
Separate the concept of 16-bit/32-bit operand size controlled by 0x66 prefix and the current mode from the concept of SSE instructions using 0x66 prefix as part of their encoding without being affected by the mode.

This should allow SSE instructions to be encoded correctly in 16-bit mode which r198586 probably broke.

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

10 years agoLTO: add API to set strategy for -internalize
Duncan P. N. Exon Smith [Tue, 14 Jan 2014 06:37:26 +0000 (06:37 +0000)]
LTO: add API to set strategy for -internalize

Add API to LTOCodeGenerator to specify a strategy for the -internalize
pass.

This is a new attempt at Bill's change in r185882, which he reverted in
r188029 due to problems with the gold linker.  This puts the onus on the
linker to decide whether (and what) to internalize.

In particular, running internalize before outputting an object file may
change a 'weak' symbol into an internal one, even though that symbol
could be needed by an external object file --- e.g., with arclite.

This patch enables three strategies:

- LTO_INTERNALIZE_FULL: the default (and the old behaviour).
- LTO_INTERNALIZE_NONE: skip -internalize.
- LTO_INTERNALIZE_HIDDEN: only -internalize symbols with hidden
  visibility.

LTO_INTERNALIZE_FULL should be used when linking an executable.

Outputting an object file (e.g., via ld -r) is more complicated, and
depends on whether hidden symbols should be internalized.  E.g., for
ld -r, LTO_INTERNALIZE_NONE can be used when -keep_private_externs, and
LTO_INTERNALIZE_HIDDEN can be used otherwise.  However,
LTO_INTERNALIZE_FULL is inappropriate, since the output object file will
eventually need to link with others.

lto_codegen_set_internalize_strategy() sets the strategy for subsequent
calls to lto_codegen_write_merged_modules() and lto_codegen_compile*().

<rdar://problem/14334895>

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

10 years agoAlways let value types influence register classes.
Jakob Stoklund Olesen [Tue, 14 Jan 2014 06:18:38 +0000 (06:18 +0000)]
Always let value types influence register classes.

When creating a virtual register for a def, the value type should be
used to pick the register class. If we only use the register class
constraint on the instruction, we might pick a too large register class.

Some registers can store values of different sizes. For example, the x86
xmm registers can hold f32, f64, and 128-bit vectors. The three
different value sizes are represented by register classes with identical
register sets: FR32, FR64, and VR128. These register classes have
different spill slot sizes, so it is important to use the right one.

The register class constraint on an instruction doesn't necessarily care
about the size of the value its defining. The value type determines
that.

This fixes a problem where InstrEmitter was picking 32-bit register
classes for 64-bit values on SPARC.

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

10 years agoSwitch the NEON register class from QPR to DPair.
Jakob Stoklund Olesen [Tue, 14 Jan 2014 06:18:34 +0000 (06:18 +0000)]
Switch the NEON register class from QPR to DPair.

The already allocatable DPair superclass contains odd-even D register
pair in addition to the even-odd pairs in the QPR register class. There
is no reason to constrain the set of D register pairs that can be used
for NEON values. Any NEON instructions that require a Q register will
automatically constrain the register class to QPR.

The allocation order for DPair begins with the QPR registers, so
register allocation is unlikely to change much.

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

10 years ago[PM] Fix stale header blocker, found by Duncan Smith in code review!
Chandler Carruth [Tue, 14 Jan 2014 05:50:19 +0000 (05:50 +0000)]
[PM] Fix stale header blocker, found by Duncan Smith in code review!

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

10 years agoRemove the last weird subproject, 'privbracket'.
Chandler Carruth [Tue, 14 Jan 2014 05:05:18 +0000 (05:05 +0000)]
Remove the last weird subproject, 'privbracket'.

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

10 years agoAdd checks to configure for sufficiently modern host compilers. This
Chandler Carruth [Tue, 14 Jan 2014 05:02:38 +0000 (05:02 +0000)]
Add checks to configure for sufficiently modern host compilers. This
requires Clang 3.1 or GCC 4.7. If the compiler isn't Clang or GCC, we
don't try to do any sanity checking, but this give us at least
a reasonable baseline of modern compilers.

Also, I'm not claiming that this is the best way to do compiler version
tests. I'm happy for anyone to suggest better ways of doing this test.

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

10 years agoReplace .mips_hack_stocg with ".set micromips" and ".set nomicromips".
Rafael Espindola [Tue, 14 Jan 2014 04:25:13 +0000 (04:25 +0000)]
Replace .mips_hack_stocg with ".set micromips" and ".set nomicromips".

This matches what gnu as does and implementing this is easier than arguing
about it.

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

10 years agoFix llc to not reuse spill slots in functions that invoke setjmp()
Mark Seaborn [Tue, 14 Jan 2014 04:20:01 +0000 (04:20 +0000)]
Fix llc to not reuse spill slots in functions that invoke setjmp()

We need to ensure that StackSlotColoring.cpp does not reuse stack
spill slots in functions that call "returns_twice" functions such as
setjmp(), otherwise this can lead to miscompiled code, because a stack
slot would be clobbered when it's still live.

This was already handled correctly for functions that call setjmp()
(though this wasn't covered by a test), but not for functions that
invoke setjmp().

We fix this by changing callsFunctionThatReturnsTwice() to check for
invoke instructions.

This fixes PR18244.

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

10 years agoOk, really, for the last time, llvm-gcc is dead Jim.
Chandler Carruth [Tue, 14 Jan 2014 04:01:01 +0000 (04:01 +0000)]
Ok, really, for the last time, llvm-gcc is dead Jim.

Also, so is stacker, llvm-tv, etc. Wow.

But will someone please fess up to what projects/privbracket is and why
our autoconf build supports it?

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

10 years agollvm-gcc is dead. REALLY. IT'S DEAD JIM.
Chandler Carruth [Tue, 14 Jan 2014 03:46:00 +0000 (03:46 +0000)]
llvm-gcc is dead. REALLY. IT'S DEAD JIM.

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

10 years agoMake getTargetStreamer return a possibly null pointer.
Rafael Espindola [Tue, 14 Jan 2014 01:21:46 +0000 (01:21 +0000)]
Make getTargetStreamer return a possibly null pointer.

This will allow it to be called from target independent parts of the main
streamer that don't know if there is a registered target streamer or not. This
in turn will allow targets to perform extra actions at specified points in the
interface: add extra flags for some labels, extra work during finalization, etc.

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

10 years agoRemove extra } in documentation comment
Duncan P. N. Exon Smith [Mon, 13 Jan 2014 23:11:48 +0000 (23:11 +0000)]
Remove extra } in documentation comment

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

10 years agoClean up RUN command for Assembler/getInt.ll.
Cameron McInally [Mon, 13 Jan 2014 22:37:35 +0000 (22:37 +0000)]
Clean up RUN command for Assembler/getInt.ll.

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

10 years agoFactor the option and checking of compiler version better. Put the
Chandler Carruth [Mon, 13 Jan 2014 22:21:34 +0000 (22:21 +0000)]
Factor the option and checking of compiler version better. Put the
option with the others in the top level CMakeLists, and put the check in
HandleLLVMOptions. This will also let it be used from the standalone
Clang builds.

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

10 years agoRaise the minimum CMake version to 2.8.8 -- we have a report that the
Chandler Carruth [Mon, 13 Jan 2014 22:05:20 +0000 (22:05 +0000)]
Raise the minimum CMake version to 2.8.8 -- we have a report that the
compiler version checking doesn't work on 2.8.7. This feature was
documented in 2.8.10, but existed for an unknown amount of time before
that.

I'm actually happy to revert this and remove the use of the feature if
there is anyone with a specific problem updating CMake. Please just let
me know. I don't want to re-implement this CMake functionality unless
there is a reason, and this is the only real way to find that out.

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

10 years agoFix uninitialized warning in llvm/lib/IR/DataLayout.cpp.
Cameron McInally [Mon, 13 Jan 2014 22:04:55 +0000 (22:04 +0000)]
Fix uninitialized warning in llvm/lib/IR/DataLayout.cpp.

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

10 years ago[DAG] Refactor ReassociateOps - no functional change intended.
Juergen Ributzka [Mon, 13 Jan 2014 21:49:25 +0000 (21:49 +0000)]
[DAG] Refactor ReassociateOps - no functional change intended.

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

10 years agoAdd a check that the host compiler is modern to CMake, take 1. This is
Chandler Carruth [Mon, 13 Jan 2014 21:47:35 +0000 (21:47 +0000)]
Add a check that the host compiler is modern to CMake, take 1. This is
likely to be reverted and re-applied a few times. The minimum versions
we're aiming at:

  GCC 4.7
  Clang 3.1
  MSVC 17.0 (Visual Studio 2012)

Let me know if something breaks!

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

10 years ago[DAG] Teach DAG to also reassociate vector operations
Juergen Ributzka [Mon, 13 Jan 2014 20:51:35 +0000 (20:51 +0000)]
[DAG] Teach DAG to also reassociate vector operations

This commit teaches DAG to reassociate vector ops, which in turn enables
constant folding of vector op chains that appear later on during custom lowering
and DAG combine.

Reviewed by Andrea Di Biagio

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

10 years agoHide the pre-RA-sched= option.
Andrew Trick [Mon, 13 Jan 2014 20:08:27 +0000 (20:08 +0000)]
Hide the pre-RA-sched= option.

This is a very confusing option for a feature that will go away.

-enable-misched is exposed instead to help triage issues with the new
scheduler.

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

10 years agoFix PR 18369: [Thumbv8] asserts due to inconsistent CPSR liveness of IT blocks
Weiming Zhao [Mon, 13 Jan 2014 18:47:54 +0000 (18:47 +0000)]
Fix PR 18369: [Thumbv8] asserts due to inconsistent CPSR liveness of IT blocks

The issue is caused when Post-RA scheduler reorders a bundle instruction
(IT block). However, it only flips the CPSR liveness of the bundle instruction,
leaves the instructions inside the bundle unchanged, which causes inconstancy and crashes
Thumb2SizeReduction.cpp::ReduceMBB().

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

10 years agoUpdate getLazyBitcodeModule to use ErrorOr for error handling.
Rafael Espindola [Mon, 13 Jan 2014 18:31:04 +0000 (18:31 +0000)]
Update getLazyBitcodeModule to use ErrorOr for error handling.

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

10 years ago[AArch64] Fix assertion failure caused by an invalid comparison between APInt values.
Andrea Di Biagio [Mon, 13 Jan 2014 16:51:00 +0000 (16:51 +0000)]
[AArch64] Fix assertion failure caused by an invalid comparison between APInt values.

APInt only knows how to compare values with the same BitWidth and asserts
in all other cases.

With this fix, function PerformORCombine does not use the APInt equality
operator if the APInt values returned by 'isConstantSplat' differ in BitWidth.
In that case they are different and no comparison is needed.

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

10 years agoFix indentation.
Joerg Sonnenberger [Mon, 13 Jan 2014 15:50:36 +0000 (15:50 +0000)]
Fix indentation.

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

10 years ago[SystemZ] Flesh out stackrestore test (frame-11.ll)
Richard Sandiford [Mon, 13 Jan 2014 15:44:44 +0000 (15:44 +0000)]
[SystemZ] Flesh out stackrestore test (frame-11.ll)

...so that it does something vaguely sensible.

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

10 years ago[SystemZ] Add "volatile" to a dead store in variable-loc.ll
Richard Sandiford [Mon, 13 Jan 2014 15:42:16 +0000 (15:42 +0000)]
[SystemZ] Add "volatile" to a dead store in variable-loc.ll

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

10 years ago[SystemZ] Improve risbg-01.ll test
Richard Sandiford [Mon, 13 Jan 2014 15:40:25 +0000 (15:40 +0000)]
[SystemZ] Improve risbg-01.ll test

The old mask in f24 wasn't well chosen because the lshr would always be zero.
CodeGen didn't detect this but InstCombine would.  The new mask ensures
that both shifts are needed.

f26 is specifically testing for a wrap-around mask.  The AND can be applied
to just the shift left, either before or after the shift.  Again, CodeGen
kept it in the original form but InstCombine would mask after the shift
instead.  The exact choice of NILF isn't important for the test so I just
dropped it and kept the rotate.

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

10 years ago[SystemZ] Optimize (sext (ashr (shl ...), ...))
Richard Sandiford [Mon, 13 Jan 2014 15:17:53 +0000 (15:17 +0000)]
[SystemZ] Optimize (sext (ashr (shl ...), ...))

...into (ashr (shl (anyext X), ...), ...), which requires one fewer
instruction.  The (anyext X) can sometimes be simplified too.

I didn't do this in DAGCombiner because widening shifts isn't a win
on all targets.

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

10 years agofix a -Wdocumentation warning.
Chris Lattner [Mon, 13 Jan 2014 15:10:11 +0000 (15:10 +0000)]
fix a -Wdocumentation warning.

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

10 years agoARM: add test for r199108. Oops.
Tim Northover [Mon, 13 Jan 2014 14:20:25 +0000 (14:20 +0000)]
ARM: add test for r199108. Oops.

rdar://problem/15800156

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

10 years agoARM: constrain Thumb LDRLIT pseudo-instructions to r0-r7.
Tim Northover [Mon, 13 Jan 2014 14:19:17 +0000 (14:19 +0000)]
ARM: constrain Thumb LDRLIT pseudo-instructions to r0-r7.

Previously we only used GPR for the destination placeholder in "ldr rD, [pc,
incorrect codegen under the integrated assembler.

This should fix both issues (which probably only affect MachO targets at the
moment).

rdar://problem/15800156

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

10 years ago[x86] Fix retq/retl handling in 64-bit mode
David Woodhouse [Mon, 13 Jan 2014 14:05:59 +0000 (14:05 +0000)]
[x86] Fix retq/retl handling in 64-bit mode

This finishes the job started in r198756, and creates separate opcodes for
64-bit vs. 32-bit versions of the rest of the RET instructions too.

LRETL/LRETQ are interesting... I can't see any justification for their
existence in the SDM. There should be no 'LRETL' in 64-bit mode, and no
need for a REX.W prefix for LRETQ. But this is what GAS does, and my
Sandybridge CPU and an Opteron 6376 concur when tested as follows:

asm __volatile__("pushq $0x1234\nmovq $0x33,%rax\nsalq $32,%rax\norq $1f,%rax\npushq %rax\nlretl $8\n1:");
asm __volatile__("pushq $1234\npushq $0x33\npushq $1f\nlretq $8\n1:");
asm __volatile__("pushq $0x33\npushq $1f\nlretq\n1:");
asm __volatile__("pushq $0x1234\npushq $0x33\npushq $1f\nlretq $8\n1:");

cf. PR8592 and commit r118903, which added LRETQ. I only added LRETIQ to
match it.

I don't quite understand how the Intel syntax parsing for ret
instructions is working, despite r154468 allegedly fixing it. Aren't the
explicitly sized 'retw', 'retd' and 'retq' supposed to work? I have at
least made the 'lretq' work with (and indeed *require*) the 'q'.

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

10 years ago[PM] Split DominatorTree into a concrete analysis result object which
Chandler Carruth [Mon, 13 Jan 2014 13:07:17 +0000 (13:07 +0000)]
[PM] Split DominatorTree into a concrete analysis result object which
can be used by both the new pass manager and the old.

This removes it from any of the virtual mess of the pass interfaces and
lets it derive cleanly from the DominatorTreeBase<> template. In turn,
tons of boilerplate interface can be nuked and it turns into a very
straightforward extension of the base DominatorTree interface.

The old analysis pass is now a simple wrapper. The names and style of
this split should match the split between CallGraph and
CallGraphWrapperPass. All of the users of DominatorTree have been
updated to match using many of the same tricks as with CallGraph. The
goal is that the common type remains the resulting DominatorTree rather
than the pass. This will make subsequent work toward the new pass
manager significantly easier.

Also in numerous places things became cleaner because I switched from
re-running the pass (!!! mid way through some other passes run!!!) to
directly recomputing the domtree.

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

10 years ago[PM][cleanup] Clean up comments and use modern doxygen in this file.
Chandler Carruth [Mon, 13 Jan 2014 13:06:58 +0000 (13:06 +0000)]
[PM][cleanup] Clean up comments and use modern doxygen in this file.
This is a precursor to breaking the pass that computes the DominatorTree
apart from the concrete DominatorTree.

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

10 years agoAVX-512: Embedded Rounding Control - encoding and printing
Elena Demikhovsky [Mon, 13 Jan 2014 12:55:03 +0000 (12:55 +0000)]
AVX-512: Embedded Rounding Control - encoding and printing
Changed intrinsics for vrcp14/vrcp28 vrsqrt14/vrsqrt28 - aligned with GCC.

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

10 years ago[PM] Fix the const-correctness of the generic DominatorTreeBase to
Chandler Carruth [Mon, 13 Jan 2014 11:58:34 +0000 (11:58 +0000)]
[PM] Fix the const-correctness of the generic DominatorTreeBase to
support notionally const queries even though they may trigger DFS
numbering updates.

The updating of DFS numbers and tracking of slow queries do not mutate
the observable state of the domtree. They should be const to
differentiate them from the APIs which mutate the tree directly to do
incremental updates.

This will make it possible in a world where the DominatorTree is not
a pass but merely the result of running a pass to derive DominatorTree
from the base class as it was originally designed, removing a huge
duplication of API in DominatorTree.

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

10 years ago[PM] Pull the generic graph algorithms and data structures for dominator
Chandler Carruth [Mon, 13 Jan 2014 10:52:56 +0000 (10:52 +0000)]
[PM] Pull the generic graph algorithms and data structures for dominator
trees into the Support library.

These are all expressed in terms of the generic GraphTraits and CFG,
with no reliance on any concrete IR types. Putting them in support
clarifies that and makes the fact that the static analyzer in Clang uses
them much more sane. When moving the Dominators.h file into the IR
library I claimed that this was the right home for it but not something
I planned to work on. Oops.

So why am I doing this? It happens to be one step toward breaking the
requirement that IR verification can only be performed from inside of
a pass context, which completely blocks the implementation of
verification for the new pass manager infrastructure. Fixing it will
also allow removing the concept of the "preverify" step (WTF???) and
allow the verifier to cleanly flag functions which fail verification in
a way that precludes even computing dominance information. Currently,
that results in a fatal error even when you ask the verifier to not
fatally error. It's awesome like that.

The yak shaving will continue...

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

10 years agoRevert "ReMat: fix overly cavalier attitude to sub-register indices"
Tim Northover [Mon, 13 Jan 2014 10:49:11 +0000 (10:49 +0000)]
Revert "ReMat: fix overly cavalier attitude to sub-register indices"

Very sorry, this was a premature patch that I still need to investigate and
finish off (for some reason beyond me at the moment it doesn't actually fix the
issue in all cases).

This reverts commit r199091.

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

10 years agoDocs: fix sign of division and increase equivocation on code generated.
Tim Northover [Mon, 13 Jan 2014 10:47:04 +0000 (10:47 +0000)]
Docs: fix sign of division and increase equivocation on code generated.

I should have been a politician.

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

10 years agoReMat: fix overly cavalier attitude to sub-register indices
Tim Northover [Mon, 13 Jan 2014 10:47:01 +0000 (10:47 +0000)]
ReMat: fix overly cavalier attitude to sub-register indices

There are two attempted optimisations in reMaterializeTrivialDef, trying to
avoid promoting the size of a register too much when rematerializing.
Unfortunately, both appear to be flawed. First, we see if the original register
would have worked, but this is inadequate. Consider:

    v1 = SOMETHING (v1 is QQ)
    v2:Q0 = COPY v1:Q1 (v1, v2 are QQ)
    ...
    uses of v2

In this case even though v2 *could* be used directly as the output of
SOMETHING, this would set the wrong bits of the QQ register involved. The
correct rematerialization must be:

    v2:Q0_Q1 = SOMETHING (v2 promoted to QQQ)
    ...
    uses of v2:Q1_Q2

For the second optimisation, if the correct remat is "v2:idx = SOMETHING" then
we can't necessarily expect v2 itself to be valid for SOMETHING, but we do try
to hunt for a class between v1 and v2 that works. Unfortunately, this is also
wrong:

    v1 = SOMETHING (v1 is QQ)
    v2:Q0_Q1 = COPY v1 (v1 is QQ, v2 is QQQ)
    ...
    uses of v2 as a QQQ

The canonical rematerialization here is "v2:Q0_Q1 = SOMETHING". However current
logic would decide that v2 could be a QQ (no interest is taken in later uses).

This patch, therefore, always accepts the widened register class without trying
to be clever. Generally there is no penalty to this (e.g. in the common GR32 <
GR64 case, expanding the width doesn't matter because it's not like you were
going to do anything else with the high bits of a GR32 register). It can
increase register pressure in cases like the ARM VFP regs though (multiple
non-overlapping but equivalent subregisters). Hopefully this situation is rare
enough that it won't matter.

Unfortunately, no in-tree targets actually expose this as far as I can tell
(there are so few isAsCheapAsAMove instructions for it to trigger on) so I've
been unable to produce a test. It was exposed in our ARM64 SPEC tests though,
and I will be adding a test there that we should be able to contribute
soon(TM).

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

10 years ago[cleanup] Re-sort the examples #include lines with my sort_includes
Chandler Carruth [Mon, 13 Jan 2014 09:58:03 +0000 (09:58 +0000)]
[cleanup] Re-sort the examples #include lines with my sort_includes
script.

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

10 years ago[cleanup] Fix the includes in the examples for r199082.
Chandler Carruth [Mon, 13 Jan 2014 09:53:45 +0000 (09:53 +0000)]
[cleanup] Fix the includes in the examples for r199082.

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

10 years ago[cleanup] Switch comments to use '\brief' style instead of '@brief'
Chandler Carruth [Mon, 13 Jan 2014 09:31:09 +0000 (09:31 +0000)]
[cleanup] Switch comments to use '\brief' style instead of '@brief'
style, and remove some unnecessary comments (the code is perfectly
self-documenting here). Also clang-format the function declarations as
they wrap cleanly now.

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

10 years ago[cleanup] Move the Dominators.h and Verifier.h headers into the IR
Chandler Carruth [Mon, 13 Jan 2014 09:26:24 +0000 (09:26 +0000)]
[cleanup] Move the Dominators.h and Verifier.h headers into the IR
directory. These passes are already defined in the IR library, and it
doesn't make any sense to have the headers in Analysis.

Long term, I think there is going to be a much better way to divide
these matters. The dominators code should be fully separated into the
abstract graph algorithm and have that put in Support where it becomes
obvious that evn Clang's CFGBlock's can use it. Then the verifier can
manually construct dominance information from the Support-driven
interface while the Analysis library can provide a pass which both
caches, reconstructs, and supports a nice update API.

But those are very long term, and so I don't want to leave the really
confusing structure until that day arrives.

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

10 years ago[cleanup] Add a missing include exposed by resorting other includes.
Chandler Carruth [Mon, 13 Jan 2014 08:09:47 +0000 (08:09 +0000)]
[cleanup] Add a missing include exposed by resorting other includes.
Should fix the build.

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

10 years agoRe-sort #include lines again, prior to moving headers around.
Chandler Carruth [Mon, 13 Jan 2014 08:04:33 +0000 (08:04 +0000)]
Re-sort #include lines again, prior to moving headers around.

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

10 years ago[PM] Wire up support for writing bitcode with new PM.
Chandler Carruth [Mon, 13 Jan 2014 07:38:24 +0000 (07:38 +0000)]
[PM] Wire up support for writing bitcode with new PM.

This moves the old pass creation functionality to its own header and
updates the callers of that routine. Then it adds a new PM supporting
bitcode writer to the header file, and wires that up in the opt tool.
A test is added that round-trips code into bitcode and back out using
the new pass manager.

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

10 years agollvm/test/ExecutionEngine/MCJIT/load-object-a.ll: Put together rm(1) and mkdir(1...
NAKAMURA Takumi [Mon, 13 Jan 2014 05:55:10 +0000 (05:55 +0000)]
llvm/test/ExecutionEngine/MCJIT/load-object-a.ll: Put together rm(1) and mkdir(1) at the top.

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

10 years ago[CMake] Move BUG_REPORT_URL from clang to llvm.
NAKAMURA Takumi [Mon, 13 Jan 2014 05:25:13 +0000 (05:25 +0000)]
[CMake] Move BUG_REPORT_URL from clang to llvm.

It was too late to set BUG_REPORT_URL after configure_file(config.h).
BUG_REPORT_URL in config.h.cmake would be updated at 2nd run of cmake.
It caused many recompilations.

FYI, configure handles BUG_REPORT_URL in llvm side.

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

10 years ago[PM] Wire up support for printing assembly output from the opt command.
Chandler Carruth [Mon, 13 Jan 2014 05:16:45 +0000 (05:16 +0000)]
[PM] Wire up support for printing assembly output from the opt command.
This lets us round-trip IR in the expected manner with the opt tool.

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

10 years ago[PM] Add an enum for describing the desired output strategy, and run
Chandler Carruth [Mon, 13 Jan 2014 03:08:40 +0000 (03:08 +0000)]
[PM] Add an enum for describing the desired output strategy, and run
that through the interface rather than a simple bool. This should allow
starting to wire up real output to round-trip IR through opt with the
new pass manager.

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

10 years ago[AArch64 NEON] Add missing patterns for bitcast from or to v1f64
Kevin Qin [Mon, 13 Jan 2014 01:58:38 +0000 (01:58 +0000)]
[AArch64 NEON] Add missing patterns for bitcast from or to v1f64

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

10 years ago[AArch64 NEON] Add more scenarios to use perm instructions when lowering shuffle_vector
Kevin Qin [Mon, 13 Jan 2014 01:56:29 +0000 (01:56 +0000)]
[AArch64 NEON] Add more scenarios to use perm instructions when lowering shuffle_vector

This patch covered 2 more scenarios:

1.  Two operands of shuffle_vector are the same, like
%shuffle.i = shufflevector <8 x i8> %a, <8 x i8> %a, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>

2. One of operands is undef, like
%shuffle.i = shufflevector <8 x i8> %a, <8 x i8> undef, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>

After this patch, perm instructions will have chance to be emitted instead of lots of INS.

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

10 years agocorrect target directive handling error handling
Saleem Abdulrasool [Mon, 13 Jan 2014 01:15:39 +0000 (01:15 +0000)]
correct target directive handling error handling

The target specific parser should return `false' if the target AsmParser handles
the directive, and `true' if the generic parser should handle the directive.
Many of the target specific directive handlers would `return Error' which does
not follow these semantics.  This change simply changes the target specific
routines to conform to the semantis of the ParseDirective correctly.

Conformance to the semantics improves diagnostics emitted for the invalid
directives.  X86 is taken as a sample to ensure that multiple diagnostics are
not presented for a single error.

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

10 years agoHandle bundled terminators in isBlockOnlyReachableByFallthrough.
Jakob Stoklund Olesen [Sun, 12 Jan 2014 19:24:08 +0000 (19:24 +0000)]
Handle bundled terminators in isBlockOnlyReachableByFallthrough.

Targets like SPARC and MIPS have delay slots and normally bundle the
delay slot instruction with the corresponding terminator.

Teach isBlockOnlyReachableByFallthrough to find any MBB operands on
bundled terminators so SPARC doesn't need to specialize this function.

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

10 years ago[CMake] Add a comment to tablegen's copy_if_different. Ninja reports every action...
NAKAMURA Takumi [Sun, 12 Jan 2014 17:42:43 +0000 (17:42 +0000)]
[CMake] Add a comment to tablegen's copy_if_different. Ninja reports every action by default.

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

10 years agoraw_fd_ostream: Don't change STDERR to O_BINARY, or w*printf() (in assert()) would...
NAKAMURA Takumi [Sun, 12 Jan 2014 16:14:24 +0000 (16:14 +0000)]
raw_fd_ostream: Don't change STDERR to O_BINARY, or w*printf() (in assert()) would barf wide chars after llvm::errs().

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

10 years agoMake test independent of scheduling
Nico Rieck [Sun, 12 Jan 2014 15:57:38 +0000 (15:57 +0000)]
Make test independent of scheduling

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

10 years agoraw_stream formatter: [Win32] Use std::signbit() if available, instead of _fpclass().
NAKAMURA Takumi [Sun, 12 Jan 2014 14:44:46 +0000 (14:44 +0000)]
raw_stream formatter: [Win32] Use std::signbit() if available, instead of _fpclass().

FIXME: It should be generic to C++11. For now, it is dedicated to mingw-w64.

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

10 years agollvm/test/CodeGen/X86/shl_undef.ll: Tweak to satisfy r199050.
NAKAMURA Takumi [Sun, 12 Jan 2014 14:41:41 +0000 (14:41 +0000)]
llvm/test/CodeGen/X86/shl_undef.ll: Tweak to satisfy r199050.

Use intel syntax, or "shl" might hit "pushl".

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

10 years agoFix non-deterministic SDNodeOrder-dependent codegen
Nico Rieck [Sun, 12 Jan 2014 14:09:17 +0000 (14:09 +0000)]
Fix non-deterministic SDNodeOrder-dependent codegen

Reset SelectionDAGBuilder's SDNodeOrder to ensure deterministic code
generation.

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

10 years ago[PM] Add module and function printing passes for the new pass manager.
Chandler Carruth [Sun, 12 Jan 2014 12:15:39 +0000 (12:15 +0000)]
[PM] Add module and function printing passes for the new pass manager.

This implements the legacy passes in terms of the new ones. It adds
basic testing using explicit runs of the passes. Next up will be wiring
the basic output mechanism of opt up when the new pass manager is
engaged unless bitcode writing is requested.

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

10 years ago[PM] Revert an accidental commit of total BS code. This was halfway
Chandler Carruth [Sun, 12 Jan 2014 11:41:43 +0000 (11:41 +0000)]
[PM] Revert an accidental commit of total BS code. This was halfway
through being editted, and I forgot to delete it before committing.
What's more awesome is that it compiles cleanly!

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

10 years ago[PM] Simplify the IR printing passes significantly now that a narrower
Chandler Carruth [Sun, 12 Jan 2014 11:40:03 +0000 (11:40 +0000)]
[PM] Simplify the IR printing passes significantly now that a narrower
API is exposed.

This removes the support for deleting the ostream, switches the member
and constructor order arround to be consistent with the creation
routines, and switches to using references.

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

10 years ago[PM] Update one user of the printing pass API that I missed.
Chandler Carruth [Sun, 12 Jan 2014 11:39:04 +0000 (11:39 +0000)]
[PM] Update one user of the printing pass API that I missed.

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

10 years ago[PM] Simplify the interface exposed for IR printing passes.
Chandler Carruth [Sun, 12 Jan 2014 11:30:46 +0000 (11:30 +0000)]
[PM] Simplify the interface exposed for IR printing passes.

Nothing was using the ability of the pass to delete the raw_ostream it
printed to, and nothing was trying to pass it a pointer to the
raw_ostream. Also, the function variant had a different order of
arguments from all of the others which was just really confusing. Now
the interface accepts a reference, doesn't offer to delete it, and uses
a consistent order. The implementation of the printing passes haven't
been updated with this simplification, this is just the API switch.

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