mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
Fix a bug in InstCombine where it attempted to cast a Value* to an Instruction*
when it was actually a Constant*. There are quite a few other casts to Instruction that might have the same problem, but this is the only one I have a test case for. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191668 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -519,10 +519,10 @@ Instruction *InstCombiner::visitFMul(BinaryOperator &I) {
|
||||
if (Opnd0->hasOneUse()) {
|
||||
// -X * Y => -(X*Y) (Promote negation as high as possible)
|
||||
Value *T = Builder->CreateFMul(N0, Opnd1);
|
||||
cast<Instruction>(T)->setDebugLoc(I.getDebugLoc());
|
||||
Instruction *Neg = BinaryOperator::CreateFNeg(T);
|
||||
if (I.getFastMathFlags().any()) {
|
||||
cast<Instruction>(T)->copyFastMathFlags(&I);
|
||||
if (Instruction *TI = dyn_cast<Instruction>(T))
|
||||
TI->copyFastMathFlags(&I);
|
||||
Neg->copyFastMathFlags(&I);
|
||||
}
|
||||
return Neg;
|
||||
|
Reference in New Issue
Block a user