summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/ScalarEvolution/fold.ll
blob: f46c691f46fd735dc1f285f867b4de7fd68219b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
; RUN: opt -analyze -scalar-evolution %s -S | FileCheck %s

define i16 @test1(i8 %x) {
  %A = zext i8 %x to i12
  %B = sext i12 %A to i16
; CHECK: zext i8 %x to i16
  ret i16 %B
}

define i8 @test2(i8 %x) {
  %A = zext i8 %x to i16
  %B = add i16 %A, 1025
  %C = trunc i16 %B to i8
; CHECK: (1 + %x)
  ret i8 %C
}
OpenPOWER on IntegriCloud