97147 Commits

Author SHA1 Message Date
Simon Pilgrim
431da84b02 Fix spelling mistakes in Transforms comments. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 13:19:49 +00:00
Simon Pilgrim
cc5e30431d Fix spelling mistakes in SelectionDAG comments. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287487 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 13:14:57 +00:00
Simon Pilgrim
0f550ef263 Fix comment typos. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287486 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 13:10:51 +00:00
Oren Ben Simhon
88688e8d48 [X86] RegCall - Handling long double arguments
The change is part of RegCall calling convention support for LLVM.
Long double (f80) requires special treatment as the first f80 parameter is saved in FP0 (floating point stack).
This review present the change and the corresponding tests.

Differential Revision: https://reviews.llvm.org/D26151


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287485 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 11:06:07 +00:00
Coby Tayree
815a7e0780 [X86][InlineAsm]Test commit.
Fixing a wrong comment on X86AsmParser.cpp::ParseZ: "true" --> "false"

Differential Revision: https://reviews.llvm.org/D26797



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287484 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 09:31:11 +00:00
Serge Pavlov
15f7935637 Fix file name resolution in nested response files
If a response file in construct `@file` was specified by relative name,
constructs `@file` nested within it were resolved incorrectly if the
flag RelativeNames in call to ExpandResponseFile was set to true.
This feature is used in configuration files, tests for it are in
respective change (see D24933).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287482 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 06:25:07 +00:00
Alexei Starovoitov
e58b8cc117 [bpf] add BPF disassembler
add BPF disassembler, so tools like llvm-objdump can be used:
$ llvm-objdump -d -no-show-raw-insn ./sockex1_kern.o

./sockex1_kern.o:	file format ELF64-BPF

Disassembly of section socket1:
bpf_prog1:
       0:	r6 = r1
       8:	r0 = *(u8 *)skb[23]
      10:	*(u32 *)(r10 - 4) = r0
      18:	r1 = *(u32 *)(r6 + 4)
      20:	if r1 != 4 goto 8
      28:	r2 = r10
      30:	r2 += -4

ld_imm64 (the only 16-byte insn) and special ld_abs/ld_ind instructions
had to be treated in a special way. The decoders for the rest of the insns
are automatically generated.

Add tests to cover new functionality.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287477 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 02:25:00 +00:00
Rui Ueyama
b665150021 Attempt to fix big-endian buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287476 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 01:41:28 +00:00
Rui Ueyama
533eaeefec Style fix. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 01:15:56 +00:00
Rui Ueyama
54ac8bee97 Fix buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287474 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 01:13:22 +00:00
Rui Ueyama
8afc3ea3bd SHA1: unroll loop in hashBlock.
This code is taken from public domain.
https://github.com/jsonn/src/blob/trunk/common/lib/libc/hash/sha1/sha1.c

I wrote a sha1 command and ran it on my Xeon E5-2680 v2 2.80GHz machine.
Here is a result. The new hash function is 37% faster than before.

 Performance counter stats for './llvm-sha1-old /ssd/build/bin/lld' (10 runs):

       6640.503687 task-clock (msec)         #    1.001 CPUs utilized            ( +-  0.03% )
                54 context-switches          #    0.008 K/sec                    ( +-  5.03% )
                 5 cpu-migrations            #    0.001 K/sec                    ( +- 31.73% )
           183,803 page-faults               #    0.028 M/sec                    ( +-  0.00% )
    18,527,954,113 cycles                    #    2.790 GHz                      ( +-  0.03% )
     4,993,237,485 stalled-cycles-frontend   #   26.95% frontend cycles idle     ( +-  0.11% )
   <not supported> stalled-cycles-backend
    50,217,149,423 instructions              #    2.71  insns per cycle
                                             #    0.10  stalled cycles per insn  ( +-  0.00% )
     6,094,322,337 branches                  #  917.750 M/sec                    ( +-  0.00% )
        11,778,239 branch-misses             #    0.19% of all branches          ( +-  0.01% )

       6.634017401 seconds time elapsed                                          ( +-  0.03% )

 Performance counter stats for './llvm-sha1-new /ssd/build/bin/lld' (10 runs):

       4167.062720 task-clock (msec)         #    1.001 CPUs utilized            ( +-  0.02% )
                52 context-switches          #    0.012 K/sec                    ( +- 16.45% )
                 7 cpu-migrations            #    0.002 K/sec                    ( +- 32.20% )
           183,804 page-faults               #    0.044 M/sec                    ( +-  0.00% )
    11,626,611,958 cycles                    #    2.790 GHz                      ( +-  0.02% )
     4,491,897,976 stalled-cycles-frontend   #   38.63% frontend cycles idle     ( +-  0.05% )
   <not supported> stalled-cycles-backend
    24,320,180,617 instructions              #    2.09  insns per cycle
                                             #    0.18  stalled cycles per insn  ( +-  0.00% )
     1,574,674,576 branches                  #  377.886 M/sec                    ( +-  0.00% )
        11,769,693 branch-misses             #    0.75% of all branches          ( +-  0.00% )

       4.163251552 seconds time elapsed                                          ( +-  0.02% )

