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:
Tobias Grosser 2012-07-16 10:57:32 +00:00
parent 4968e45b9f
commit 25184fe925
1 changed files with 0 additions and 4 deletions

View File

@ -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);