mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-09 22:04:10 +00:00
AMDGPU: Turn class x, p_zero|n_zero into fcmp oeq x, 0
The library does use this for some reason. llvm-svn: 339461
This commit is contained in:
parent
bf1675a1c4
commit
54e5db21e4
@ -3195,6 +3195,15 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
||||
return replaceInstUsesWith(*II, FCmp);
|
||||
}
|
||||
|
||||
if (Mask == (N_ZERO | P_ZERO)) {
|
||||
// Equivalent of == 0.
|
||||
Value *FCmp = Builder.CreateFCmpOEQ(
|
||||
Src0, ConstantFP::get(Src0->getType(), 0.0));
|
||||
|
||||
FCmp->takeName(II);
|
||||
return replaceInstUsesWith(*II, FCmp);
|
||||
}
|
||||
|
||||
const ConstantFP *CVal = dyn_cast<ConstantFP>(Src0);
|
||||
if (!CVal) {
|
||||
if (isa<UndefValue>(Src0))
|
||||
|
@ -457,6 +457,13 @@ define i1 @test_class_isnan_f32(float %x) nounwind {
|
||||
ret i1 %val
|
||||
}
|
||||
|
||||
; CHECK-LABEL: @test_class_is_p0_n0_f32(
|
||||
; CHECK: %val = fcmp oeq float %x, 0.000000e+00
|
||||
define i1 @test_class_is_p0_n0_f32(float %x) nounwind {
|
||||
%val = call i1 @llvm.amdgcn.class.f32(float %x, i32 96)
|
||||
ret i1 %val
|
||||
}
|
||||
|
||||
; CHECK-LABEL: @test_constant_class_snan_test_snan_f64(
|
||||
; CHECK: ret i1 true
|
||||
define i1 @test_constant_class_snan_test_snan_f64() nounwind {
|
||||
|
Loading…
x
Reference in New Issue
Block a user