private void movePropagate() {
    for (int i = 0; i < ssaMeth.getRegCount(); i++) {
      SsaInsn insn = ssaMeth.getDefinitionForRegister(i);

      // Look for move instructions only
      if (insn == null || insn.getOpcode() == null || insn.getOpcode().getOpcode() != RegOps.MOVE) {
        continue;
      }

      final ArrayList<SsaInsn>[] useList = ssaMeth.getUseListCopy();
      final RegisterSpec source = insn.getSources().get(0);
      final RegisterSpec result = insn.getResult();

      // Ignore moves that weren't added due to scalar replacement
      if (source.getReg() < regCount && result.getReg() < regCount) {
        continue;
      }

      // Create a mapping from source to result
      RegisterMapper mapper =
          new RegisterMapper() {
            @Override
            public int getNewRegisterCount() {
              return ssaMeth.getRegCount();
            }

            @Override
            public RegisterSpec map(RegisterSpec registerSpec) {
              if (registerSpec.getReg() == result.getReg()) {
                return source;
              }

              return registerSpec;
            }
          };

      // Modify all uses of the move to use the source of the move instead
      for (SsaInsn use : useList[result.getReg()]) {
        use.mapSourceRegisters(mapper);
      }
    }
  }
Identifies extra moves added by scalar replacement and propagates the source of the move to any
users of the result.
android/android_framework/dex-maker/src/main/java/com/android/dx/ssa/EscapeAnalysis.java