[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Oct 7 17:33:01 PDT 2003
Changes in directory llvm/lib/Transforms/Scalar:
InstructionCombining.cpp updated: 1.126 -> 1.127
---
Log message:
Refactor code a bit
---
Diffs of the changes: (+12 -4)
Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.126 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.127
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.126 Tue Oct 7 10:17:02 2003
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Oct 7 17:32:43 2003
@@ -99,6 +99,7 @@
Instruction *visitInstruction(Instruction &I) { return 0; }
private:
+ Instruction *visitCallSite(CallSite CS);
bool transformConstExprCastCall(CallSite CS);
// InsertNewInstBefore - insert an instruction New before instruction Old
@@ -1581,15 +1582,13 @@
// CallInst simplification
//
Instruction *InstCombiner::visitCallInst(CallInst &CI) {
- if (transformConstExprCastCall(&CI)) return 0;
- return 0;
+ return visitCallSite(&CI);
}
// InvokeInst simplification
//
Instruction *InstCombiner::visitInvokeInst(InvokeInst &II) {
- if (transformConstExprCastCall(&II)) return 0;
- return 0;
+ return visitCallSite(&II);
}
// getPromotedType - Return the specified type promoted as it would be to pass
@@ -1603,6 +1602,15 @@
case Type::FloatTyID: return Type::DoubleTy;
default: return Ty;
}
+}
+
+// visitCallSite - Improvements for call and invoke instructions.
+//
+Instruction *InstCombiner::visitCallSite(CallSite CS) {
+ if (transformConstExprCastCall(CS)) return 0;
+
+
+ return 0;
}
// transformConstExprCastCall - If the callee is a constexpr cast of a function,
More information about the llvm-commits
mailing list