Differential Revision: https://reviews.llvm.org/D26890

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287473 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 01:03:22 +00:00
Saleem Abdulrasool
902878bb3f Demangle: remove references to allocator for default allocator
The demangler had stopped using a custom allocator but had not been updated to
remove the use of the explicit allocator passing.  This removes that as we do
not need to do anything special here anymore.  This just makes the code more
compact.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287472 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 00:20:27 +00:00
Saleem Abdulrasool
21918ee4aa Demangle: remove unnecessary typedef for std::vector
We could create a local typedef for std::vector called Vector.  Inline the use
of std::vector rather than use the typedef.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287471 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 00:20:25 +00:00
Saleem Abdulrasool
e17a816352 Demangle: replace custom typedef for std::string with std::string
We created a local typedef for `std::basic_string<char, std::char_traits<char>>`
which is just `std::string`.  Remove the local typedef and propagate the type
information through the rest of the demangler.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287470 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 00:20:23 +00:00
Saleem Abdulrasool
7f90f9e9a9 Demangle: use direct member initialization (NFC)
Prefer direct member initialization over the explicit out-of-line initialization
for the construction of the local type.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 00:20:20 +00:00
Benjamin Kramer
c57d1d6295 Give some helper classes/functions internal linkage. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287462 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 20:44:26 +00:00
Simon Pilgrim
c6fddca294 [X86][SSE] Improve PSHUFB lowering from either input
Canonicalization may leave the zeroable vector in the first input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287461 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 20:41:48 +00:00
Simon Pilgrim
b799ae96d6 [X86][AVX512] Add VPERMV/VPERMV3 v64i8 byte shuffles on avx512vbmi targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287459 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 20:12:34 +00:00
Mehdi Amini
c695a0be78 [ThinLTO] Fix crash when importing an opaque type
It seems that because ThinLTO does not import the full module,
some invariant of the type mapper are broken.

In Monolithic LTO, we import every globals: when calling
IRLinker::copyFunctionProto() on @foo(), we end-up calling
TypeMapTy::get(FTy) on the type of @foo(), which will map
%0 and record the destination as opaque.

ThinLTO skips this because @foo is not imported and goes directly
to the next stage.

Next we call computeTypeMapping() that map the types for each
globals, and ends up checking for type isomorphism, and may add
type mapping. However it doesn't record if there was an opaque
destination type that was resolved.

Instead of lazily "discovering" opaque type in the destination
module on the go, we change the TypeFinder to eagerly record all
types and not only the named ones.

Differential Revision: https://reviews.llvm.org/D26840

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 18:44:16 +00:00
Mehdi Amini
4bd62ab489 [ThinLTO] Implement -pass-remarks-output in ThinLTOCodeGenerator
Summary:
This will also be added to the LTO API, right now this will
bring ThinLTO on par with Monolithic LTO on Darwin.

Reviewers: anemet

Subscribers: tejohnson, llvm-commits

Differential Revision: https://reviews.llvm.org/D26886

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287450 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 18:20:05 +00:00
Mehdi Amini
1bb4b12315 Change setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC)
Summary:
This makes it explicit that ownership is taken. Also replace all `new`
with make_unique<> at call sites.

Reviewers: anemet

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D26884

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 18:19:41 +00:00
Craig Topper
aea637329e [X86] Simplify some code a little by removing a dulicate variable and combinining two if statements. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287443 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 17:33:17 +00:00
Daniel Sanders
c170429d49 Try again to fix unused variable warning on lld-x86_64-darwin13 after r287439.
The previous attempt didn't work. I assume LLVM_ATTRIBUTE_UNUSED isn't
available on that machine.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287442 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 14:47:41 +00:00
Daniel Sanders
8417728bfe Try to fix unused variable warning on lld-x86_64-darwin13 after r287439.
Whether the variable is used or not depends on NDEBUG.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287440 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 13:50:32 +00:00
Daniel Sanders
b313c742da Check that emitted instructions meet their predicates on all targets except ARM, Mips, and X86.
Summary:
* ARM is omitted from this patch because this check appears to expose bugs in this target.
* Mips is omitted from this patch because this check either detects bugs or deliberate
  emission of instructions that don't satisfy their predicates. One deliberate
  use is the SYNC instruction where the version with an operand is correctly
  defined as requiring MIPS32 while the version without an operand is defined
  as an alias of 'SYNC 0' and requires MIPS2.
* X86 is omitted from this patch because it doesn't use the tablegen-erated
  MCCodeEmitter infrastructure.

Patches for ARM and Mips will follow.

Depends on D25617

Reviewers: tstellarAMD, jmolloy

Subscribers: wdng, jmolloy, aemerson, rengolin, arsenm, jyknight, nemanjai, nhaehnle, tstellarAMD, llvm-commits

Differential Revision: https://reviews.llvm.org/D25618

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287439 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 13:05:44 +00:00
Dylan McKay
eeb505257e [AVR] Remove a bunch of unused variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287416 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 01:33:42 +00:00
Dylan McKay
420f51b6ae [AVR] Remove a variable which was unused in release mode
In release mode where assertions are not enabled, this caused an 'unused
variable' warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287414 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-19 01:14:44 +00:00
Konstantin Zhuravlyov
5527d64b74 [AMDGPU] Change frexp.exp intrinsic to return i16 for f16 input
Differential Revision: https://reviews.llvm.org/D26862


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 22:31:08 +00:00
Simon Pilgrim
3000aab2fb [SelectionDAG] Add knowbits support for CONCAT_VECTOR opcode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287387 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 22:21:22 +00:00
Michael Zolotukhin
3a7f010bf7 [LoopSimplify] Preserve LCSSA when removing edges from unreachable blocks.
This fixes PR30454.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287379 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 21:01:12 +00:00
Mehdi Amini
c0aec7f2f5 Revert "Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch"
This reverts commit r287352, LLDB CI is broken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287374 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 20:02:34 +00:00
Matthias Braun
9df5d1c65c Statistic/Timer: Include timers in PrintStatisticsJSON().
Differential Revision: https://reviews.llvm.org/D25588

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287370 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 19:43:24 +00:00
Matthias Braun
9262f00f1a Timer: Track name and description.
The previously used "names" are rather descriptions (they use multiple
words and contain spaces), use short programming language identifier
like strings for the "names" which should be used when exporting to
machine parseable formats.

Also removed a unused TimerGroup from Hexxagon.

Differential Revision: https://reviews.llvm.org/D25583

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 19:43:18 +00:00
Geoff Berry
181c24a90c [MIRPrinter] Print raw branch probabilities as expected by MIRParser
Fixes PR28751.

Reviewers: MatzeB, qcolombet

Subscribers: mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D26775

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287368 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 19:37:24 +00:00
Matt Arsenault
13892fc867 AMDGPU: Fix unused variable warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287362 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 18:33:36 +00:00
Adam Nemet
8fb7aa0930 [LTO] Add option to generate optimization records
It is used to drive this from the clang driver via -mllvm.

Same option name is used as in opt.

Differential Revision: https://reviews.llvm.org/D26832

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287356 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 18:06:28 +00:00
Hans Wennborg
3e367e61a7 IRMover: Avoid accidentally mapping types from the destination module (PR30799)
During Module linking, it's possible for SrcM->getIdentifiedStructTypes();
to return types that are actually defined in the destination module
(DstM). Depending on how the bitcode file was read,
getIdentifiedStructTypes() might do a walk over all values, including
metadata nodes, looking for types. In my case, a debug info metadata
node was shared between the two modules, and it referred to a type
defined in the destination module (see test case).

Differential Revision: https://reviews.llvm.org/D26212

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287353 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 17:33:05 +00:00
Mehdi Amini
ed72617844 Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch
Summary:
LLVM will define a symbol, either EnableABIBreakingChecks or
DisableABIBreakingChecks depending on the configuration setting for
LLVM_ABI_BREAKING_CHECKS.

