Displaying 4 results from an estimated 4 matches for "gettruncateexpr".
2012 Dec 18
0
[LLVMdev] [PATCH] Teaching ScalarEvolution to handle IV=add(zext(trunc(IV)), Step)
On Tue, Dec 18, 2012 at 9:56 AM, Matthew Curtis <mcurtis at codeaurora.org> wrote:
>
> Here's how I'm evaluating the expression (in my head):
>
> 00: Add(ZeroExtend(Truncate(Minus(AddRec(Start=0,Step=3)[n],3), i8), i32),3)
> |
> 01: Add(ZeroExtend(Truncate(Minus(AddRec(Start=0,Step=3)[0],3), i8), i32),3)
>
2012 Dec 20
2
[LLVMdev] [PATCH] Teaching ScalarEvolution to handle IV=add(zext(trunc(IV)), Step)
...nsw i32 %j.04, 1
11: %cmp = icmp slt i32 %inc, 8000
12: br i1 %cmp, label %for.body, label %for.end
LLVM executes the following:
01: createSCEV(%conv2 = and i32 %result.03, 255)
02: calls getSCEV(%result.03)
03: returns (3 + (zext i8 {-3,+,3}<%for.body> to i32))
04: calls getTruncateExpr((3 + (zext i8 {-3,+,3}<%for.body> to i32)), i8)
05: calls getTruncateExpr(3)
06: returns 3
07: calls getTruncateExpt((zext i8 {-3,+,3}<%for.body> to i32))
08: returns {-3,+,3}<%for.body>
09: returns {0,+,3}<%for.body>
10: calls getZeroE...
2012 Dec 18
2
[LLVMdev] [PATCH] Teaching ScalarEvolution to handle IV=add(zext(trunc(IV)), Step)
Dan,
Thanks for the response ...
On 12/17/2012 1:53 PM, Dan Gohman wrote:
> On Mon, Dec 10, 2012 at 2:13 PM, Matthew Curtis <mcurtis at codeaurora.org> wrote:
>> Hello all,
>>
>> I wanted to get some feedback on this patch for ScalarEvolution.
>>
>> It addresses a performance problem I am seeing for simple benchmark.
>>
>> Starting with this C
2012 Dec 10
3
[LLVMdev] [PATCH] Teaching ScalarEvolution to handle IV=add(zext(trunc(IV)), Step)
...*V, Type *Ty) {
+ Type *SrcTy = V->getType();
+ assert((SrcTy->isIntegerTy() || SrcTy->isPointerTy()) &&
+ (Ty->isIntegerTy() || Ty->isPointerTy()) &&
+ "Cannot truncate and zero extend with non-integer arguments!");
+ const SCEV *trunc = getTruncateExpr(V, Ty);
+ const SCEV *zext = getZeroExtendExpr(trunc, V->getType());
+ return zext;
+}
+
/// getTruncateOrZeroExtend - Return a SCEV corresponding to a conversion of the
/// input value to the specified type. If the type must be extended, it is zero
/// extended.
@@ -3029,13 +3040,22 @@ co...