xbolva00 (Dávid Bolvanský)
User

Projects

User does not belong to any projects.

User Details

User Since
Thu, Apr 5, 5:18 PM (2 w, 2 d)

Recent Activity

Today

xbolva00 added a comment to D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

@efriedma is it now OK? Or is there anything to improve?

Sat, Apr 21, 9:04 AM
xbolva00 updated the diff for D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.
Sat, Apr 21, 9:04 AM

Yesterday

xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Fri, Apr 20, 5:26 PM
xbolva00 added a comment to D45418: [SimplifyLibcalls] Atoi, strtol replacements.

I was going to commit this, but then I discovered that str-int.ll and str-int-2.ll are identical. Did you accidentally overwrite your changes?

Fri, Apr 20, 5:24 PM
xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Fri, Apr 20, 5:23 PM
xbolva00 updated the diff for D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

Better tests

Fri, Apr 20, 1:34 PM
xbolva00 updated the diff for D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

Updated tests.

Fri, Apr 20, 12:52 PM
xbolva00 updated the diff for D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

Fixed things .

Fri, Apr 20, 12:47 PM
xbolva00 added a comment to D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

Which additional tests you would like to see?

Fri, Apr 20, 10:34 AM
xbolva00 accepted D44626: [InstCombine] Fold (A OR B) AND B code sequence over Phi node .
Fri, Apr 20, 12:03 AM

Thu, Apr 19

xbolva00 added a comment to D45418: [SimplifyLibcalls] Atoi, strtol replacements.

Now you can merge this patch, @spatel

It's better to ask someone who looked at this patch to commit it; I didn't follow this review this at all.

Thu, Apr 19, 3:56 PM
xbolva00 added a comment to D45418: [SimplifyLibcalls] Atoi, strtol replacements.

No you can merge this patch, @spatel

Thu, Apr 19, 12:58 PM
xbolva00 updated the diff for D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.
Thu, Apr 19, 7:42 AM
xbolva00 added a comment to D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

@efriedma . may I add tests for "capture detection" only for one IO call, e.g. fwrite? Since all others depends on the "isReplaceableWithUnlockedVariant" anyway..

Thu, Apr 19, 7:00 AM
xbolva00 added a comment to D45050: [clang-tidy] New checker for not null-terminated result caused by strlen or wcslen.

Another idea if you want to implement it - check fopen.

Thu, Apr 19, 3:17 AM · Restricted Project
xbolva00 added a reviewer for D45050: [clang-tidy] New checker for not null-terminated result caused by strlen or wcslen: xbolva00.
Thu, Apr 19, 2:38 AM · Restricted Project
xbolva00 added a comment to D45050: [clang-tidy] New checker for not null-terminated result caused by strlen or wcslen.

Shouldn't it catch in curl also this code?

Thu, Apr 19, 2:36 AM · Restricted Project

Wed, Apr 18

xbolva00 updated the diff for D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.
Wed, Apr 18, 3:47 PM
xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Wed, Apr 18, 3:41 PM
xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.

Adressed notes by @efriedma

Wed, Apr 18, 3:33 PM
xbolva00 added a comment to D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

It's still possible to optimize your capt_test() example.

Wed, Apr 18, 3:01 PM
xbolva00 updated the diff for D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.
Wed, Apr 18, 3:00 PM
xbolva00 added a comment to D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

It doesn't matter what code is in the module which is currently being processed; another module could do __attribute((constructor)) void f() { pthread_t t; pthread_create(&t, 0, puts, "foo"); } or something.

Wed, Apr 18, 2:23 PM
xbolva00 updated the diff for D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.
Wed, Apr 18, 2:23 PM
xbolva00 added a comment to D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

I don't think there's any practical way to prove that no other thread will write to stdout.

Wed, Apr 18, 1:52 PM
xbolva00 added a comment to D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

NoCapture attributes check now work.

Wed, Apr 18, 12:29 PM
xbolva00 updated the diff for D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.
Wed, Apr 18, 12:22 PM
xbolva00 added a comment to D45418: [SimplifyLibcalls] Atoi, strtol replacements.

ping

Wed, Apr 18, 9:54 AM
xbolva00 added a comment to D45772: [Minor patch] Fix IR Module Printing.

Update with the context

Wed, Apr 18, 8:30 AM
xbolva00 added reviewers for D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO: sanjoy, hfinkel, majnemer.
Wed, Apr 18, 7:47 AM
xbolva00 added reviewers for D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO: RKSimon, spatel.
Wed, Apr 18, 7:45 AM
xbolva00 closed D45343: [InstCombine] Always remove null check before free.

I don't understand what's going on here. Why is this patch marked 'Accepted'? In general, you shouldn't approve your own patches that you've posted for review.

Beyond that, I don't understand why this is desirable. I think the reason this was coded with size optimization as a predicate is because the null check cheaply guards against a potentially expensive library call (cc @qcolombet as author of the original patch). This might be the correct transform for instcombine, but then there should be a backend transform that would add the null check back if it's profitable?

Wed, Apr 18, 7:43 AM

Tue, Apr 17

xbolva00 updated the diff for D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N).
Tue, Apr 17, 10:12 PM
xbolva00 added a comment to D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

That should work, as far as I know; maybe we aren't adding the right nocapture markings to the fwrite() call?

Tue, Apr 17, 4:31 PM
xbolva00 added a comment to D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

So maybe somehow check if module has only static functions (+main)?

You might be able to get this to work, but there are a lot of weird edge cases, and it wouldn't be very useful in practice; most programs have more than one source code file.

The practical approach would be to use something like llvm::PointerMayBeCaptured to prove no other thread knows the value of the FILE*.

Tue, Apr 17, 4:21 PM
xbolva00 added a comment to D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

to gain better speed

Out of curiosity, what are the motivational cases, benchmarks?

if we know, that there is no fork or pthread_create calls in the current module.

I'm not sure this is sufficient.
I'll be super surprised if this could be done outside of a LTO build with no dynamic linking.

Motivation? I tried to "getchar and putchar" 2 MB file and using unlocked variants I got time difference around 0,1 s.

I believe there are more reasons to apply such optimizations, if possible. If we can have faster IO code, why not?

Why not sufficient?
Can you explain it more?

Static function can be called only from module and if there is no fork or pthread_create, why we cant say that all static functions are not called from multiple threads/processes?

And what about said static function being [indirectly] called from some non-static function?

Tue, Apr 17, 3:31 PM
xbolva00 added a comment to D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

to gain better speed

Out of curiosity, what are the motivational cases, benchmarks?

if we know, that there is no fork or pthread_create calls in the current module.

I'm not sure this is sufficient.
I'll be super surprised if this could be done outside of a LTO build with no dynamic linking.

Tue, Apr 17, 3:19 PM
xbolva00 accepted D44833: [InstCombine] peek through bitcasted vector/array pointer GEP operand.
Tue, Apr 17, 3:11 PM
xbolva00 added a comment to D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.

Would be ok if we simplify getc to fgetc_unlocked and not getc_unlocked?

Tue, Apr 17, 2:24 PM
xbolva00 updated the summary of D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.
Tue, Apr 17, 2:12 PM
xbolva00 updated the summary of D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.
Tue, Apr 17, 2:12 PM
xbolva00 added inline comments to D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.
Tue, Apr 17, 2:08 PM
xbolva00 created D45736: [SimplifyLibcalls] Replace locked IO with unlocked IO.
Tue, Apr 17, 2:08 PM
xbolva00 added a comment to D45343: [InstCombine] Always remove null check before free.

ping

Tue, Apr 17, 8:39 AM
xbolva00 added a comment to D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N).

LGTM

Tue, Apr 17, 7:58 AM

Mon, Apr 16

xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Mon, Apr 16, 1:16 PM
xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Mon, Apr 16, 1:11 PM
xbolva00 added inline comments to D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Mon, Apr 16, 1:08 PM
xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.

Added tests for atol, atoll, strtoll.

Mon, Apr 16, 1:08 PM
xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.

Updated, fixed things.

Mon, Apr 16, 1:02 PM
xbolva00 added inline comments to D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Mon, Apr 16, 12:45 PM
xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.

Updated with changes requested by @efriedma .

Mon, Apr 16, 12:38 PM
xbolva00 added a reviewer for D45653: Enable sibling-call optimization for functions returning structs: spatel.
Mon, Apr 16, 11:32 AM
xbolva00 accepted D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N).
Mon, Apr 16, 9:28 AM
xbolva00 accepted D45343: [InstCombine] Always remove null check before free.
Mon, Apr 16, 9:28 AM
xbolva00 accepted D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Mon, Apr 16, 9:28 AM
xbolva00 added a comment to D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N).

Any review or merge? @spatel ?

Mon, Apr 16, 6:36 AM

Sun, Apr 15

xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Sun, Apr 15, 7:43 AM
xbolva00 added a comment to D45418: [SimplifyLibcalls] Atoi, strtol replacements.

@efriedma , is now everything ok?

Sun, Apr 15, 7:23 AM

Sat, Apr 14

xbolva00 updated the summary of D45343: [InstCombine] Always remove null check before free.
Sat, Apr 14, 10:05 AM
xbolva00 added a reviewer for D45343: [InstCombine] Always remove null check before free: efriedma.
Sat, Apr 14, 10:05 AM
xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Sat, Apr 14, 10:02 AM
xbolva00 accepted D45653: Enable sibling-call optimization for functions returning structs.
Sat, Apr 14, 10:00 AM
xbolva00 requested changes to D45653: Enable sibling-call optimization for functions returning structs.
Sat, Apr 14, 7:49 AM
xbolva00 added a comment to D45653: Enable sibling-call optimization for functions returning structs.

Please update with the context.

Sat, Apr 14, 7:49 AM
xbolva00 accepted D45653: Enable sibling-call optimization for functions returning structs.
Sat, Apr 14, 7:46 AM

Fri, Apr 13

xbolva00 added inline comments to D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Fri, Apr 13, 5:05 PM
xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Fri, Apr 13, 5:05 PM
xbolva00 added inline comments to D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Fri, Apr 13, 4:36 PM
xbolva00 added inline comments to D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N).
Fri, Apr 13, 4:35 PM
xbolva00 added inline comments to D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Fri, Apr 13, 4:35 PM
xbolva00 updated the diff for D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N).
Fri, Apr 13, 4:31 PM
xbolva00 abandoned D45344: [SimplifyLibcalls] Fold malloc + memset to calloc even for llvm.memset.
Fri, Apr 13, 2:54 AM

Thu, Apr 12

xbolva00 abandoned D45599: [SimplifyLibcalls] Memcpy + strlen propagation.
Thu, Apr 12, 4:50 PM
xbolva00 added a comment to D45599: [SimplifyLibcalls] Memcpy + strlen propagation.

GVN should already be able to get this, and if it can't, improve it's intrinsic handling (Either in VNCoercion's memory transfer intrinsic handling, or ...).

That's gonna do a lot better than trying to special case it in libcall simplification.
It also looks like you made it O(number of instructions) worst case per call?

Thu, Apr 12, 4:50 PM
xbolva00 updated the diff for D45599: [SimplifyLibcalls] Memcpy + strlen propagation.
Thu, Apr 12, 4:13 PM
xbolva00 updated the diff for D45599: [SimplifyLibcalls] Memcpy + strlen propagation.
Thu, Apr 12, 4:07 PM
xbolva00 updated the diff for D45599: [SimplifyLibcalls] Memcpy + strlen propagation.
Thu, Apr 12, 4:02 PM
xbolva00 added reviewers for D45599: [SimplifyLibcalls] Memcpy + strlen propagation: spatel, efriedma.
Thu, Apr 12, 3:51 PM
xbolva00 created D45599: [SimplifyLibcalls] Memcpy + strlen propagation.
Thu, Apr 12, 3:51 PM
xbolva00 updated the diff for D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N).
Thu, Apr 12, 1:20 PM
xbolva00 added inline comments to D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N).
Thu, Apr 12, 1:20 PM
xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Thu, Apr 12, 1:09 PM
xbolva00 added inline comments to D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Thu, Apr 12, 1:04 PM
xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.

Updated, use strtoll now. @efriedma

Thu, Apr 12, 1:02 PM
xbolva00 added inline comments to D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Thu, Apr 12, 12:53 PM
xbolva00 added inline comments to D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N).
Thu, Apr 12, 12:36 PM
xbolva00 abandoned D45343: [InstCombine] Always remove null check before free.
Thu, Apr 12, 6:50 AM
xbolva00 reclaimed D45343: [InstCombine] Always remove null check before free.
Thu, Apr 12, 6:50 AM
xbolva00 added inline comments to D45418: [SimplifyLibcalls] Atoi, strtol replacements.
Thu, Apr 12, 6:50 AM
xbolva00 updated the diff for D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N).
Thu, Apr 12, 1:54 AM
xbolva00 added a reviewer for D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N): lebedev.ri.
Thu, Apr 12, 12:23 AM
xbolva00 retitled D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N) from [SimplifyLibcalls] Fold malloc + realloc to [SimplifyLibcalls] Realloc(null, N) -> Malloc(N).
Thu, Apr 12, 12:22 AM
xbolva00 updated the diff for D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N).
Thu, Apr 12, 12:21 AM

Wed, Apr 11

xbolva00 updated the diff for D45343: [InstCombine] Always remove null check before free.

Patch updated with suggested changes by @lebedev.ri

Wed, Apr 11, 9:19 PM
xbolva00 updated subscribers of D45413: [SimplifyLibcalls] Realloc(null, N) -> Malloc(N).

I would like to hear your feedback on these three changes

Wed, Apr 11, 9:15 PM
xbolva00 updated subscribers of D45344: [SimplifyLibcalls] Fold malloc + memset to calloc even for llvm.memset.

Anything to be done? Or is this ok? @efriedma , @spatel...

Wed, Apr 11, 4:02 PM
xbolva00 updated the diff for D45418: [SimplifyLibcalls] Atoi, strtol replacements.

Fixed things noted by @efriedma

Wed, Apr 11, 3:56 PM
xbolva00 added a comment to D45418: [SimplifyLibcalls] Atoi, strtol replacements.

Is patch now ok for you, @efriedma ?

Wed, Apr 11, 1:27 PM
xbolva00 abandoned D45378: [InstCombine] Propagate null values from conditions to other basic blocks.

This is pushing instcombine beyond local simplifications. Propagating values across blocks should probably be handled in CVP (-correlated-propagation).

Maybe, but here it also fits, every info required for this transformation is available here.

I think it's been shown that every other pass could be subsumed by instcombine. That doesn't mean we should do that.

Implementation of this optimization would probably be quite massive in the CorrelatedValuePropagation.

I was curious why that might be, so I wrote a patch. It's about the same amount of code as this patch, but more general. Please see if D45448 / rL329755 solved your motivating examples. If yes, I think you can abandon this patch.

Wed, Apr 11, 10:25 AM