aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-07-08 21:18:49 +0000
committerChris Lattner <sabre@nondot.org>2001-07-08 21:18:49 +0000
commit0bd654a049490a56b6c39f56acf7c8e634085c23 (patch)
treef7e6ac84f241afd47bffd6a53ee9282526936aa7
parent8b9f7c0a658d5f36636c5f52d49cd2efb339815c (diff)
Implement checking for new instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 43eb26fd30..79d90e6532 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -25,7 +25,7 @@
#include "llvm/iOther.h"
#include "llvm/iTerminators.h"
#include "llvm/Tools/STLExtras.h"
-//#include "llvm/Assembly/Writer.h"
+#include "llvm/Assembly/Writer.h"
#include <algorithm>
#include <map>
#include <set>
@@ -430,7 +430,7 @@ void SCCP::UpdateInstruction(Instruction *I) {
//===-------------------------------------------------------------------===//
// Handle Unary instructions...
//
- if (I->isUnaryOp()) {
+ if (I->isUnaryOp() || I->getOpcode() == Instruction::Cast) {
Value *V = I->getOperand(0);
InstVal &VState = getValueState(V);
if (VState.isOverdefined()) { // Inherit overdefinedness of operand
@@ -456,7 +456,8 @@ void SCCP::UpdateInstruction(Instruction *I) {
//===-----------------------------------------------------------------===//
// Handle Binary instructions...
//
- if (I->isBinaryOp()) {
+ if (I->isBinaryOp() || I->getOpcode() == Instruction::Shl ||
+ I->getOpcode() == Instruction::Shr) {
Value *V1 = I->getOperand(0);
Value *V2 = I->getOperand(1);