The optimization sequence "-early-cse-memssa -early-cse-memssa" will cause a crash bug for opt tool with any input. This is because that the LegacyPassManager can not correctly process the dependency of the second "-early-cse-memssa".
The "-early-cse-memssa" pass requires analysis pass "Memory SSA" and will preserves it. However, the "-early-cse-memssa" pass can not preserve pass "Function Alias Analysis Results", which is required by pass "Memory SSA" and it will be removed after the first "-early-cse-memssa". Thus, when adding the second "-early-cse-memssa", the LegacyPassManager find that the analysis pass "Memory SSA" is already existed, which causes that the required pass "Function Alias Analysis Results" can not be satisfied for the second "-early-cse-memssa".
PS: This bug has been verified using llvm 6/7 and the truck version.