Deleted Added
full compact
GVN.cpp (193323) GVN.cpp (193574)
1//===- GVN.cpp - Eliminate redundant values and loads ---------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 45 unchanged lines hidden (view full) ---

54// ValueTable Class
55//===----------------------------------------------------------------------===//
56
57/// This class holds the mapping between values and value numbers. It is used
58/// as an efficient mechanism to determine the expression-wise equivalence of
59/// two values.
60namespace {
61 struct VISIBILITY_HIDDEN Expression {
1//===- GVN.cpp - Eliminate redundant values and loads ---------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 45 unchanged lines hidden (view full) ---

54// ValueTable Class
55//===----------------------------------------------------------------------===//
56
57/// This class holds the mapping between values and value numbers. It is used
58/// as an efficient mechanism to determine the expression-wise equivalence of
59/// two values.
60namespace {
61 struct VISIBILITY_HIDDEN Expression {
62 enum ExpressionOpcode { ADD, SUB, MUL, UDIV, SDIV, FDIV, UREM, SREM,
62 enum ExpressionOpcode { ADD, FADD, SUB, FSUB, MUL, FMUL,
63 UDIV, SDIV, FDIV, UREM, SREM,
63 FREM, SHL, LSHR, ASHR, AND, OR, XOR, ICMPEQ,
64 ICMPNE, ICMPUGT, ICMPUGE, ICMPULT, ICMPULE,
65 ICMPSGT, ICMPSGE, ICMPSLT, ICMPSLE, FCMPOEQ,
66 FCMPOGT, FCMPOGE, FCMPOLT, FCMPOLE, FCMPONE,
67 FCMPORD, FCMPUNO, FCMPUEQ, FCMPUGT, FCMPUGE,
68 FCMPULT, FCMPULE, FCMPUNE, EXTRACT, INSERT,
69 SHUFFLE, SELECT, TRUNC, ZEXT, SEXT, FPTOUI,
70 FPTOSI, UITOFP, SITOFP, FPTRUNC, FPEXT,

--- 124 unchanged lines hidden (view full) ---

195//===----------------------------------------------------------------------===//
196// ValueTable Internal Functions
197//===----------------------------------------------------------------------===//
198Expression::ExpressionOpcode ValueTable::getOpcode(BinaryOperator* BO) {
199 switch(BO->getOpcode()) {
200 default: // THIS SHOULD NEVER HAPPEN
201 assert(0 && "Binary operator with unknown opcode?");
202 case Instruction::Add: return Expression::ADD;
64 FREM, SHL, LSHR, ASHR, AND, OR, XOR, ICMPEQ,
65 ICMPNE, ICMPUGT, ICMPUGE, ICMPULT, ICMPULE,
66 ICMPSGT, ICMPSGE, ICMPSLT, ICMPSLE, FCMPOEQ,
67 FCMPOGT, FCMPOGE, FCMPOLT, FCMPOLE, FCMPONE,
68 FCMPORD, FCMPUNO, FCMPUEQ, FCMPUGT, FCMPUGE,
69 FCMPULT, FCMPULE, FCMPUNE, EXTRACT, INSERT,
70 SHUFFLE, SELECT, TRUNC, ZEXT, SEXT, FPTOUI,
71 FPTOSI, UITOFP, SITOFP, FPTRUNC, FPEXT,

--- 124 unchanged lines hidden (view full) ---

196//===----------------------------------------------------------------------===//
197// ValueTable Internal Functions
198//===----------------------------------------------------------------------===//
199Expression::ExpressionOpcode ValueTable::getOpcode(BinaryOperator* BO) {
200 switch(BO->getOpcode()) {
201 default: // THIS SHOULD NEVER HAPPEN
202 assert(0 && "Binary operator with unknown opcode?");
203 case Instruction::Add: return Expression::ADD;
204 case Instruction::FAdd: return Expression::FADD;
203 case Instruction::Sub: return Expression::SUB;
205 case Instruction::Sub: return Expression::SUB;
206 case Instruction::FSub: return Expression::FSUB;
204 case Instruction::Mul: return Expression::MUL;
207 case Instruction::Mul: return Expression::MUL;
208 case Instruction::FMul: return Expression::FMUL;
205 case Instruction::UDiv: return Expression::UDIV;
206 case Instruction::SDiv: return Expression::SDIV;
207 case Instruction::FDiv: return Expression::FDIV;
208 case Instruction::URem: return Expression::UREM;
209 case Instruction::SRem: return Expression::SREM;
210 case Instruction::FRem: return Expression::FREM;
211 case Instruction::Shl: return Expression::SHL;
212 case Instruction::LShr: return Expression::LSHR;

--- 1526 unchanged lines hidden ---
209 case Instruction::UDiv: return Expression::UDIV;
210 case Instruction::SDiv: return Expression::SDIV;
211 case Instruction::FDiv: return Expression::FDIV;
212 case Instruction::URem: return Expression::UREM;
213 case Instruction::SRem: return Expression::SREM;
214 case Instruction::FRem: return Expression::FREM;
215 case Instruction::Shl: return Expression::SHL;
216 case Instruction::LShr: return Expression::LSHR;

--- 1526 unchanged lines hidden ---