Commit f5198926 authored by juanrod2's avatar juanrod2 Committed by Paige, Alexander

Removal of invalid instances of InsertPointGuard in PeepholeTypeLegalizer....

Removal of invalid instances of InsertPointGuard in PeepholeTypeLegalizer. InsertPointGuard can be set into an instruction which gets removed, causing a crash when InsertPoint tries to restore to that removed instruction

Change-Id: I15c13799f6baa0959960af31e965231164a88390
parent 15bb1245
......@@ -116,7 +116,6 @@ void PeepholeTypeLegalizer::visitInstruction(Instruction &I) {
return; // Legalization for int types only or for extractelements
IRBuilder<>::InsertPointGuard Guard(*m_builder);
//Depending on the phase of legalization pass, call appropriate function
......@@ -158,8 +157,6 @@ void PeepholeTypeLegalizer::legalizePhiInstruction(Instruction &I)
PHINode* oldPhi = dyn_cast<PHINode>(&I);
Value* result;
// Make sure m_builder's insert point is unchanged once this func returns
IRBuilder<>::InsertPointGuard Guard(*m_builder);
if (quotient > 1)
unsigned numElements = I.getType()->isVectorTy() ? I.getType()->getVectorNumElements() : 1;
......@@ -260,7 +257,6 @@ void PeepholeTypeLegalizer::legalizeExtractElement(Instruction &I)
auto bitwidth = Index->getType()->getIntegerBitWidth();
if (!isLegalInteger(bitwidth) || bitwidth == 64)
IRBuilder<>::InsertPointGuard Guard(*m_builder);
Value* operand1 = NULL;
......@@ -484,9 +480,6 @@ void PeepholeTypeLegalizer::legalizeUnaryInstruction(Instruction &I) {
if (isLegalInteger(DL->getPointerTypeSizeInBits(I.getType())) || DL->getPointerTypeSizeInBits(I.getType()) == 1)
/*IRBuilder<>::InsertPointGuard Guard(*m_builder);
unsigned quotient, promoteToInt, Src1width = DL->getPointerTypeSizeInBits(I.getType());
promoteInt(Src1width, quotient, promoteToInt, 8);// byte level addressing
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment