oota-llvm.git
11 years agoHexagon: Fix Small Data support to handle -G 0 correctly.
Jyotsna Verma [Tue, 7 May 2013 16:42:15 +0000 (16:42 +0000)]
Hexagon: Fix Small Data support to handle -G 0 correctly.

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

11 years agoMention SystemZ in the release notes
Richard Sandiford [Tue, 7 May 2013 15:52:32 +0000 (15:52 +0000)]
Mention SystemZ in the release notes

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

11 years agoHexagon: Set accessSize and addrMode on all load/store instructions.
Jyotsna Verma [Tue, 7 May 2013 15:06:29 +0000 (15:06 +0000)]
Hexagon: Set accessSize and addrMode on all load/store instructions.

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

11 years agoRe-enable AVX detection on x64 platforms.
Michael Kuperstein [Tue, 7 May 2013 14:05:33 +0000 (14:05 +0000)]
Re-enable AVX detection on x64 platforms.

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

11 years ago[SystemZ] Fix InitMCCodeGenInfo call
Richard Sandiford [Tue, 7 May 2013 12:56:31 +0000 (12:56 +0000)]
[SystemZ] Fix InitMCCodeGenInfo call

createSystemZMCCodeGenInfo was not passing the optimization level to
InitMCCodeGenInfo(), so -O0 would be ignored.  Fixes DebugInfo/namespace.ll
after the changes in r181271.

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

11 years agoNote that EH is now supported in MCJIT.
Rafael Espindola [Tue, 7 May 2013 12:29:17 +0000 (12:29 +0000)]
Note that EH is now supported in MCJIT.

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

11 years agoFix the VS2010 build broken by r181271
Timur Iskhodzhanov [Tue, 7 May 2013 07:47:47 +0000 (07:47 +0000)]
Fix the VS2010 build broken by r181271

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

11 years agoCorrect logical shift documentation
Tim Northover [Tue, 7 May 2013 06:17:14 +0000 (06:17 +0000)]
Correct logical shift documentation

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

11 years agoLoopVectorize: getConsecutiveVector must respect signed arithmetic
Arnold Schwaighofer [Tue, 7 May 2013 04:37:05 +0000 (04:37 +0000)]
LoopVectorize: getConsecutiveVector must respect signed arithmetic

We were passing an i32 to ConstantInt::get where an i64 was needed and we must
also pass the sign if we pass negatives numbers. The start index passed to
getConsecutiveVector must also be signed.

Should fix PR15882.

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

11 years agoDebugInfo: Support imported modules in lexical blocks
David Blaikie [Mon, 6 May 2013 23:33:07 +0000 (23:33 +0000)]
DebugInfo: Support imported modules in lexical blocks

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

11 years agoR600/SI: Add intrinsic for MIMG IMAGE_GET_RESINFO opcode
Tom Stellard [Mon, 6 May 2013 23:02:19 +0000 (23:02 +0000)]
R600/SI: Add intrinsic for MIMG IMAGE_GET_RESINFO opcode

Patch by: Michel Dänzer

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181269 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Handle arbitrary destination type in SITargetLowering::adjustWritemask
Tom Stellard [Mon, 6 May 2013 23:02:15 +0000 (23:02 +0000)]
R600/SI: Handle arbitrary destination type in SITargetLowering::adjustWritemask

Patch by: Michel Dänzer

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181268 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add intrinsic for texture image loading
Tom Stellard [Mon, 6 May 2013 23:02:12 +0000 (23:02 +0000)]
R600/SI: Add intrinsic for texture image loading

Patch by: Michel Dänzer

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181267 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add pattern for uint_to_fp
Tom Stellard [Mon, 6 May 2013 23:02:07 +0000 (23:02 +0000)]
R600/SI: Add pattern for uint_to_fp

Patch by: Michel Dänzer

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181266 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add patterns for integer maxima / minima
Tom Stellard [Mon, 6 May 2013 23:02:04 +0000 (23:02 +0000)]
R600/SI: Add patterns for integer maxima / minima

Patch by: Michel Dänzer

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181265 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: Add pattern for AMDGPU.trunc intrinsic
Tom Stellard [Mon, 6 May 2013 23:02:00 +0000 (23:02 +0000)]
R600/SI: Add pattern for AMDGPU.trunc intrinsic

Patch by: Michel Dänzer

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181263 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPrint IR from Hexagon MI passes with -print-before/after-all.
Krzysztof Parzyszek [Mon, 6 May 2013 21:58:00 +0000 (21:58 +0000)]
Print IR from Hexagon MI passes with -print-before/after-all.

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

11 years agoImplemented public interface for modifying registered (not positional or sink options...
Andrew Trick [Mon, 6 May 2013 21:56:35 +0000 (21:56 +0000)]
Implemented public interface for modifying registered (not positional or sink options) command line options at runtime.

Patch by Dan Liew!

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

11 years agoSupport command line option categories.
Andrew Trick [Mon, 6 May 2013 21:56:23 +0000 (21:56 +0000)]
Support command line option categories.

Patch by Dan Liew!

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

11 years agoCleanup of the HexagonTargetMachine setup.
Krzysztof Parzyszek [Mon, 6 May 2013 21:25:45 +0000 (21:25 +0000)]
Cleanup of the HexagonTargetMachine setup.

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

11 years agoInstCombine: (X ^ signbit) + C -> X + (signbit ^ C)
David Majnemer [Mon, 6 May 2013 21:21:31 +0000 (21:21 +0000)]
InstCombine: (X ^ signbit) + C -> X + (signbit ^ C)

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

11 years agoHoist boundary condition out of loop header.
Eric Christopher [Mon, 6 May 2013 21:19:44 +0000 (21:19 +0000)]
Hoist boundary condition out of loop header.

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

11 years agoUntabify.
Eric Christopher [Mon, 6 May 2013 21:19:41 +0000 (21:19 +0000)]
Untabify.

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

11 years agoReduce attributes.
Bill Wendling [Mon, 6 May 2013 20:57:23 +0000 (20:57 +0000)]
Reduce attributes.

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

11 years agoSplit Alignment out of the Section Characteristics.
Rafael Espindola [Mon, 6 May 2013 20:11:21 +0000 (20:11 +0000)]
Split Alignment out of the Section Characteristics.

The alignment is just a byte in the middle of Characteristics, not an
independent flag. Making it an independent field in the yaml
representation makes it more yamlio friendly.

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

11 years agoHexagon: Add multiclass/encoding bits for the New-Value Jump instructions.
Jyotsna Verma [Mon, 6 May 2013 18:49:23 +0000 (18:49 +0000)]
Hexagon: Add multiclass/encoding bits for the New-Value Jump instructions.

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

11 years agoTest results verified using FileCheck rather than grep | count
Jean-Luc Duprat [Mon, 6 May 2013 18:45:16 +0000 (18:45 +0000)]
Test results verified using FileCheck rather than grep | count

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

11 years agoMake references to HexagonTargetMachine "const".
Krzysztof Parzyszek [Mon, 6 May 2013 18:38:37 +0000 (18:38 +0000)]
Make references to HexagonTargetMachine "const".

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

11 years agoRemove some redundant includes in llvm-mc.cpp.
Rafael Espindola [Mon, 6 May 2013 18:19:24 +0000 (18:19 +0000)]
Remove some redundant includes in llvm-mc.cpp.

Patch by Jun Koi!

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

11 years agoRotate multi-exit loops even if the latch was simplified.
Andrew Trick [Mon, 6 May 2013 17:58:18 +0000 (17:58 +0000)]
Rotate multi-exit loops even if the latch was simplified.

Test case by Michele Scandale!

Fixes PR10293: Load not hoisted out of loop with multiple exits.

There are few regressions with this patch, now tracked by
rdar:13817079, and a roughly equal number of improvements. The
regressions are almost certainly back luck because LoopRotate has very
little idea of whether rotation is profitable. Doing better requires a
more comprehensive solution.

This checkin is a quick fix that lacks generality (PR10293 has
a counter-example). But it trivially fixes the case in PR10293 without
interfering with other cases, and it does satify the criteria that
LoopRotate is a loop canonicalization pass that should avoid
heuristics and special cases.

I can think of two approaches that would probably be better in
the long run. Ultimately they may both make sense.

(1) LoopRotate should check that the current header would make a good
loop guard, and that the loop does not already has a sufficient
guard. The artifical SimplifiedLoopLatch check would be unnecessary,
and the design would be more general and canonical. Two difficulties:

- We need a strong guarantee that we won't endlessly rotate, so the
  analysis would need to be precise in order to avoid the
  SimplifiedLoopLatch precondition.

- Analysis like this are usually based on SCEV, which we don't want to
  rely on.

(2) Rotate on-demand in late loop passes. This could even be done by
shoving the loop back on the queue after the optimization that needs
it. This could work well when we find LICM opportunities in
multi-branch loops. This requires some work, and it doesn't really
solve the problem of SCEV wanting a loop guard before the analysis.

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

11 years agoR600: Remove dead code from the CodeEmitter v2
Tom Stellard [Mon, 6 May 2013 17:50:57 +0000 (17:50 +0000)]
R600: Remove dead code from the CodeEmitter v2

v2:
  - Replace switch statement with TSFlags query

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
Tested-By: Aaron Watry <awatry@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181229 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Emit config values in register / value pairs
Tom Stellard [Mon, 6 May 2013 17:50:51 +0000 (17:50 +0000)]
R600: Emit config values in register / value pairs

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
Tested-By: Aaron Watry <awatry@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181228 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unnecessary instance variable and rework logic accordingly.
Eric Christopher [Mon, 6 May 2013 17:50:50 +0000 (17:50 +0000)]
Remove unnecessary instance variable and rework logic accordingly.

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

11 years agoGrammar.
Eric Christopher [Mon, 6 May 2013 17:50:46 +0000 (17:50 +0000)]
Grammar.

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

11 years agoR600: Stop emitting the instruction type byte before each instruction
Tom Stellard [Mon, 6 May 2013 17:50:44 +0000 (17:50 +0000)]
R600: Stop emitting the instruction type byte before each instruction

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
Tested-By: Aaron Watry <awatry@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181225 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't emit .dwo sections unless they exist.
Eric Christopher [Mon, 6 May 2013 17:50:42 +0000 (17:50 +0000)]
Don't emit .dwo sections unless they exist.

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

11 years agoR600: Emit ISA for CALL_FS_* instructions
Tom Stellard [Mon, 6 May 2013 17:50:26 +0000 (17:50 +0000)]
R600: Emit ISA for CALL_FS_* instructions

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
Tested-By: Aaron Watry <awatry@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181223 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[SystemZ] Update non-pic DWARF encodings
Ulrich Weigand [Mon, 6 May 2013 17:28:30 +0000 (17:28 +0000)]
[SystemZ] Update non-pic DWARF encodings

As pointed out by Rafael Espindola, we should match the DWARF encodings
produced by GCC in both pic and non-pic modes.  This was not the case
for the non-pic case.

This patch changes all DWARF encodings to DW_EH_PE_absptr for the
non-pic case, just like GCC does.  The test case is updated to check
for both variants.

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

11 years agoPowerPC: Fix unimplemented relocation on ppc64
Adhemerval Zanella [Mon, 6 May 2013 17:21:23 +0000 (17:21 +0000)]
PowerPC: Fix unimplemented relocation on ppc64

This patch handles the R_PPC64_REL64 relocation type for powerpc64
for mcjit.

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

11 years agoFix add4.ll test cmdline so that it passes
Jean-Luc Duprat [Mon, 6 May 2013 17:18:47 +0000 (17:18 +0000)]
Fix add4.ll test cmdline so that it passes

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

11 years agoProvide InstCombines for the following 3 cases:
Jean-Luc Duprat [Mon, 6 May 2013 16:55:50 +0000 (16:55 +0000)]
Provide InstCombines for the following 3 cases:
A * (1 - (uitofp i1 C)) -> select C, 0, A
B * (uitofp i1 C) -> select C, B, 0
select C, 0, A + select C, B, 0 -> select C, B, A

These come up in code that has been hand-optimized from a select to a linear blend,
on platforms where that may have mattered. We want to undo such changes
with the following transform:
A*(1 - uitofp i1 C) + B*(uitofp i1 C) -> select C, A, B

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

11 years agoAArch64: use MCJIT by default and enable related tests.
Tim Northover [Mon, 6 May 2013 16:51:08 +0000 (16:51 +0000)]
AArch64: use MCJIT by default and enable related tests.

This just enables some testing I'd missed after implementing MCJIT
support.

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

11 years ago[SystemZ] Add to --enable-targets=all
Ulrich Weigand [Mon, 6 May 2013 16:23:07 +0000 (16:23 +0000)]
[SystemZ] Add to --enable-targets=all

This patch finally enables the SystemZ target in the default build
(with --enable-targets=all).

Patch by Richard Sandiford.

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

11 years ago[SystemZ] Add configure bits
Ulrich Weigand [Mon, 6 May 2013 16:22:34 +0000 (16:22 +0000)]
[SystemZ] Add configure bits

This patch wires up the SystemZ target in configure, so that it can now be
built using --enable-targets=systemz.   It is not yet included in the default
build (--enable-targets=all); this will be done by a follow-up patch.

Patch by Richard Sandiford.

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

11 years ago[SystemZ] Set up JIT/MCJIT test cases
Ulrich Weigand [Mon, 6 May 2013 16:21:50 +0000 (16:21 +0000)]
[SystemZ] Set up JIT/MCJIT test cases

This patch adds the necessary configuration bits and #ifdef's to set up
the JIT/MCJIT test cases for SystemZ.  Like other recent targets, we do
fully support MCJIT, but do not support the old JIT at all.  Set up the
lit config files accordingly, and disable old-JIT unit tests.

Patch by Richard Sandiford.

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

11 years ago[SystemZ] Add MC test cases
Ulrich Weigand [Mon, 6 May 2013 16:20:58 +0000 (16:20 +0000)]
[SystemZ] Add MC test cases

This adds all MC tests for the SystemZ target.

Patch by Richard Sandiford.

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

11 years ago[SystemZ] Add DebugInfo test cases
Ulrich Weigand [Mon, 6 May 2013 16:18:29 +0000 (16:18 +0000)]
[SystemZ] Add DebugInfo test cases

This adds all DebugInfo tests for the SystemZ target.

This version of the patch incorporates feedback from reviews by
Eric Christopher and Rafael Espindola.  Thanks to all reviewers!

Patch by Richard Sandiford.

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

11 years ago[SystemZ] Add CodeGen test cases
Ulrich Weigand [Mon, 6 May 2013 16:17:29 +0000 (16:17 +0000)]
[SystemZ] Add CodeGen test cases

This adds all CodeGen tests for the SystemZ target.

This version of the patch incorporates feedback from a review by
Sean Silva.  Thanks to all reviewers!

Patch by Richard Sandiford.

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

11 years ago[SystemZ] Add back end
Ulrich Weigand [Mon, 6 May 2013 16:15:19 +0000 (16:15 +0000)]
[SystemZ] Add back end

This adds the actual lib/Target/SystemZ target files necessary to
implement the SystemZ target.  Note that at this point, the target
cannot yet be built since the configure bits are missing.  Those
will be provided shortly by a follow-on patch.

This version of the patch incorporates feedback from reviews by
Chris Lattner and Anton Korobeynikov.  Thanks to all reviewers!

Patch by Richard Sandiford.

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

11 years ago[SystemZ] Define DWARF encoding
Ulrich Weigand [Mon, 6 May 2013 16:11:12 +0000 (16:11 +0000)]
[SystemZ] Define DWARF encoding

This is another patch in preparation for adding the SystemZ target.
It defines the appropriate values for DWARF encodings; the intent
is to be compatible with what GCC currently does on the target.

Patch by Richard Sandiford.

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

11 years agoSimplify JIT unit test #ifdefs
Ulrich Weigand [Mon, 6 May 2013 16:10:35 +0000 (16:10 +0000)]
Simplify JIT unit test #ifdefs

Several platforms need to disable all old-JIT unit tests, since they only
support the new MCJIT.  This currently done via #ifdef'ing out those tests
in the ExecutionEngine/JIT/*.cpp files.  As those #ifdef's have grown
historically, we now have a number of repeated directives which -in total-
cover nearly the whole file, but leave a couple of helper functions out.
When building the tests with clang itself, those helper functions now
cause spurious "unused function" warnings.

To fix those warnings, and also to remove the duplicate #ifdef conditions
and make it easier to disable the tests for a new target, this patch
consolidates the #ifdefs into a single one per file, which covers all
the tests including all helper routines.

Tested on PowerPC and SystemZ.

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

11 years agoFree the exception object. Should fix the vg bots.
Rafael Espindola [Mon, 6 May 2013 13:30:52 +0000 (13:30 +0000)]
Free the exception object. Should fix the vg bots.

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

11 years ago[PowerPC] Fix memory corruption in AsmParser
Ulrich Weigand [Mon, 6 May 2013 11:16:57 +0000 (11:16 +0000)]
[PowerPC] Fix memory corruption in AsmParser

As pointed out by Evgeniy Stepanov, assigning a std::string temporary
to a StringRef is not a good idea.  Rework MatchRegisterName to avoid
using the .lower routine.

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

11 years agoFix formatting. Patch by o11c.
Duncan Sands [Mon, 6 May 2013 08:55:45 +0000 (08:55 +0000)]
Fix formatting.  Patch by o11c.

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

11 years agoFix slightly too aggressive conact_vector optimization.
Michael Kuperstein [Mon, 6 May 2013 08:06:13 +0000 (08:06 +0000)]
Fix slightly too aggressive conact_vector optimization.
(Would sometimes optimize away conacts used to extend a vector with undef values)

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

11 years agoAdd a testcase that checks that we generate functions with frame
Bill Wendling [Mon, 6 May 2013 05:45:57 +0000 (05:45 +0000)]
Add a testcase that checks that we generate functions with frame
pointers or not depending upon the function attributes.

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

11 years agoXFAIL for cygwin.
Rafael Espindola [Mon, 6 May 2013 03:35:56 +0000 (03:35 +0000)]
XFAIL for cygwin.

Looks like symbol resolution is not working on cygwin, the test fails
because __gxx_personality_v0 is not found.

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

11 years agoUpdate the comment to mention that we use TTI.
Nadav Rotem [Mon, 6 May 2013 03:06:36 +0000 (03:06 +0000)]
Update the comment to mention that we use TTI.

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

11 years agoRevert r164763 because it introduces new shuffles.
Nadav Rotem [Mon, 6 May 2013 02:39:09 +0000 (02:39 +0000)]
Revert r164763 because it introduces new shuffles.
Thanks Nick Lewycky for pointing this out.

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

11 years agoFix unchecked uses of DominatorTree in MemoryDependenceAnalysis.
Matt Arsenault [Mon, 6 May 2013 02:07:24 +0000 (02:07 +0000)]
Fix unchecked uses of DominatorTree in MemoryDependenceAnalysis.

Use unknown results for places where it would be needed

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

11 years agoFix const merging when an alias of a const is llvm.used.
Rafael Espindola [Mon, 6 May 2013 01:48:55 +0000 (01:48 +0000)]
Fix const merging when an alias of a const is llvm.used.

We used to disable constant merging not only if a constant is llvm.used, but
also if an alias of a constant is llvm.used. This change fixes that.

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

11 years agoThis should also fail on ARM.
Rafael Espindola [Sun, 5 May 2013 22:42:34 +0000 (22:42 +0000)]
This should also fail on ARM.

We currently have no way to register new eh frames on ARM.

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

11 years agoFix XFAIL line.
Rafael Espindola [Sun, 5 May 2013 21:30:10 +0000 (21:30 +0000)]
Fix XFAIL line.

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

11 years agoXFAIL this on ppc64.
Rafael Espindola [Sun, 5 May 2013 21:04:18 +0000 (21:04 +0000)]
XFAIL this on ppc64.

It looks like eh uses an unimplemented relocation on pp64

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

11 years agoPort ExceptionDemo to MCJIT.
Rafael Espindola [Sun, 5 May 2013 20:57:58 +0000 (20:57 +0000)]
Port ExceptionDemo to MCJIT.

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

11 years agoAdd EH support to the MCJIT.
Rafael Espindola [Sun, 5 May 2013 20:43:10 +0000 (20:43 +0000)]
Add EH support to the MCJIT.

This gets exception handling working on ELF and Macho (x86-64 at least).
Other than the EH frame registration, this patch also implements support
for GOT relocations which are used to locate the personality function on
MachO.

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

11 years agoTest case for r181160 and r181161. rdar://13782395
Evan Cheng [Sun, 5 May 2013 18:07:15 +0000 (18:07 +0000)]
Test case for r181160 and r181161. rdar://13782395

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

11 years agoARM AnalyzeBranch should conservatively return true when it sees a predicated
Evan Cheng [Sun, 5 May 2013 18:06:32 +0000 (18:06 +0000)]
ARM AnalyzeBranch should conservatively return true when it sees a predicated
indirect branch at the end of the BB. Otherwise if-converter, branch folding
pass may incorrectly update its successor info if it consider BB as fallthrough
to the next BB.

rdar://13782395

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

11 years agoTeach if-converter to avoid removing BBs whose addresses are takne. rdar://13782395
Evan Cheng [Sun, 5 May 2013 18:03:49 +0000 (18:03 +0000)]
Teach if-converter to avoid removing BBs whose addresses are takne. rdar://13782395

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

11 years agoLoopVectorize: Print values instead of pointers in debug output.
Benjamin Kramer [Sun, 5 May 2013 14:54:52 +0000 (14:54 +0000)]
LoopVectorize: Print values instead of pointers in debug output.

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

11 years ago[docs] Update Target Feature Matrix for the XCore backend.
Richard Osborne [Sun, 5 May 2013 14:09:55 +0000 (14:09 +0000)]
[docs] Update Target Feature Matrix for the XCore backend.

Disassembler support has recently been added. Fill in some other unknowns
at the same time.

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

11 years ago[XCore] Add LDAPB instructions.
Richard Osborne [Sun, 5 May 2013 13:36:53 +0000 (13:36 +0000)]
[XCore] Add LDAPB instructions.

With the change the disassembler now supports the XCore ISA in its
entirety.

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

11 years ago[XCore] Update LDAP to use pcrel_imm.
Richard Osborne [Sun, 5 May 2013 13:33:10 +0000 (13:33 +0000)]
[XCore] Update LDAP to use pcrel_imm.

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

11 years ago[XCore] Rename calltarget -> pcrel_imm.
Richard Osborne [Sun, 5 May 2013 13:29:02 +0000 (13:29 +0000)]
[XCore] Rename calltarget -> pcrel_imm.

No functionality change.

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

11 years ago[XCore] Add BLRB instructions.
Richard Osborne [Sun, 5 May 2013 13:24:16 +0000 (13:24 +0000)]
[XCore] Add BLRB instructions.

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

11 years ago[XCore] Remove '-' from back branch asm syntax.
Richard Osborne [Sun, 5 May 2013 13:20:22 +0000 (13:20 +0000)]
[XCore] Remove '-' from back branch asm syntax.

Instead operands are treated as negative immediates
where the sign bit is implicit in the instruction
encoding.

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

11 years agoInlineSpiller: Remove quadratic behavior.
Benjamin Kramer [Sun, 5 May 2013 11:29:14 +0000 (11:29 +0000)]
InlineSpiller: Remove quadratic behavior.

No functionality change.

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

11 years agoFor ARM backend, fixed "byval" attribute support.
Stepan Dyatkovskiy [Sun, 5 May 2013 07:48:36 +0000 (07:48 +0000)]
For ARM backend, fixed "byval" attribute support.
Now even the small structures could be passed within byval (small enough
to be stored in GPRs).
In regression tests next function prototypes are checked:

PR15293:
  %artz = type { i32 }
  define void @foo(%artz* byval %s)
  define void @foo2(%artz* byval %s, i32 %p, %artz* byval %s2)
foo: "s" stored in R0
foo2: "s" stored in R0, "s2" stored in R2.

Next AAPCS rules are checked:
5.5 Parameters Passing, C.4 and C.5,
"ParamSize" is parameter size in 32bit words:
-- NSAA != 0, NCRN < R4 and NCRN+ParamSize > R4.
   Parameter should be sent to the stack; NCRN := R4.
-- NSAA != 0, and NCRN < R4, NCRN+ParamSize < R4.
   Parameter stored in GPRs; NCRN += ParamSize.

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

11 years agoAdd missing PatternMatch.cpp to CMakeLists.txt
Arnold Schwaighofer [Sun, 5 May 2013 02:14:28 +0000 (02:14 +0000)]
Add missing PatternMatch.cpp to CMakeLists.txt

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

11 years agoPatternMatch: Fix documentation - 'function' not 'attribute'
Arnold Schwaighofer [Sun, 5 May 2013 02:01:41 +0000 (02:01 +0000)]
PatternMatch: Fix documentation - 'function' not 'attribute'

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

11 years agoRemove a recently redundant transform from X86ISelLowering.
David Majnemer [Sun, 5 May 2013 02:00:10 +0000 (02:00 +0000)]
Remove a recently redundant transform from X86ISelLowering.

X86ISelLowering has support to treat:
(icmp ne (and (xor %flags, -1), (shl 1, flag)), 0)

as if it were actually:
(icmp eq (and %flags, (shl 1, flag)), 0)

However, r179386 has code at the InstCombine level to handle this.

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

11 years agoLoopVectorize: Add support for floating point min/max reductions
Arnold Schwaighofer [Sun, 5 May 2013 01:54:48 +0000 (01:54 +0000)]
LoopVectorize: Add support for floating point min/max reductions

Add support for min/max reductions when "no-nans-float-math" is enabled. This
allows us to assume we have ordered floating point math and treat ordered and
unordered predicates equally.

radar://13723044

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

11 years agoPatternMatch: Matcher for (un)ordered floating point min/max
Arnold Schwaighofer [Sun, 5 May 2013 01:54:46 +0000 (01:54 +0000)]
PatternMatch: Matcher for (un)ordered floating point min/max

Add support for matching 'ordered' and 'unordered' floating point min/max
constructs.

In LLVM we can express min/max functions as a combination of compare and select.
We have support for matching such constructs for integers but not for floating
point. In floating point math there is no total order because of the presence of
'NaN'. Therefore, we have to be careful to preserve the original fcmp semantics
when interpreting floating point compare select combinations as a minimum or
maximum function. The resulting 'ordered/unordered' floating point maximum
function has to select the same value as the select/fcmp combination it is based
on.

 ordered_max(x,y)   = max(x,y) iff x and y are not NaN, y otherwise
 unordered_max(x,y) = max(x,y) iff x and y are not NaN, x otherwise
 ordered_min(x,y)   = min(x,y) iff x and y are not NaN, y otherwise
 unordered_min(x,y) = min(x,y) iff x and y are not NaN, x otherwise

This matches the behavior of the underlying select(fcmp(olt/ult/.., L, R), L, R)
construct.

Any code using this predicate has to preserve this semantics.

A follow-up patch will use this to implement floating point min/max reductions
in the vectorizer.

radar://13723044

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

11 years agoLoopVectorizer: Cleanup of miminimum/maximum pattern match code
Arnold Schwaighofer [Sun, 5 May 2013 01:54:44 +0000 (01:54 +0000)]
LoopVectorizer: Cleanup of miminimum/maximum pattern match code

No need for setting the operands. The pointers are going to be bound by the
matcher.

radar://13723044

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

11 years agoLoopVectorize: We don't need an identity element for min/max reductions
Arnold Schwaighofer [Sun, 5 May 2013 01:54:42 +0000 (01:54 +0000)]
LoopVectorize: We don't need an identity element for min/max reductions

We can just use the initial element that feeds the reduction.

  max(max(x, y), z) == max(max(x,y), max(x,z))

radar://13723044

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

11 years agoAdd ArrayRef constructor from None, and do the cleanups that this constructor enables
Dmitri Gribenko [Sun, 5 May 2013 00:40:33 +0000 (00:40 +0000)]
Add ArrayRef constructor from None, and do the cleanups that this constructor enables

Patch by Robert Wilhelm.

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

11 years agowhitespace
Nadav Rotem [Sat, 4 May 2013 23:27:32 +0000 (23:27 +0000)]
whitespace

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

11 years agoFix an odd comment.
Nadav Rotem [Sat, 4 May 2013 23:24:56 +0000 (23:24 +0000)]
Fix an odd comment.

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

11 years agoAArch64: enable MCJIT and tests now that everything passes.
Tim Northover [Sat, 4 May 2013 20:14:22 +0000 (20:14 +0000)]
AArch64: enable MCJIT and tests now that everything passes.

This removes dire warnings about AArch64 being unsupported and enables
the tests when appropriate on this platform.

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

11 years agoAArch64: implement 64-bit absolute relocation in MCJIT
Tim Northover [Sat, 4 May 2013 20:14:14 +0000 (20:14 +0000)]
AArch64: implement 64-bit absolute relocation in MCJIT

This is about the simplest relocation, but surprisingly rare in actual
code.

It occurs in (for example) the MCJIT test test-ptr-reloc.ll.

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

11 years agoAArch64: add stubs to support long function calls on MCJIT
Tim Northover [Sat, 4 May 2013 20:14:09 +0000 (20:14 +0000)]
AArch64: add stubs to support long function calls on MCJIT

As with global accesses, external functions could exist anywhere in
memory. Therefore the stub must create a complete 64-bit address. This
patch implements the fragment as (roughly):
    movz x16, #:abs_g3:somefunc
    movk x16, #:abs_g2_nc:somefunc
    movk x16, #:abs_g1_nc:somefunc
    movk x16, #:abs_g0_nc:somefunc
    br x16

In principle we could save 4 bytes by using a literal-load instead,
but it is unclear that would be more efficient and can only be tested
when real hardware is readily available.

This allows (for example) the MCJIT test 2003-05-07-ArgumentTest to
pass on AArch64.

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

11 years agoAArch64: implement relocations for global access
Tim Northover [Sat, 4 May 2013 20:14:04 +0000 (20:14 +0000)]
AArch64: implement relocations for global access

The large memory model (default and main viable for JIT) emits
addresses in need of relocation as
    movz x0, #:abs_g3:somewhere
    movk x0, #:abs_g2_nc:somewhere
    movk x0, #:abs_g1_nc:somewhere
    movk x0, #:abs_g0_nc:somewhere

To support this we must implement those four relocations in the
dynamic loader.

This allows (for example) the test-global.ll MCJIT test to pass on
AArch64.

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

11 years agoAArch64: implement first relocation required for MCJIT
Tim Northover [Sat, 4 May 2013 20:13:59 +0000 (20:13 +0000)]
AArch64: implement first relocation required for MCJIT

R_AARCH64_PCREL32 is present in even trivial .eh_frame sections and so
is required to compile any function without the "nounwind" attribute.

This change implements very basic infrastructure in the RuntimeDyldELF
file and allows (for example) the test-shift.ll MCJIT test to pass
on AArch64.

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

11 years agoBuild system changes to enable MCJIT on AArch64
Tim Northover [Sat, 4 May 2013 20:13:52 +0000 (20:13 +0000)]
Build system changes to enable MCJIT on AArch64

These changes just allow AArch64 to take part in the MCJIT world when
built correctly.

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

11 years agoAArch64: use __clear_cache under GCCish environments
Tim Northover [Sat, 4 May 2013 18:52:44 +0000 (18:52 +0000)]
AArch64: use __clear_cache under GCCish environments

AArch64 is going to need some kind of cache-invalidation in order to
successfully JIT since it has a weak memory-model. This is provided by
a __clear_cache builtin in libgcc, which acts very much like the
32-bit ARM equivalent (on platforms where it exists).

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

11 years agoFix buildbot failure on 64 bit linux due to std::max() having different
Richard Osborne [Sat, 4 May 2013 17:41:01 +0000 (17:41 +0000)]
Fix buildbot failure on 64 bit linux due to std::max() having different
operand types.

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

11 years ago[XCore] Remove unused operand type.
Richard Osborne [Sat, 4 May 2013 17:30:05 +0000 (17:30 +0000)]
[XCore] Remove unused operand type.

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

11 years ago[XCore] Make use of the target independent global address offset folding.
Richard Osborne [Sat, 4 May 2013 17:24:33 +0000 (17:24 +0000)]
[XCore] Make use of the target independent global address offset folding.

This let us to remove some custom code that matched constant offsets
from globals at instruction selection time as a special addressing mode.
No intended functionality change.

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

11 years ago[XCore] Simplify code that checks for an aligned base plus a constant.
Richard Osborne [Sat, 4 May 2013 17:17:10 +0000 (17:17 +0000)]
[XCore] Simplify code that checks for an aligned base plus a constant.

The code now makes use of ComputeMaskedBits,
SelectionDAG::isBaseWithConstantOffset and TargetLowering::isGAPlusOffset
where appropriate reducing the amount of logic needed in XCoreISelLowering.
No intended functionality change.

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

11 years ago[XCore] Move lowering of thread local storage to a separate pass.
Richard Osborne [Sat, 4 May 2013 17:01:55 +0000 (17:01 +0000)]
[XCore] Move lowering of thread local storage to a separate pass.

Thread local storage is not supported by the XMOS linker so we handle
thread local variables by lowering the variable to an array of n elements
(where n is the number of hardware threads per core, currently 8
for all XMOS devices) indexed by the the current thread ID.

Previously this lowering was spread across the XCoreISelLowering and the
XCoreAsmPrinter classes. Moving this to a separate pass should be much
cleaner.

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