Displaying 10 results from an estimated 10 matches for "plus1".
Did you mean:
plus
2019 Oct 05
4
should base R have a piping operator ?
...* The variable assigned to must be on the right
* It doesn't trigger indentation when going to the line
* It creates/overwrite a `.` variable in the worksace.
And it doesn't deal gracefully with some lazy evaluation edge cases such as
:
compose <- function(f, g) { function(x) g(f(x)) }
plus1 <- function(x) x + 1
plus2 <- plus1 %.% compose(.,plus1)
plus2(5)
#> [1] 7
plus1 ->.; compose(.,plus1) -> .; . -> plus2
plus2(5)
#> Error: C stack usage 15923776 is too close to the limit
What I propose on the other hand can always substitute any existing proper
pipe in t...
2017 Sep 13
2
How to add optimizations to InstCombine correctly?
...orrectly the new BinaryOp 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::Su...
2017 Sep 13
3
How to add optimizations to InstCombine correctly?
...isitMul 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());
>> re...
2017 Sep 14
3
How to add optimizations to InstCombine correctly?
....
> 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 =...
2019 Oct 05
0
should base R have a piping operator ?
...e right
> * It doesn't trigger indentation when going to the line
> * It creates/overwrite a `.` variable in the worksace.
>
> And it doesn't deal gracefully with some lazy evaluation edge cases such as
> :
>
> compose <- function(f, g) { function(x) g(f(x)) }
> plus1 <- function(x) x + 1
>
> plus2 <- plus1 %.% compose(.,plus1)
> plus2(5)
> #> [1] 7
>
> plus1 ->.; compose(.,plus1) -> .; . -> plus2
> plus2(5)
> #> Error: C stack usage 15923776 is too close to the limit
>
> What I propose on the other hand c...
2017 Sep 16
2
How to add optimizations to InstCombine correctly?
...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;
>...
2017 Sep 19
0
How to add optimizations to InstCombine correctly?
...> 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) {
>> >...
2017 Sep 19
0
How to add optimizations to InstCombine correctly?
...> 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) {
>> >...
2019 Oct 05
6
should base R have a piping operator ?
Dear R-devel,
The most popular piping operator sits in the package `magrittr` and is used
by a huge amount of users, and imported /reexported by more and more
packages too.
Many workflows don't even make much sense without pipes nowadays, so the
examples in the doc will use pipes, as do the README, vignettes etc. I
believe base R could have a piping operator so packages can use a pipe in
2017 Sep 19
5
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)...