Displaying 7 results from an estimated 7 matches for "minus1".
Did you mean:
minus
2017 Sep 13
2
How to add optimizations to InstCombine correctly?
...returned from
visitMul should replace the original Instruction in the Worklist.
However, I end up in an infinite loop and the Instruction I try to
replace gets scheduled again and again. What is wrong in my code?
// Replace X * (2^C+/-1) with (X << C) -/+ X
APInt Plus1 = *IVal + 1;
APInt Minus1 = *IVal - 1;
int isPow2 = Plus1.isPowerOf2() ? 1 : Minus1.isPowerOf2() ? -1 : 0;
if (isPow2) {
APInt &Pow2 = isPow2 > 0 ? Plus1 : Minus1;
Value *Shl = Builder.CreateShl(Op0, Pow2.logBase2());
return BinaryOperator::Create(isPow2 > 0 ? BinaryOperator::Sub :
BinaryOperator::Add,...
2017 Sep 13
3
How to add optimizations to InstCombine correctly?
...l Instruction in the Worklist.
>> However, I end up in an infinite loop and the Instruction I try to
>> replace gets scheduled again and again. What is wrong in my code?
>>
>> // Replace X * (2^C+/-1) with (X << C) -/+ X
>> APInt Plus1 = *IVal + 1;
>> APInt Minus1 = *IVal - 1;
>> int isPow2 = Plus1.isPowerOf2() ? 1 : Minus1.isPowerOf2() ? -1 : 0;
>>
>> if (isPow2) {
>> APInt &Pow2 = isPow2 > 0 ? Plus1 : Minus1;
>> Value *Shl = Builder.CreateShl(Op0, Pow2.logBase2());
>> return BinaryOperator::Create(isPow2...
2017 Sep 14
3
How to add optimizations to InstCombine correctly?
...infinite loop and the Instruction I
> try to
> replace gets scheduled again and again. What is wrong in my
> code?
>
> // Replace X * (2^C+/-1) with (X << C) -/+ X
> APInt Plus1 = *IVal + 1;
> APInt Minus1 = *IVal - 1;
> int isPow2 = Plus1.isPowerOf2() ? 1 : Minus1.isPowerOf2() ?
> -1 : 0;
>
> if (isPow2) {
> APInt &Pow2 = isPow2 > 0 ? Plus1 : Minus1;
> Value *Shl = Builder.CreateShl(Op0, Pow2.logBase2());
&...
2017 Sep 16
2
How to add optimizations to InstCombine correctly?
...I
> > try to
> > replace gets scheduled again and again. What is wrong in my
> > code?
> >
> > // Replace X * (2^C+/-1) with (X << C) -/+ X
> > APInt Plus1 = *IVal + 1;
> > APInt Minus1 = *IVal - 1;
> > int isPow2 = Plus1.isPowerOf2() ? 1 : Minus1.isPowerOf2() ?
> > -1 : 0;
> >
> > if (isPow2) {
> > APInt &Pow2 = isPow2 > 0 ? Plus1 : Minus1;
> > Value *Shl = Builder.Creat...
2017 Sep 19
0
How to add optimizations to InstCombine correctly?
...replace gets scheduled again and again. What is
>> wrong in my
>> > code?
>> >
>> > // Replace X * (2^C+/-1) with (X << C) -/+ X
>> > APInt Plus1 = *IVal + 1;
>> > APInt Minus1 = *IVal - 1;
>> > int isPow2 = Plus1.isPowerOf2() ? 1 :
>> Minus1.isPowerOf2() ?
>> > -1 : 0;
>> >
>> > if (isPow2) {
>> > APInt &Pow2 = isPow2 > 0 ? Plus1 : Minus1;...
2017 Sep 19
0
How to add optimizations to InstCombine correctly?
...replace gets scheduled again and again. What is
>> wrong in my
>> > code?
>> >
>> > // Replace X * (2^C+/-1) with (X << C) -/+ X
>> > APInt Plus1 = *IVal + 1;
>> > APInt Minus1 = *IVal - 1;
>> > int isPow2 = Plus1.isPowerOf2() ? 1 :
>> Minus1.isPowerOf2() ?
>> > -1 : 0;
>> >
>> > if (isPow2) {
>> > APInt &Pow2 = isPow2 > 0 ? Plus1 : Minus1;...
2017 Sep 19
5
How to add optimizations to InstCombine correctly?
...and again. What is
> >> wrong in my
> >> > code?
> >> >
> >> > // Replace X * (2^C+/-1) with (X << C) -/+ X
> >> > APInt Plus1 = *IVal + 1;
> >> > APInt Minus1 = *IVal - 1;
> >> > int isPow2 = Plus1.isPowerOf2() ? 1 :
> >> Minus1.isPowerOf2() ?
> >> > -1 : 0;
> >> >
> >> > if (isPow2) {
> >> > APInt &Pow2 = i...