22 lines · plain
1; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s2 3; When the extractelement is converted to a load the store can be re-used.4; This will, however, introduce a cycle into the selection DAG (the load5; of the extractelement index is dependent on the store, and so after the6; conversion it becomes dependent on the new load, which is dependent on7; the index). Make sure we skip the store, and conservatively instead8; use a store to the stack.9 10define float @foo(ptr %i, ptr %v) {11; CHECK-LABEL: foo:12; CHECK: movaps %xmm0, -[[OFFSET:[0-9]+]](%rsp)13; CHECK: movss -[[OFFSET]](%rsp,{{.*}}), %xmm0 {{.*}}14; CHECK-NEXT: retq15 %1 = load <4 x float>, ptr %v, align 1616 %mul = fmul <4 x float> %1, %117 store <4 x float> %mul, ptr %v, align 1618 %2 = load i32, ptr %i, align 419 %vecext = extractelement <4 x float> %mul, i32 %220 ret float %vecext21}22