[PATCH] D46259: [CFLGraph][NFC] Simplify/reorder switch in visitConstantExpr
Dávid Bolvanský via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 1 14:39:01 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL331312: [CFLGraph][NFC] Simplify/reorder switch in visitConstantExpr (authored by xbolva00, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D46259?vs=144789&id=144792#toc
Repository:
rL LLVM
https://reviews.llvm.org/D46259
Files:
llvm/trunk/lib/Analysis/CFLGraph.h
Index: llvm/trunk/lib/Analysis/CFLGraph.h
===================================================================
--- llvm/trunk/lib/Analysis/CFLGraph.h
+++ llvm/trunk/lib/Analysis/CFLGraph.h
@@ -515,14 +515,16 @@
visitGEP(*GEPOp);
break;
}
+
case Instruction::PtrToInt: {
- auto *Ptr = CE->getOperand(0);
- addNode(Ptr, getAttrEscaped());
+ addNode(CE->getOperand(0), getAttrEscaped());
break;
}
- case Instruction::IntToPtr:
+
+ case Instruction::IntToPtr: {
addNode(CE, getAttrUnknown());
break;
+ }
case Instruction::BitCast:
case Instruction::AddrSpaceCast:
@@ -535,48 +537,23 @@
case Instruction::SIToFP:
case Instruction::FPToUI:
case Instruction::FPToSI: {
- auto *Src = CE->getOperand(0);
- addAssignEdge(Src, CE);
- break;
- }
- case Instruction::Select: {
- auto *TrueVal = CE->getOperand(0);
- auto *FalseVal = CE->getOperand(1);
- addAssignEdge(TrueVal, CE);
- addAssignEdge(FalseVal, CE);
- break;
- }
- case Instruction::InsertElement: {
- auto *Vec = CE->getOperand(0);
- auto *Val = CE->getOperand(1);
- addAssignEdge(Vec, CE);
- addStoreEdge(Val, CE);
- break;
- }
- case Instruction::ExtractElement: {
- auto *Ptr = CE->getOperand(0);
- addLoadEdge(Ptr, CE);
+ addAssignEdge(CE->getOperand(0), CE);
break;
}
+
+ case Instruction::InsertElement:
case Instruction::InsertValue: {
- auto *Agg = CE->getOperand(0);
- auto *Val = CE->getOperand(1);
- addAssignEdge(Agg, CE);
- addStoreEdge(Val, CE);
+ addAssignEdge(CE->getOperand(0), CE);
+ addStoreEdge(CE->getOperand(1), CE);
break;
}
+
+ case Instruction::ExtractElement:
case Instruction::ExtractValue: {
- auto *Ptr = CE->getOperand(0);
- addLoadEdge(Ptr, CE);
- break;
- }
- case Instruction::ShuffleVector: {
- auto *From1 = CE->getOperand(0);
- auto *From2 = CE->getOperand(1);
- addAssignEdge(From1, CE);
- addAssignEdge(From2, CE);
+ addLoadEdge(CE->getOperand(0), CE);
break;
}
+
case Instruction::Add:
case Instruction::Sub:
case Instruction::FSub:
@@ -596,9 +573,12 @@
case Instruction::AShr:
case Instruction::ICmp:
case Instruction::FCmp:
+ case Instruction::Select:
+ case Instruction::ShuffleVector: {
addAssignEdge(CE->getOperand(0), CE);
addAssignEdge(CE->getOperand(1), CE);
break;
+ }
default:
llvm_unreachable("Unknown instruction type encountered!");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46259.144792.patch
Type: text/x-patch
Size: 2798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180501/8ee0deb4/attachment.bin>
More information about the llvm-commits
mailing list