aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/load3.ll
blob: e102d39e015d3a3742642f23baf9211b65e2dac4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep load | count 1

; Instcombine should be able to do trivial CSE of loads.

declare void @use(double %n)
define void @bar(double* %p) {
  %t0 = getelementptr double* %p, i32 1
  %y = load double* %t0
  %t1 = getelementptr double* %p, i32 1
  %x = load double* %t1
  call void @use(double %x)
  call void @use(double %y)
  ret void
}