[llvm] r362737 - [CFLGraph] Add support for unary fneg instruction.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 6 12:21:23 PDT 2019
Author: ctopper
Date: Thu Jun 6 12:21:23 2019
New Revision: 362737
URL: http://llvm.org/viewvc/llvm-project?rev=362737&view=rev
Log:
[CFLGraph] Add support for unary fneg instruction.
Differential Revision: https://reviews.llvm.org/D62791
Modified:
llvm/trunk/lib/Analysis/CFLGraph.h
llvm/trunk/test/Analysis/CFLAliasAnalysis/Steensgaard/must-and-partial.ll
Modified: llvm/trunk/lib/Analysis/CFLGraph.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CFLGraph.h?rev=362737&r1=362736&r2=362737&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CFLGraph.h (original)
+++ llvm/trunk/lib/Analysis/CFLGraph.h Thu Jun 6 12:21:23 2019
@@ -291,6 +291,11 @@ template <typename CFLAA> class CFLGraph
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 CFLGraph
break;
}
+ case Instruction::FNeg: {
+ addAssignEdge(CE->getOperand(0), CE);
+ break;
+ }
+
default:
llvm_unreachable("Unknown instruction type encountered!");
}
Modified: llvm/trunk/test/Analysis/CFLAliasAnalysis/Steensgaard/must-and-partial.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CFLAliasAnalysis/Steensgaard/must-and-partial.ll?rev=362737&r1=362736&r2=362737&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/CFLAliasAnalysis/Steensgaard/must-and-partial.ll (original)
+++ llvm/trunk/test/Analysis/CFLAliasAnalysis/Steensgaard/must-and-partial.ll Thu Jun 6 12:21:23 2019
@@ -49,6 +49,7 @@ define void @testr2(double* nocapture re
%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
}
More information about the llvm-commits
mailing list