Remove support for the icmp and fcmp constant expressions. This is part of: https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179 As usual, many of the updated tests will no longer test what they were originally intended to -- this is hard to preserve when constant expressions get removed, and in many cases just impossible as the existence of a specific kind of constant expression was the cause of the issue in the first place.
22 lines
697 B
LLVM
22 lines
697 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: [[CMP:%.*]] = icmp eq ptr getelementptr inbounds (i8, ptr @g2, i64 2), @g1
|
|
; CHECK-NEXT: [[FMUL:%.*]] = uitofp i1 [[CMP]] to float
|
|
; CHECK-NEXT: ret float [[FMUL]]
|
|
;
|
|
%cmp = icmp eq ptr getelementptr inbounds (i16, ptr @g2, i64 1), @g1
|
|
%uitofp1 = uitofp i1 %cmp to float
|
|
%uitofp2 = uitofp i1 %cmp to float
|
|
%fmul = fmul float %uitofp1, %uitofp2
|
|
%call = call float @fabsf(float %fmul)
|
|
ret float %call
|
|
}
|
|
|
|
declare float @fabsf(float)
|