File: 2007-03-27-PR1280.ll

package info (click to toggle)
llvm 2.6-9.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 57,604 kB
  • ctags: 44,336
  • sloc: cpp: 344,766; sh: 12,407; ansic: 10,617; ada: 3,070; ml: 2,505; perl: 2,496; makefile: 1,426; pascal: 1,163; exp: 389; asm: 307; python: 298; objc: 260; lisp: 182; csh: 117; xml: 38; f90: 36; tcl: 20
file content (15 lines) | stat: -rw-r--r-- 756 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; PR1280 - we should be able to reduce this function to a trunc/sext but it
;          would involve using a bit width (24) that doesn't match a size that
;          the back end can handle. This test makes sure that such a transform
;          is not done. It should be removed when code gen supports "funny"
;          bit widths.

; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {add i49.*-8388608}

define i49 @test5(i49 %x) {
        ;; If we have ADD(XOR(AND(X, 0xFF), 0x80), 0xF..F80), it's a sext.
        %X = and i49 %x, 16777215                     ; 0x0000000ffffff
        %tmp.2 = xor i49 %X, 8388608                  ; 0x0000000800000
        %tmp.4 = add i49 %tmp.2, -8388608             ; 0x1FFFFFF800000
        ret i49 %tmp.4
}