| ; RUN: llc -O2 -mtriple=i686-- < %s | FileCheck %s |
| define ptr @fooOptnone(ptr %p, ptr %q, ptr %z) #0 { |
| %t2 = getelementptr i32, ptr %y, i32 1 |
| %t3 = getelementptr i32, ptr %t2, i32 %t1 |
| ; 'optnone' should use fast-isel which will not produce 'lea'. |
| ; CHECK-LABEL: fooOptnone: |
| define ptr @fooNormal(ptr %p, ptr %q, ptr %z) #1 { |
| %t2 = getelementptr i32, ptr %y, i32 1 |
| %t3 = getelementptr i32, ptr %t2, i32 %t1 |
| ; Normal ISel will produce 'lea'. |
| ; CHECK-LABEL: fooNormal: |
| attributes #0 = { nounwind optnone noinline } |
| attributes #1 = { nounwind } |