summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-08-14 17:53:45 +0000
committerChris Lattner <sabre@nondot.org>2002-08-14 17:53:45 +0000
commit6e1a1b1289fb899fbdad98b4b2de9d12ff14c48f (patch)
tree982ea0256cae6038afd9796a671457f04cf9b49d /llvm/lib/Transforms
parent3733c7374ec71c4201bc1be53e20310834abe8c1 (diff)
downloadbcm5719-llvm-6e1a1b1289fb899fbdad98b4b2de9d12ff14c48f.tar.gz
bcm5719-llvm-6e1a1b1289fb899fbdad98b4b2de9d12ff14c48f.zip
Remove support for unary operators
llvm-svn: 3318
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/SCCP.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index b721ca0965c..c284b0d0429 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -179,8 +179,7 @@ private:
void visitReturnInst(ReturnInst &I) { /*does not have an effect*/ }
void visitTerminatorInst(TerminatorInst &TI);
- void visitUnaryOperator(Instruction &I);
- void visitCastInst(CastInst &I) { visitUnaryOperator(I); }
+ void visitCastInst(CastInst &I);
void visitBinaryOperator(Instruction &I);
void visitShiftInst(ShiftInst &I) { visitBinaryOperator(I); }
@@ -478,15 +477,14 @@ void SCCP::visitTerminatorInst(TerminatorInst &TI) {
}
}
-void SCCP::visitUnaryOperator(Instruction &I) {
+void SCCP::visitCastInst(CastInst &I) {
Value *V = I.getOperand(0);
InstVal &VState = getValueState(V);
if (VState.isOverdefined()) { // Inherit overdefinedness of operand
markOverdefined(&I);
} else if (VState.isConstant()) { // Propogate constant value
- Constant *Result = isa<CastInst>(I)
- ? ConstantFoldCastInstruction(VState.getConstant(), I.getType())
- : ConstantFoldUnaryInstruction(I.getOpcode(), VState.getConstant());
+ Constant *Result =
+ ConstantFoldCastInstruction(VState.getConstant(), I.getType());
if (Result) {
// This instruction constant folds!
OpenPOWER on IntegriCloud