mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[CFLGraph] Add support for unary fneg instruction.
Differential Revision: https://reviews.llvm.org/D62791 llvm-svn: 362737
This commit is contained in:
parent
10fb6600cd
commit
ade3dc8f75
@ -291,6 +291,11 @@ template <typename CFLAA> class CFLGraphBuilder {
|
||||
addAssignEdge(Op2, &Inst);
|
||||
}
|
||||
|
||||
void visitUnaryOperator(UnaryOperator &Inst) {
|
||||
auto *Src = Inst.getOperand(0);
|
||||
addAssignEdge(Src, &Inst);
|
||||
}
|
||||
|
||||
void visitAtomicCmpXchgInst(AtomicCmpXchgInst &Inst) {
|
||||
auto *Ptr = Inst.getPointerOperand();
|
||||
auto *Val = Inst.getNewValOperand();
|
||||
@ -579,6 +584,11 @@ template <typename CFLAA> class CFLGraphBuilder {
|
||||
break;
|
||||
}
|
||||
|
||||
case Instruction::FNeg: {
|
||||
addAssignEdge(CE->getOperand(0), CE);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
llvm_unreachable("Unknown instruction type encountered!");
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ define void @testr2(double* nocapture readonly %A, double* nocapture readonly %I
|
||||
%1 = load double, double* %arrayidx22
|
||||
%arrayidx25 = getelementptr inbounds double, double* %A, i64 2
|
||||
%2 = load double, double* %arrayidx25
|
||||
%mul26 = fmul double %1, %2
|
||||
%3 = fneg double %1
|
||||
%mul26 = fmul double %3, %2
|
||||
ret void
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user