mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 07:24:25 +00:00
Fix Reassociate handling of constant in presence of undef float
http://reviews.llvm.org/D6993 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226245 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -917,10 +917,13 @@ void Reassociate::RewriteExprTree(BinaryOperator *I,
|
||||
/// version of the value is returned, and BI is left pointing at the instruction
|
||||
/// that should be processed next by the reassociation pass.
|
||||
static Value *NegateValue(Value *V, Instruction *BI) {
|
||||
if (ConstantFP *C = dyn_cast<ConstantFP>(V))
|
||||
return ConstantExpr::getFNeg(C);
|
||||
if (Constant *C = dyn_cast<Constant>(V))
|
||||
if (Constant *C = dyn_cast<Constant>(V)) {
|
||||
if (C->getType()->isFPOrFPVectorTy()) {
|
||||
return ConstantExpr::getFNeg(C);
|
||||
}
|
||||
return ConstantExpr::getNeg(C);
|
||||
}
|
||||
|
||||
|
||||
// We are trying to expose opportunity for reassociation. One of the things
|
||||
// that we want to do to achieve this is to push a negation as deep into an
|
||||
|
Reference in New Issue
Block a user