summaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/load3.ll
blob: 9c87316ece8049947d30a966234e26970210472d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
; RUN: opt < %s -instcombine -S | 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
}
OpenPOWER on IntegriCloud