The llvm-config.h header will add weak references to these symbols in
every clients that includes this header. This should ensure that
a mismatch triggers a link failure (or a load time failure for DSO).

On MSVC, the pragma "detect_mismatch" is used instead.

Reviewers: rnk, jroelofs

Subscribers: llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D26841

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287352 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 17:28:10 +00:00
Ehsan Amiri
37f2389c9d [PPC] limit line width to 80 characters
NFC. Forgot to fix this in the original commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 16:24:27 +00:00
Simon Dardis
a60ff0d03c [mips][msa] Implement f16 support
The MIPS MSA ASE provides instructions to convert to and from half precision
floating point. This patch teaches the MIPS backend to treat f16 as a legal
type and how to promote such values to f32 for the usual set of operations.

As a result of this, the fexup[lr].w intrinsics no longer crash LLVM during
type legalization.

Reviewers: zoran.jovanvoic, vkalintiris

Differential Revision: https://reviews.llvm.org/D26398


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287349 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 16:17:44 +00:00
Tom Stellard
eb3384582f GlobalISel: Fix unconditional fallback with global isel abort is disabled
Reviewers: t.p.northover, ab, qcolombet

Subscribers: mehdi_amini, vkalintiris, wdng, dberris, llvm-commits, rovka

Differential Revision: https://reviews.llvm.org/D26765

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287344 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 14:14:35 +00:00
Tom Stellard
a006842d47 AMDGPU/SI: Remove zero_extend patterns for i16 ops selected to 32-bit insts
Summary:
The 32-bit instructions don't zero the high 16-bits like the 16-bit
instructions do.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

Differential Revision: https://reviews.llvm.org/D26828

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 13:53:34 +00:00
Florian Hahn
8a56643640 [simplifycfg][loop-simplify] Preserve loop metadata in 2 transformations.
insertUniqueBackedgeBlock in lib/Transforms/Utils/LoopSimplify.cpp now
propagates existing llvm.loop metadata to newly the added backedge.

llvm::TryToSimplifyUncondBranchFromEmptyBlock in lib/Transforms/Utils/Local.cpp
now propagates existing llvm.loop metadata to the branch instructions in the
predecessor blocks of the empty block that is removed.

Differential Revision: https://reviews.llvm.org/D26495


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287341 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 13:12:07 +00:00
Simon Pilgrim
f482b59d3c Cleanup function with clang-format. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287340 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 12:16:18 +00:00
Nicolai Haehnle
1e27a618c6 AMDGPU: Fix legalization of MUBUF instructions in shaders
Summary:
The addr64-based legalization is incorrect for MUBUF instructions with idxen
set as well as for BUFFER_LOAD/STORE_FORMAT_* instructions.  This affects
e.g.  shaders that access buffer textures.

Since we never actually need the addr64-legalization in shaders, this patch
takes the easy route and keys off the calling convention.  If this ever
affects (non-OpenGL) compute, the type of legalization needs to be chosen
based on some TSFlag.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98664

Reviewers: arsenm, tstellarAMD

Subscribers: kzhuravl, wdng, yaxunl, tony-tye, llvm-commits

Differential Revision: https://reviews.llvm.org/D26747

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287339 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 11:55:52 +00:00
Simon Pilgrim
546b063ba5 Fix spelling mistakes in MIPS target comments. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287338 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 11:53:36 +00:00
Ehsan Amiri
3d73fcad55 [Power9] Add patterns for vnegd, vnegw
Exploit new instructions by adding patterns to .td file.
https://reviews.llvm.org/D26551



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 11:05:55 +00:00
Simon Pilgrim
9f23214cb5 Fix spelling mistakes in AMDGPU target comments. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287333 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 11:04:02 +00:00
Simon Pilgrim
178e833710 Fix typo in comment. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 10:52:12 +00:00
Ehsan Amiri
072e86da0c [PPC][DAGCombine] Convert SETCC to subtract when the result is zero extended
When we see a SETCC whose only users are zero extend operations, we can replace
it with a subtraction. This results in doing all calculations in GPRs and
avoids CR use.

Currently we do this only for ULT, ULE, UGT and UGE condition codes. There are
ways that this can be extended. For example for signed condition codes. In that
case we will be introducing additional sign extend instructions, so more careful
profitability analysis may be required.

Another direction to extend this is for equal, not equal conditions. Also when
users of SETCC are any_ext or sign_ext, we might be able to do something 
similar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 10:41:44 +00:00