mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Folding or(fcmp,fcmp) only works if the operands of the fcmps are the same fp type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47750 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bec2c0c7e1
commit
5ebd93630b
@ -4287,7 +4287,8 @@ Instruction *InstCombiner::visitOr(BinaryOperator &I) {
|
|||||||
if (FCmpInst *LHS = dyn_cast<FCmpInst>(I.getOperand(0))) {
|
if (FCmpInst *LHS = dyn_cast<FCmpInst>(I.getOperand(0))) {
|
||||||
if (FCmpInst *RHS = dyn_cast<FCmpInst>(I.getOperand(1))) {
|
if (FCmpInst *RHS = dyn_cast<FCmpInst>(I.getOperand(1))) {
|
||||||
if (LHS->getPredicate() == FCmpInst::FCMP_UNO &&
|
if (LHS->getPredicate() == FCmpInst::FCMP_UNO &&
|
||||||
RHS->getPredicate() == FCmpInst::FCMP_UNO)
|
RHS->getPredicate() == FCmpInst::FCMP_UNO &&
|
||||||
|
LHS->getOperand(0)->getType() == RHS->getOperand(0)->getType())
|
||||||
if (ConstantFP *LHSC = dyn_cast<ConstantFP>(LHS->getOperand(1)))
|
if (ConstantFP *LHSC = dyn_cast<ConstantFP>(LHS->getOperand(1)))
|
||||||
if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) {
|
if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) {
|
||||||
// If either of the constants are nans, then the whole thing returns
|
// If either of the constants are nans, then the whole thing returns
|
||||||
|
16
test/Transforms/InstCombine/2008-02-28-OrFCmpCrash.ll
Normal file
16
test/Transforms/InstCombine/2008-02-28-OrFCmpCrash.ll
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
; RUN: llvm-as < %s | opt -instcombine | llvm-dis
|
||||||
|
; rdar://5771353
|
||||||
|
|
||||||
|
define float @test(float %x, x86_fp80 %y) nounwind readonly {
|
||||||
|
entry:
|
||||||
|
%tmp67 = fcmp uno x86_fp80 %y, 0xK00000000000000000000 ; <i1> [#uses=1]
|
||||||
|
%tmp71 = fcmp uno float %x, 0.000000e+00 ; <i1> [#uses=1]
|
||||||
|
%bothcond = or i1 %tmp67, %tmp71 ; <i1> [#uses=1]
|
||||||
|
br i1 %bothcond, label %bb74, label %bb80
|
||||||
|
|
||||||
|
bb74: ; preds = %entry
|
||||||
|
ret float 0.000000e+00
|
||||||
|
|
||||||
|
bb80: ; preds = %entry
|
||||||
|
ret float 0.000000e+00
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user