1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
Go to file
Ayke van Laethem 283f599fca [AVR] Fix miscompilation of zext + add
Code like the following:

    define i32 @foo(i32 %a, i1 zeroext %b) addrspace(1) {
    entry:
      %conv = zext i1 %b to i32
      %add = add nsw i32 %conv, %a
      ret i32 %add
    }

Would compile to the following (incorrect) code:

    foo:
        mov     r18, r20
        clr     r19
        add     r22, r18
        adc     r23, r19
        sbci    r24, 0
        sbci    r25, 0
        ret

Those sbci instructions are clearly wrong, they should have been adc
instructions.

This commit improves codegen to use adc instead:

    foo:
        mov     r18, r20
        clr     r19
        ldi     r20, 0
        ldi     r21, 0
        add     r22, r18
        adc     r23, r19
        adc     r24, r20
        adc     r25, r21
        ret

This code is not optimal (it could be just 5 instructions instead of the
current 9) but at least it doesn't miscompile.

Differential Revision: https://reviews.llvm.org/D78439
2020-06-18 16:51:37 +02:00
benchmarks
bindings Fix go bindings after FixedVectorType -> VectorType change. 2020-05-15 16:37:57 -07:00
cmake Revert "[llvm] Added support for stand-alone cmake object libraries." 2020-06-15 12:15:39 -07:00
docs [llvm][docs] Document the LLVM_INSTALL_UTILS CMake option (NFC) 2020-06-18 15:31:13 +02:00
examples StoreInst should store Align, not MaybeAlign 2020-05-15 12:26:58 -07:00
include [MC] Pass down argv0 & cc1 cmd-line to the back-end and store in MCTargetOptions 2020-06-18 09:17:14 -04:00
lib [AVR] Fix miscompilation of zext + add 2020-06-18 16:51:37 +02:00
projects Add few docs and implementation of strcpy and strcat. 2019-10-04 17:30:54 +00:00
resources
runtimes [CMake][runtimes] Skip adding 2nd set of the same variables for a generic target 2020-06-15 09:59:27 +02:00
test [AVR] Fix miscompilation of zext + add 2020-06-18 16:51:37 +02:00
tools [llvm-readobj] set --elf-cg-profile as alias of --cg-profile 2020-06-17 11:24:45 -07:00
unittests [llvm] [CommandLine] Do not suggest really hidden opts in nearest lookup 2020-06-17 19:00:26 +02:00
utils [lit] Avoid re-iterating result codes in different places 2020-06-17 11:40:19 -07:00
.clang-format
.clang-tidy - Update .clang-tidy to ignore parameters of main like functions for naming violations in clang and llvm directory 2020-01-31 16:49:45 +00:00
.gitattributes Fix the "git modified" issue on the preserve-comments-crlf.s. 2019-09-10 12:17:49 +00:00
.gitignore Continue removing llgo. 2020-02-10 10:33:58 -08:00
CMakeLists.txt Automatically configure MLIR when flang is enabled 2020-05-27 07:31:49 +00:00
CODE_OWNERS.TXT Make myself code owner of InferAddressSpaces 2020-06-08 21:26:01 -04:00
configure
CREDITS.TXT
LICENSE.TXT
llvm.spec.in
LLVMBuild.txt
README.txt Test commit. 2020-03-14 18:08:26 -07:00
RELEASE_TESTERS.TXT

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.