Displaying 20 results from an estimated 60 matches for "bolvanský".
2018 Apr 20
2
Missed strlen optimizations
Use *last = nullptr;
for (Use &U : Src->uses())
last = &U;
last->getUser()->dump();
Or any better solution?
2018-04-20 19:19 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>:
> Is:
>
>
> 2018-04-20 18:07 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>:
>
>> Hello,
>>
>> Code: https://godbolt.org/g/EG4Wi6
>>
>> unsigned fff3(void) {
>> char buf[10] = ""...
2018 Apr 20
0
Missed strlen optimizations
Maybe nicer..
auto i = Src->uses().begin();
std::advance(i, Src->getNumUses() - 1);
i->getUser()->dump();
2018-04-20 19:19 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>:
> Use *last = nullptr;
> for (Use &U : Src->uses())
> last = &U;
> last->getUser()->dump();
>
>
> Or any better solution?
>
> 2018-04-20 19:19 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com&g...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...argument is a pointer, and the second
argument is the number of bytes pointed to by that pointer (or
MemoryLocation::UnknownSize if the number of bytes accessed isn't known).
More generally, copy-pasting code you don't understand isn't a good idea.
-Eli
On 5/22/2018 4:02 PM, Dávid Bolvanský wrote:
> IR:
> define i32 @calloc_strlen_write_between() {
> %call = tail call noalias i8* @calloc(i32 10, i32 1)
> store i8 97, i8* %call, align 1
> %call1 = tail call i32 @strlen(i8* %call)
> ret i32 %call1
> }
>
>
> static bool eliminateStrlen(CallInst *CI,...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...rgument
> is the number of bytes pointed to by that pointer (or
> MemoryLocation::UnknownSize if the number of bytes accessed isn't known).
>
> More generally, copy-pasting code you don't understand isn't a good idea.
>
> -Eli
>
>
> On 5/22/2018 4:02 PM, Dávid Bolvanský wrote:
>
> IR:
> define i32 @calloc_strlen_write_between() {
> %call = tail call noalias i8* @calloc(i32 10, i32 1)
> store i8 97, i8* %call, align 1
> %call1 = tail call i32 @strlen(i8* %call)
> ret i32 %call1
> }
>
>
> static bool eliminateStrlen(CallInst...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
...with
MemoryLocation MemoryLocation::get(const CallInst *CI) {
AAMDNodes AATags;
CI->getAAMetadata(AATags);
const auto &DL = CI->getModule()->getDataLayout();
return MemoryLocation(CI, DL.getTypeStoreSize(CI->getType()), AATags);
}
Is it fine? :)
2018-05-22 23:56 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>:
> Looks like there are many overloads for "get". http://llvm.org/
> doxygen/MemoryLocation_8cpp_source.html
>
> But nothing for CallInst. Any suggestions how to do a proper one? I will
> look at it too.
>
> 2018-05-22 23:34 GMT+...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...placeAllUsesWith(Len);
CI->eraseFromParent();
return true;
}
return false;
}
------------------------------------------------------
That IR is still wrongly transformed with this code to ret i32 0 (but there
is write between calloc and strlen). Any suggestions?
2018-05-23 0:49 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>:
> It works with
>
> MemoryLocation MemoryLocation::get(const CallInst *CI) {
> AAMDNodes AATags;
> CI->getAAMetadata(AATags);
> const auto &DL = CI->getModule()->getDataLayout();
>
> return MemoryLocation(CI, DL.getTypeSto...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
..., you'll have to compute the MemoryLocation
> some other way.
>
> (Generally, if you're asking a question about an assertion, please include
> the whole stack trace; it's hard to guess what's happening otherwise.)
>
> -Eli
>
>
> On 5/22/2018 2:16 PM, Dávid Bolvanský wrote:
>
> * if (isStringFromCalloc(Dst, TLI)) should be if
> (!isStringFromCalloc(Dst, TLI))
> but still asserting...
>
> 2018-05-22 23:06 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>:
>
>> Can you help a bit?
>>
>> I try to work with DSE b...
2018 May 09
2
Ignored branch predictor hints
...dummy asm(“”):
#define likely(x) __builtin_expect((x),1)
// switch like
char * b(int e) {
if (likely(e == 0))
return "0";
asm("");
if (e == 1)
return "1";
else return "f";
}
Dave
> On May 9, 2018, at 2:33 PM, Dávid Bolvanský via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> I did
> https://bugs.llvm.org/show_bug.cgi?id=37368 <https://bugs.llvm.org/show_bug.cgi?id=37368>
>
> 2018-05-09 20:33 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com <mailto:david.bolvansky at gmail.c...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
Looks like there are many overloads for "get".
http://llvm.org/doxygen/MemoryLocation_8cpp_source.html
But nothing for CallInst. Any suggestions how to do a proper one? I will
look at it too.
2018-05-22 23:34 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>:
> Full stack trace:
>
> opt: /home/xbolva00/LLVM/llvm/include/llvm/ADT/Optional.h:176: T*
> llvm::Optional<T>::getPointer() [with T = llvm::MemoryLocation]:
> Assertion `Storage.hasVal' failed.
> Stack dump:
> 0. Program argumen...
2018 May 22
2
DSE: Remove useless stores between malloc & memset
* if (isStringFromCalloc(Dst, TLI)) should be if (!isStringFromCalloc(Dst,
TLI))
but still asserting...
2018-05-22 23:06 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>:
> Can you help a bit?
>
> I try to work with DSE but I got the following assert:
> opt: /home/xbolva00/LLVM/llvm/include/llvm/ADT/Optional.h:176: T*
> llvm::Optional<T>::getPointer() [with T = llvm::MemoryLocation]:
> Assertion `Storag...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...If you're passing in something else, you'll have to compute the
MemoryLocation some other way.
(Generally, if you're asking a question about an assertion, please
include the whole stack trace; it's hard to guess what's happening
otherwise.)
-Eli
On 5/22/2018 2:16 PM, Dávid Bolvanský wrote:
> * if (isStringFromCalloc(Dst, TLI)) should be if
> (!isStringFromCalloc(Dst, TLI))
> but still asserting...
>
> 2018-05-22 23:06 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com
> <mailto:david.bolvansky at gmail.com>>:
>
> Can you help a b...
2018 May 09
0
Ignored branch predictor hints
I did
https://bugs.llvm.org/show_bug.cgi?id=37368
2018-05-09 20:33 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>:
> I did
>
> https://bugs.llvm.org/show_bug.cgi?id=37368
>
> 2018-05-09 20:29 GMT+02:00 David Zarzycki <dave at znu.io>:
>
>> I’d wager that the if-else chain is being converted to a "switch
>> statement” during an opti...
2018 May 09
3
Ignored branch predictor hints
Hello,
#define likely(x) __builtin_expect((x),1)
// switch like
char * b(int e) {
if (likely(e == 0))
return "0";
else if (e == 1)
return "1";
else return "f";
}
GCC correctly prefers the first case:
b(int):
mov eax, OFFSET FLAT:.LC0
test edi, edi
jne .L7
ret
But Clang seems to ignore _builtin_expect hints in this case.
2018 May 21
2
DSE: Remove useless stores between malloc & memset
...the memset: if the closest dependency is the malloc,
there aren't any stores between the memset and the malloc. (But we
aren't using MemorySSA in DSE yet; see https://reviews.llvm.org/D40480.)
But yes, memoryIsNotModifiedBetween has the right meaning.
-Eli
On 5/21/2018 7:48 AM, Dávid Bolvanský wrote:
> "memory accesses between the malloc and the memset without an
> expensive linear scan of the block/function"
>
> (1) do you mean just use "memoryIsNotModifiedBetween" function in DSE
> to check it?
>
> x = maloc(..);
> memset(x, ...)
>
>...
2018 May 22
4
Rewriting calls to varargs functions
...n printf every time we
call it. We would just replace string constant "%s: %s" with "ABC: %s" and
possibly orphaned "ABC" constant could be removed completely.
2018-05-22 18:36 GMT+02:00 Hal Finkel <hfinkel at anl.gov>:
>
> On 05/22/2018 10:42 AM, Dávid Bolvanský wrote:
>
> Thanks.
>
> Yes, to substitute only some of the arguments. Formatting used by printf
> depends on the locale but only for double, float types I think - yes, I
> would not place double/float constants into the format string.
>
>
> Okay. I think it's true th...
2018 May 09
0
Ignored branch predictor hints
...)
>
> // switch like
> char * b(int e) {
> if (likely(e == 0))
> return "0";
> asm("");
> if (e == 1)
> return "1";
> else return "f";
> }
>
> Dave
>
> On May 9, 2018, at 2:33 PM, Dávid Bolvanský via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
> I did
> https://bugs.llvm.org/show_bug.cgi?id=37368
>
> 2018-05-09 20:33 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>:
>
>> I did
>>
>> https://bugs.llvm.org/show_bug.cgi?id=37368...
2018 May 22
0
DSE: Remove useless stores between malloc & memset
...s the malloc, there
> aren't any stores between the memset and the malloc. (But we aren't using
> MemorySSA in DSE yet; see https://reviews.llvm.org/D40480.)
>
> But yes, memoryIsNotModifiedBetween has the right meaning.
>
> -Eli
>
>
> On 5/21/2018 7:48 AM, Dávid Bolvanský wrote:
>
> "memory accesses between the malloc and the memset without an expensive
> linear scan of the block/function"
>
> (1) do you mean just use "memoryIsNotModifiedBetween" function in DSE to
> check it?
>
> x = maloc(..);
> memset(x, ...)
>
&...
2018 Sep 15
2
New warnings when building trunk with GCC 9
...2018 o 9:53 David Blaikie <dblaikie at gmail.com> napísal(a):
>
>
> On Fri, Sep 14, 2018 at 12:48 AM Stephan Bergmann <sbergman at redhat.com>
> wrote:
>
>> On 13/09/2018 18:22, David Blaikie via llvm-dev wrote:
>> > On Thu, Sep 13, 2018 at 12:13 AM Dávid Bolvanský via llvm-dev
>> > <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>> >
>> /home/davidbolvansky/trunk/llvm/unittests/ExecutionEngine/Orc/CompileOnDemandLayerTest.cpp:79:40:
>>
>> > required from here
>> >
>...
2018 May 22
0
Rewriting calls to varargs functions
On 05/22/2018 11:59 AM, Dávid Bolvanský wrote:
> It could save useless parsing in s/f/printf during runtime.
Sure. But it is not clear that matters. printf is expensive anyway.
Maybe this matters more for snprintf? Have you benchmarked this?
>
> E.g. for heavy "fprint"ing code like fprintf(f, "%s: %s", TAG...
2018 May 17
3
DSE: Remove useless stores between malloc & memset
Hello,
I would like to find a way to do this removal properly. I found DSE and
"eliminateNoopStore" can be useful for this thing.
What I mean?
int *test = malloc(15 * sizeof(int));
test[10] = 12; < ----- remove this store
memset(test,0,sizeof(int) * 15);
I already checked the function "eliminateNoopStore".
Looks good, I think I would be to get the value ("A") we