Allow cast instructions within scops
Cast instruction do not have side effects and can consequently be part of a scop. We special cased them earlier, as they may be problematic within array subscripts or loop bounds. However, the scalar evolution validator already checks for them such that there is no need to also check the instructions within the basic blocks. Checking them is actually overly conservative as the precence of casts may invalidate a scop, even though scalar evolution is not influenced by it. llvm-svn: 160261
This commit is contained in:
parent
4968e45b9f
commit
25184fe925
|
@ -324,10 +324,6 @@ bool ScopDetection::isValidInstruction(Instruction &Inst,
|
|||
}
|
||||
|
||||
if (!Inst.mayWriteToMemory() && !Inst.mayReadFromMemory()) {
|
||||
// Handle cast instruction.
|
||||
if (isa<IntToPtrInst>(Inst) || isa<BitCastInst>(Inst))
|
||||
INVALID(Other, "Cast instruction: " << Inst);
|
||||
|
||||
if (isa<AllocaInst>(Inst))
|
||||
INVALID(Other, "Alloca instruction: " << Inst);
|
||||
|
||||
|
|
Loading…
Reference in New Issue