diff --git a/llvm/lib/Transforms/LevelRaise.cpp b/llvm/lib/Transforms/LevelRaise.cpp index 54a2930fc0d4..1defda4d8453 100644 --- a/llvm/lib/Transforms/LevelRaise.cpp +++ b/llvm/lib/Transforms/LevelRaise.cpp @@ -68,7 +68,9 @@ static bool HandleCastToPointer(BasicBlock::iterator BI, for (Value::use_iterator I = CI.use_begin(), E = CI.use_end(); I != E; ++I) { if (BinaryOperator *BO = dyn_cast(*I)) { - if (BO->getOpcode() != Instruction::Add) + if (BO->getOpcode() != Instruction::Add || + // Avoid add sbyte* %X, %X cases... + BO->getOperand(0) == BO->getOperand(1)) return false; } else { return false;