llvm.org GIT mirror llvm / 73f565e
Add a missing SCEV simplification sext(zext x) --> zext x. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123832 91177308-0d34-0410-b5e6-96231b3b80d8 Nick Lewycky 9 years ago
2 changed file(s) with 12 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
992992 // sext(sext(x)) --> sext(x)
993993 if (const SCEVSignExtendExpr *SS = dyn_cast(Op))
994994 return getSignExtendExpr(SS->getOperand(), Ty);
995
996 // sext(zext(x)) --> zext(x)
997 if (const SCEVZeroExtendExpr *SZ = dyn_cast(Op))
998 return getZeroExtendExpr(SZ->getOperand(), Ty);
995999
9961000 // Before doing any expensive analysis, check to see if we've already
9971001 // computed a SCEV for this Op and Ty.
0 ; RUN: opt -analyze -scalar-evolution %s -S | FileCheck %s
1
2 define i16 @test(i8 %x) {
3 %A = zext i8 %x to i12
4 %B = sext i12 %A to i16
5 ; CHECK: zext i8 %x to i16
6 ret i16 %B
7 }