Chromium Code Reviews| Index: src/IceInst.cpp |
| diff --git a/src/IceInst.cpp b/src/IceInst.cpp |
| index f9cfdddf60c13b41771fd4a9fa80dd6d46edd2db..e869a77f903180eef7b9d330d9eb8dbf1e18dc3a 100644 |
| --- a/src/IceInst.cpp |
| +++ b/src/IceInst.cpp |
| @@ -1085,6 +1085,43 @@ void InstTarget::dump(const Cfg *Func) const { |
| InstBreakpoint::InstBreakpoint(Cfg *Func) |
| : InstHighLevel(Func, Inst::Breakpoint, 0, nullptr) {} |
| +void InstIcmp::invert() { |
| + switch (Condition) { |
| + case Eq: |
|
Jim Stichnoth
2016/07/08 11:45:46
I think this would be cleaner if you encode the in
manasijm
2016/07/08 18:11:40
Done.
|
| + break; |
| + case Ne: |
| + break; |
| + case Sge: |
| + Condition = Sle; |
| + break; |
| + case Sgt: |
| + Condition = Slt; |
| + break; |
| + case Sle: |
| + Condition = Sge; |
| + break; |
| + case Slt: |
| + Condition = Sgt; |
| + break; |
| + case Uge: |
| + Condition = Ule; |
| + break; |
| + case Ugt: |
| + Condition = Ult; |
| + break; |
| + case Ule: |
| + Condition = Uge; |
| + break; |
| + case Ult: |
| + Condition = Ugt; |
| + break; |
| + default: |
| + return; |
| + } |
| + auto *TempOp = getSrc(0); |
| + replaceSource(0, getSrc(1)); |
| + replaceSource(1, TempOp); |
| +} |
| bool checkForRedundantAssign(const Variable *Dest, const Operand *Source) { |
| const auto *SrcVar = llvm::dyn_cast<const Variable>(Source); |
| if (!SrcVar) |