Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/Transforms/InstSimplify/ConstProp/bitcast.ll
Show All 11 Lines | |||||
; Ensure that a FP source operand isn't propagated to an icmp. | ; Ensure that a FP source operand isn't propagated to an icmp. | ||||
@a = external global i16, align 1 | @a = external global i16, align 1 | ||||
@b = external global i16, align 1 | @b = external global i16, align 1 | ||||
define i1 @bad_icmp_constexpr_bitcast() { | define i1 @bad_icmp_constexpr_bitcast() { | ||||
; CHECK-LABEL: @bad_icmp_constexpr_bitcast( | ; CHECK-LABEL: @bad_icmp_constexpr_bitcast( | ||||
; CHECK-NEXT: ret i1 icmp eq (i32 ptrtoint (ptr @a to i32), i32 bitcast (float fadd (float bitcast (i32 ptrtoint (ptr @b to i32) to float), float 2.000000e+00) to i32)) | ; CHECK-NEXT: [[FADD:%.*]] = fadd float bitcast (i32 ptrtoint (ptr @b to i32) to float), 2.000000e+00 | ||||
; | ; CHECK-NEXT: [[BITCAST:%.*]] = bitcast float [[FADD]] to i32 | ||||
%cmp = icmp eq i32 ptrtoint (ptr @a to i32), bitcast (float fadd (float bitcast (i32 ptrtoint (ptr @b to i32) to float), float 2.0) to i32) | ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 ptrtoint (ptr @a to i32), [[BITCAST]] | ||||
; CHECK-NEXT: ret i1 [[CMP]] | |||||
; | |||||
%fadd = fadd float bitcast (i32 ptrtoint (ptr @b to i32) to float), 2.0 | |||||
%bitcast = bitcast float %fadd to i32 | |||||
%cmp = icmp eq i32 ptrtoint (ptr @a to i32), %bitcast | |||||
ret i1 %cmp | ret i1 %cmp | ||||
} | } | ||||
; Ensure that an integer source operand isn't propagated to a fcmp. | ; Ensure that an integer source operand isn't propagated to a fcmp. | ||||
@c = external global i16, align 1 | @c = external global i16, align 1 | ||||
@d = external global i16, align 1 | @d = external global i16, align 1 | ||||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |