[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:06:22 PDT 2018
xbolva00 updated this revision to Diff 144780.
https://reviews.llvm.org/D46259
Files:
lib/Analysis/CFLGraph.h
Index: lib/Analysis/CFLGraph.h
===================================================================
--- lib/Analysis/CFLGraph.h
+++ 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.144780.patch
Type: text/x-patch
Size: 2765 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180501/8196d22c/attachment.bin>
More information about the llvm-commits
mailing list