suggested source-code fixit of #define ALPHA_OFFSET 0x3
I think it's too soon to disable any macros.
I think it is too soon to jump and disable all macros. We still catch all motivating cases, it found bugs in Chromium.
Do not warn if RHS is macro.
From post commit discussion, Nico Weber:
I agree what @tkanis suggested and be silent if RHS is macro as real world code shows it. Opinions?
annotate snprintf if N is C > 0.
Do not remove nonnull from intrinsics.
Will be handled as NFC commit after D53342 lands.
@jdoerfert please take a look again (yea, big diff :( )
Updated/added tests ... uff :D
srv/llvm-buildbot-srcatch/llvm-build-dir/clang-x86_64-debian-fast/llvm.src/tools/llvm-reduce/deltas/ReduceGlobalVars.cpp:17:6: warning: '@returns' command used in a comment that is attached to a function returning void [-Wdocumentation]
1 warning generated.
Sat, Aug 17
Moved to optimizeCallInst.
Drop var.annotation and sideeffect intrinsics too.
As side note, there are a few cases in real word code
Anyway I think this fix is good and simple - does not require individual fixes for GlobalISel, FastISel, SelectionDAG.
Fri, Aug 16
Better comparison for "xor".
Anyway, this patch is still valid to be reviewed.
Oh, this is funny (or nasty) bug
(As an alternative, this can be fixed in the phrase when llvm.assume is dropped in backend.. but not sure if we have "backend" version of RecursivelyDeleteTriviallyDeadInstructions)
Week passed, it was enough time to comment it.
Thu, Aug 15
(That issue needs a separate patch anyway).
Yes! There is a new PR and I just realized how big issue we have here (we may call functions which are never called in source code) :[
Ok, go ahead.
Surprisingly test remove-global-vars.ll fails on buildbot
Is there a opposite pattern?
https://bugs.llvm.org/show_bug.cgi?id=43007 should be fixed too
Good to know, thanks for info!
Wed, Aug 14
Or by conserative (dont make IC much slower) and check only str(n)cpy, memcpy, memmove, memset buffers if they come from malloc/realloc/calloc?
I found another opportunity
mempcpy is quite rare, so hard to measure it on codebases.
Can you use utils/update_test_checks.py on this new IR file, please?
I have no problem with this patch (i.e. it can land if Johannes approves)
A conceptual point worth mentioning is that seems to essentially be inferring non-null for the intrinsics in question. We have a nonnull attribute on params and nonnull + deref_or_null should already be converted to deref. (If not, we should fix that.) It might be worth thinking about how to leverage the more generic code.
Added support for sprint, snprintf.