Remove support for the fptrunc, fpext, fptoui, fptosi, uitofp and sitofp constant expressions. All places creating them have been removed beforehand, so this just removes the APIs and uses of these constant expressions in tests. With this, the only remaining FP operation that still has constant expression support is fcmp. This is part of https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179.
22 lines
913 B
LLVM
22 lines
913 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt -passes=instcombine -S %s | FileCheck %s
|
|
|
|
@g1 = external global i16
|
|
@g2 = external global i16
|
|
|
|
define float @patatino() {
|
|
; CHECK-LABEL: @patatino(
|
|
; CHECK-NEXT: [[UITOFP1:%.*]] = uitofp i1 icmp eq (ptr getelementptr inbounds (i16, ptr @g2, i64 1), ptr @g1) to float
|
|
; CHECK-NEXT: [[UITOFP2:%.*]] = uitofp i1 icmp eq (ptr getelementptr inbounds (i16, ptr @g2, i64 1), ptr @g1) to float
|
|
; CHECK-NEXT: [[FMUL:%.*]] = fmul float [[UITOFP1]], [[UITOFP2]]
|
|
; CHECK-NEXT: ret float [[FMUL]]
|
|
;
|
|
%uitofp1 = uitofp i1 icmp eq (ptr getelementptr inbounds (i16, ptr @g2, i64 1), ptr @g1) to float
|
|
%uitofp2 = uitofp i1 icmp eq (ptr getelementptr inbounds (i16, ptr @g2, i64 1), ptr @g1) to float
|
|
%fmul = fmul float %uitofp1, %uitofp2
|
|
%call = call float @fabsf(float %fmul)
|
|
ret float %call
|
|
}
|
|
|
|
declare float @fabsf(float)
|