1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/CodeGen
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
..
AArch64 [SVE] Add checks for no warnings in SVE tests 2020-06-18 13:18:01 +01:00
AMDGPU AMDGPU: Don't use 16-bit FP inline constants in integer operands 2020-06-17 19:14:10 -04:00
ARC
ARM [ARM] Moving CMSE handling of half arguments and return to the backend 2020-06-18 13:16:29 +01:00
AVR [AVR] Fix miscompilation of zext + add 2020-06-18 16:51:37 +02:00
BPF [BPF] fix a bug for BTF pointee type pruning 2020-06-17 15:13:46 -07:00
Generic [LLParser] Delete temp CallInst when error occurs 2020-06-16 11:41:25 +08:00
Hexagon
Inputs
Lanai
Mips
MIR
MSP430
NVPTX
PowerPC [PowerPC] Don't convert Loop to CTR Loop for fp128 BinaryOperator 2020-06-18 02:54:19 +00:00
RISCV [RISCV64] Emit correct lib call for fp(float/double) to ui/si 2020-06-18 19:34:16 +05:30
SPARC
SystemZ [SystemZ] Bugfix in storeLoadCanUseBlockBinary(). 2020-06-17 09:49:31 +02:00
Thumb
Thumb2 [ARM] Supporting lowering of half-precision FP arguments and returns in AArch32's backend 2020-06-18 13:15:13 +01:00
VE
WebAssembly [WebAssembly] MC: Fix for data aliases with offsets (getelementptr) 2020-06-17 16:25:50 -07:00
WinCFGuard
WinEH
X86 [X86][SSE] Fold MOVMSK(PCMPEQ(X,0)) == -1 -> PTESTZ(X,X) 2020-06-18 15:38:32 +01:00
XCore