anchor.diff:      return (combinedType == value.instructionType) ? value : node;
     }
   
  +  void simplifyCondition(HBasicBlock block,
  +                         HInstruction condition,
  +                         bool value) {
  +    condition.dominatedUsers(block.first).forEach((user) {
  +      HInstruction newCondition = graph.addConstantBool(value, compiler);
  +      user.changeUse(condition, newCondition);
  +    });
  +  }
  +
     HInstruction visitIf(HIf node) {
       HInstruction condition = node.condition;
       if (condition.isConstant()) return node;
       bool isNegated = condition is HNot;
  -    if (isNegated) condition = condition.inputs[0];
  -
  -    condition.dominatedUsers(node.thenBlock.first).forEach((user) {
  -      HInstruction newCondition = graph.addConstantBool(!isNegated, compiler);
  -      user.changeUse(condition, newCondition);
  -    });
  -    condition.dominatedUsers(node.elseBlock.first).forEach((user) {
  -      HInstruction newCondition = graph.addConstantBool(isNegated, compiler);
  -      user.changeUse(condition, newCondition);
  -    });
  +
  +    if (isNegated) {
  +      condition = condition.inputs[0];
  +    } else {
  +      // It is possible for LICM to move a negated version of the
  +      // condition out of the loop where it used. We still want to
  +      // simplify the nested use of the condition in that case, so
  +      // we look for all dominating negated conditions and replace
  +      // nested uses of them with true or false.
  +      Iterable<HInstruction> dominating = condition.usedBy.where((user) =>
  +          user is HNot && user.dominates(node));
  +      dominating.forEach((hoisted) {
  +        simplifyCondition(node.thenBlock, hoisted, false);
  +        simplifyCondition(node.elseBlock, hoisted, true);
  +      });
  +    }
  +    simplifyCondition(node.thenBlock, condition, !isNegated);
  +    simplifyCondition(node.elseBlock, condition, isNegated);
       return node;
     }
   
  
positive.code:            && instruction.usedBy.isEmpty
             && instruction is !HTypeGuard
             && instruction is !HParameterValue
             && instruction is !HLocalSet
             && !instruction.isControlFlow();
    }
  
    void visitGraph(HGraph graph) {
      visitPostDominatorTree(graph);
    }
  
    void visitBasicBlock(HBasicBlock block) {
      HInstruction instruction = block.last;
      while (instruction != null) {
        var previous = instruction.previous;
        if (isDeadCode(instruction)) block.remove(instruction);
  
negative.code: class SsaDeadCodeEliminator extends HGraphVisitor implements OptimizationPhase {
    final String name = "SsaDeadCodeEliminator";
  
    Set<HBasicBlock> liveBlocks;
    SsaDeadCodeEliminator();
  
    bool isDeadCode(HInstruction instruction) {
  