Files
clang-p2996/llvm/test/CodeGen/DirectX/fneg-conversion.ll
Chris Bieneman 6599fdab2c Add DXILPrepare CodeGen pass
The DXIL Prepare pass handles the IR mutations required to convert
modern LLVM IR into something that more closely resembles LLVM-3.7 IR
so that the DXIL bitcode writer can emit 3.7 IR.

This change adds the codegen pass handling the first two IR
transformations:

* stripping new function attributes
* converting fneg into fsub

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D122081
2022-04-05 11:50:07 -05:00

15 lines
326 B
LLVM

; RUN: llc %s --filetype=asm -o - | FileCheck %s
target triple = "dxil-unknown-unknown"
define float @negateF(float %0) {
; CHECK: %2 = fsub float -0.000000e+00, %0
%2 = fneg float %0
ret float %2
}
define double @negateD(double %0) {
; CHECK: %2 = fsub double -0.000000e+00, %0
%2 = fneg double %0
ret double %2
}