|
| 1 | +;=========================== begin_copyright_notice ============================ |
| 2 | +; |
| 3 | +; Copyright (C) 2024 Intel Corporation |
| 4 | +; |
| 5 | +; SPDX-License-Identifier: MIT |
| 6 | +; |
| 7 | +;============================ end_copyright_notice ============================= |
| 8 | +; |
| 9 | +; REQUIRES: llvm-14-plus |
| 10 | +; RUN: igc_opt %s -S -o - --igc-scalarize | FileCheck %s |
| 11 | + |
| 12 | +; Function Attrs: noinline optnone |
| 13 | +define void @test_fneg_optnone(<4 x float> %src, <3 x float> addrspace(1)* %out) #0 { |
| 14 | + |
| 15 | +; CHECK-LABEL: @test_fneg_optnone( |
| 16 | +; |
| 17 | +; CHECK: [[EE0:%.*]] = extractelement <4 x float> %src, i32 0 |
| 18 | +; CHECK: [[EE1:%.*]] = extractelement <4 x float> %src, i32 1 |
| 19 | +; CHECK: [[EE2:%.*]] = extractelement <4 x float> %src, i32 2 |
| 20 | +; CHECK: [[EE3:%.*]] = extractelement <4 x float> %src, i32 3 |
| 21 | +; CHECK: [[IE0:%.*]] = insertelement <3 x float> undef, float [[EE0]], i32 0 |
| 22 | +; CHECK: [[IE1:%.*]] = insertelement <3 x float> [[IE0]], float [[EE1]], i32 1 |
| 23 | +; CHECK: [[IE2:%.*]] = insertelement <3 x float> [[IE1]], float [[EE2]], i32 2 |
| 24 | +; CHECK: [[FNEG:%.*]] = fneg <3 x float> [[IE2]] |
| 25 | +; CHECK: store <3 x float> [[FNEG]], <3 x float> addrspace(1)* %out, align 4 |
| 26 | + |
| 27 | +; CHECK-NOT: fneg <3 x float> undef |
| 28 | + |
| 29 | + %1 = shufflevector <4 x float> %src, <4 x float> undef, <3 x i32> <i32 0, i32 1, i32 2> |
| 30 | + %2 = fneg <3 x float> %1 |
| 31 | + store <3 x float> %2, <3 x float> addrspace(1)* %out, align 4 |
| 32 | + ret void |
| 33 | +} |
| 34 | + |
| 35 | +attributes #0 = { noinline optnone } |
0 commit comments