mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
SROA: The alloca type isn't a candidate promotion type for vectors
The alloca's type is irrelevant, only those types which are used in a load or store of the exact size of the slice should be considered. This manifested as an assertion failure when we compared the various types: we had a size mismatch. This fixes PR21480. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222499 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -394,6 +394,13 @@ static BinaryOperator *LowerNegateToMultiply(Instruction *Neg) {
|
||||
BinaryOperator *Res = CreateMul(Neg->getOperand(1), NegOne, "", Neg, Neg);
|
||||
Neg->setOperand(1, Constant::getNullValue(Ty)); // Drop use of op.
|
||||
Res->takeName(Neg);
|
||||
if (Ty->isIntegerTy()) {
|
||||
bool NSW = cast<BinaryOperator>(Neg)->hasNoSignedWrap();
|
||||
bool NUW = cast<BinaryOperator>(Neg)->hasNoUnsignedWrap();
|
||||
if (NSW || NUW)
|
||||
Res->setHasNoSignedWrap(true);
|
||||
Res->setHasNoUnsignedWrap(NUW);
|
||||
}
|
||||
Neg->replaceAllUsesWith(Res);
|
||||
Res->setDebugLoc(Neg->getDebugLoc());
|
||||
return Res;
|
||||
|
||||
Reference in New Issue
Block a user