[Hexagon] Do not promote terminator instructions in Hexagon loop idioms

llvm-svn: 351369
This commit is contained in:
Krzysztof Parzyszek 2019-01-16 19:40:27 +00:00
parent 86285d2e17
commit 4121eaf0a5
1 changed files with 3 additions and 1 deletions

View File

@ -1001,6 +1001,7 @@ bool PolynomialMultiplyRecognize::isPromotableTo(Value *Val,
void PolynomialMultiplyRecognize::promoteTo(Instruction *In,
IntegerType *DestTy, BasicBlock *LoopB) {
Type *OrigTy = In->getType();
assert(!OrigTy->isVoidTy() && "Invalid instruction to promote");
// Leave boolean values alone.
if (!In->getType()->isIntegerTy(1))
@ -1081,7 +1082,8 @@ bool PolynomialMultiplyRecognize::promoteTypes(BasicBlock *LoopB,
std::transform(LoopB->begin(), LoopB->end(), std::back_inserter(LoopIns),
[](Instruction &In) { return &In; });
for (Instruction *In : LoopIns)
promoteTo(In, DestTy, LoopB);
if (!In->isTerminator())
promoteTo(In, DestTy, LoopB);
// Fix up the PHI nodes in the exit block.
Instruction *EndI = ExitB->getFirstNonPHI();