[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-22 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: hokein. Herald added subscribers: cfe-commits, kbarton, xazax.hun, nemanjai. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-23 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 170605. gchatelet marked 2 inline comments as done. gchatelet added a comment. - Addressing comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-24 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added inline comments. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:58 + const QualType Rhs) { + assert(Lhs->isRealType()); // Either integer or floating point. + assert(Rhs->isFloatingType()); // Floating point

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-24 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 170846. gchatelet added a comment. - Update documentation, makes returning code path more explicit. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-24 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added inline comments. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:58 + const QualType Rhs) { + assert(Lhs->isRealType()); // Either integer or floating point. + assert(Rhs->isFloatingType()); // Floating point

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-24 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 170851. gchatelet added a comment. - Add documentation to ReleaseNotes Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-24 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 170878. gchatelet marked an inline comment as done. gchatelet added a comment. - Join the two parts of the ReleaseNotes update Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files:

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-24 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In https://reviews.llvm.org/D53488#1273986, @JonasToth wrote: > Please add a short notice in the release notes for this change. Sorry I keep on missing to update doc/release notes. Do you see anything else to add to the Patch? Repository: rCTE Clang Tools Extra

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. So I ran `llvm/tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py` The bare version produces `65664` unique findings. The version restricted to `cppcoreguidelines-narrowing-conversions` produces `4323` unique findings. That's about `+7%` of findings. I can post

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 171692. gchatelet added a comment. - Add more checks, disable bool implicit casts warning, enable ternary operator warnings. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files:

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. So I've updated the code to add more narrowing conversions. It now tests constant expressions against receiving type, do not warn about implicit bool casting, handles ternary operator with constant expressions. I ran it on our code base: results look legit. I'll ping

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. Here are 15 random ones from **llvm** synced at `8f9fb8bab2e9b5b27fe40d700d2abe967b99fbb5`. lib/Target/ARM/AsmParser/ARMAsmParser.cpp:3802:31: warning: narrowing conversion from 'int' to 'unsigned int' [cppcoreguidelines-narrowing-conversions]

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 171717. gchatelet marked 4 inline comments as done. gchatelet added a comment. - Remove leftover Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 171826. gchatelet marked 12 inline comments as done. gchatelet added a comment. - Address comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked an inline comment as done. gchatelet added inline comments. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:42 + unless(hasParent(castExpr())), + unless(isInTemplateInstantiation())) +

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-25 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In https://reviews.llvm.org/D53488#1275786, @hokein wrote: > In https://reviews.llvm.org/D53488#1275750, @gchatelet wrote: > > > In https://reviews.llvm.org/D53488#1274205, @JonasToth wrote: > > > > > Did you run this code over a real-world code-base and did you find

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-25 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked 2 inline comments as done. gchatelet added a comment. In https://reviews.llvm.org/D53488#1274205, @JonasToth wrote: > Did you run this code over a real-world code-base and did you find new stuff > and/or false positives or the like? Yes I did run it over our code base. I

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-11-05 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked 8 inline comments as done. gchatelet added inline comments. Comment at: test/clang-tidy/cppcoreguidelines-narrowing-conversions.cpp:164 + while (i) { +// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: narrowing conversion from 'int' to 'bool'

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-11-06 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 172778. gchatelet marked 7 inline comments as done. gchatelet added a comment. - Addressing comments and enhancing diagnostics Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files:

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-13 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 173836. gchatelet marked 6 inline comments as done. gchatelet added a comment. - Address comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-13 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added inline comments. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:299 + Rhs->isCXX11ConstantExpr(Context, )) { +if (Constant.isFloat()) + diagIfNarrowFloatingPointConstant(Context, SourceLoc, Lhs, Rhs, Constant);

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-13 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In https://reviews.llvm.org/D53488#1296940, @JonasToth wrote: > So, finally LGTM :) > Please give @aaron.ballman a chance to comment, as he reviewed too. > > Thanks for your patch! Thank you for bearing with me. Waiting for input from @aaron.ballman Repository:

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-13 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 173844. gchatelet added a comment. - Remove debugging leftover Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-11-07 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added inline comments. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:178 + return; +// Conversions to unsigned integer are well defined and follow modulo 2 +// arithmetic. JonasToth wrote: > I am surprised by

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-11-07 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 172904. gchatelet marked 2 inline comments as done. gchatelet added a comment. - Addressing comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-14 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. Thx for the review. I have two suggestions in the comments let me know what you think. Comment at: test/clang-tidy/cppcoreguidelines-narrowing-conversions.cpp:79-81 + // TODO: Provide an automatic fix if the number is exactly representable in the

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-14 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 174044. gchatelet marked 7 inline comments as done. gchatelet added a comment. - State char signess clearly Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-11-08 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. Is this good enough to go? @JonasToth Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-09 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 173343. gchatelet marked 13 inline comments as done. gchatelet added a comment. - Addressing comments, adding Option to disable FP to FP narrowing warnings, handling FP literals. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 173633. gchatelet marked 2 inline comments as done. gchatelet added a comment. - Address comments + fix hex values display Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files:

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added inline comments. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:178 + return; +// Conversions to unsigned integer are well defined and follow modulo 2 +// arithmetic. JonasToth wrote: > gchatelet wrote: > >

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-16 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 174374. gchatelet marked 13 inline comments as done. gchatelet added a comment. - Addressed comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-16 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added inline comments. Comment at: test/clang-tidy/cppcoreguidelines-narrowing-conversions.cpp:79-81 + // TODO: Provide an automatic fix if the number is exactly representable in the destination type. + f += 2.0; + // CHECK-MESSAGES: :[[@LINE-1]]:5: warning:

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-23 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 175139. gchatelet added a comment. - Added a new option warn about wrong type literals Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53488/new/ https://reviews.llvm.org/D53488 Files:

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-23 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked an inline comment as done. gchatelet added inline comments. Comment at: test/clang-tidy/cppcoreguidelines-narrowing-conversions.cpp:42-44 i += 2.0; - // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: narrowing conversion from 'double' to 'int'

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. Thank you for bearing with me @aaron.ballman. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:259-263 +void NarrowingConversionsCheck::handleIntegralToBoolean( +const ASTContext , SourceLocation SourceLoc, const Expr , +

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 175203. gchatelet marked 16 inline comments as done. gchatelet added a comment. - Addressing comments Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53488/new/ https://reviews.llvm.org/D53488 Files:

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 175204. gchatelet added a comment. - Fixing documentation. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53488/new/ https://reviews.llvm.org/D53488 Files:

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-22 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 175030. gchatelet marked an inline comment as done. gchatelet added a comment. - Refactored the code to make it simpler, added more tests Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files:

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-22 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked 2 inline comments as done. gchatelet added inline comments. Comment at: test/clang-tidy/cppcoreguidelines-narrowing-conversions.cpp:42-44 i += 2.0; - // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: narrowing conversion from 'double' to 'int'

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-22 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 175033. gchatelet marked an inline comment as done. gchatelet added a comment. - Reverting the WarnOnFloatingPointNarrowingConversion option to be on by default Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 Files:

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D53488#1307834 , @aaron.ballman wrote: > LGTM! Thx ! \O/ Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53488/new/ https://reviews.llvm.org/D53488

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL347570: [clang-tidy] Improving narrowing conversions (authored by gchatelet, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION

[PATCH] D53488: [clang-tidy] Improving narrowing conversions

2018-11-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 175231. gchatelet marked 4 inline comments as done. gchatelet added a comment. - Removed redundant options in regression tests Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53488/new/

[PATCH] D60719: Fixing freestanding for memcpy.

2019-04-15 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: llvm-commits, cfe-commits, hiraditya. Herald added projects: clang, LLVM. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D60719 Files: clang/lib/CodeGen/CodeGenModule.cpp

[PATCH] D60719: Demonstrate how to fix freestanding for memcpy

2019-04-16 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 195369. gchatelet added a comment. Add test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60719/new/ https://reviews.llvm.org/D60719 Files: clang/lib/CodeGen/CodeGenModule.cpp

[PATCH] D60719: Demonstrate how to fix freestanding for memcpy

2019-04-18 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D60719#1470632 , @t.p.northover wrote: > > IIUC freestanding environment should not rely on memcpy being present so my > > take on it was that by "fixing" freestanding I could have my cake and eat > > it too. > > The

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-06-06 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 203386. gchatelet added a comment. - Add documentation. - Fix permissive HasNoRuntimeAttribute - Mark interleave as disabled in the documentation. - Use no-builtin instead of no-runtime-for. - Adding an llvm.memcpy.inline intrinsic. - Adding

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-13 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1498376 , @efriedma wrote: > I still think there are really two things you're trying to accomplish here, > which should be handled separately. > > 1. Add a function attribute that works like -fno-builtin-memcpy

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-14 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a subscriber: tejohnson. gchatelet added a comment. In D61634#1500453 , @efriedma wrote: > My main blocker is that I want to make sure we're moving in the right > direction: towards LLVM IR with clear semantics, towards straightforward >

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-22 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. AFAIU here is a coarse plan of what needs to happen 1. Add a `no-builtin` clang function attribute that has the same semantic as the `no-builtin` cmd line argument 2. Propagate it

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-23 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 200998. gchatelet added a comment. - Use no-builtin instead of no-runtime-for. - Use one attribute per runtime function to make merging easier. The patch is still WIP and needs more work. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-10 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1494518 , @alexandre.isoard wrote: > I'm not convinced by the approach. > > Can it still recognize the loop idiom into memcpy implementation but use > `memmove` (as only `memcpy` has been blacklisted)? Yes it can

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-10 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1493927 , @efriedma wrote: > I would be careful about trying to over-generalize here. There are a few > different related bits of functionality which seem to be interesting, given > the discussion in the llvm-dev

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-15 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1502201 , @tejohnson wrote: > Using function level attributes instead of module flags does provide finer > grained control and avoids the conservativeness when merging IR for LTO. The > downsides I see, mostly just

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-07 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 198436. gchatelet added a comment. Herald added a subscriber: jdoerfert. - Add documentation. - Fix permissive HasNoRuntimeAttribute Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61634/new/

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-07 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: llvm-commits, cfe-commits, mgrang, hiraditya. Herald added projects: clang, LLVM. POC for the rfc http://lists.llvm.org/pipermail/llvm-dev/2019-April/131973.html Repository: rG LLVM Github Monorepo

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-05-07 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1493350 , @theraven wrote: > I wonder if a list of comma-separated names is the right approach. Would it > make more sense to add a new attribute for each of the helpers, such as > `#no-runtime-for-memcpy`? That

[PATCH] D60719: Demonstrate how to fix freestanding for memcpy

2019-04-17 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D60719#1469958 , @t.p.northover wrote: > I think it'd be pretty unpopular with the people I know who use freestanding. > They're mostly working on microcontrollers and compiling -Oz so the extra > code size would be

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-07-16 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1586047 , @tejohnson wrote: > Checking in to see where we are on this issue. I haven't had any time to work > on 4 but hopefully can start on that soon. But it needs the first part done > to be effective. Thx for

[PATCH] D64146: [Clang Interpreter] Initial patch for the constexpr interpreter

2019-09-04 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. This patch broke my build as well (discovered by runnin `git bisect`), command line > cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/local/bin/clang > -DCMAKE_ASM_COMPILER=/usr/local/bin/clang > -DCMAKE_CXX_COMPILER=/usr/local/bin/clang++ >

[PATCH] D67499: [Alignment] Move OffsetToAlignment to Alignment.h

2019-09-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: llvm-commits, cfe-commits, seiya, jsji, atanasyan, MaskRay, jrtc27, jakehehrlich, kbarton, hiraditya, nemanjai, sdardis. Herald added a reviewer: JDevlieghere. Herald added a reviewer: alexshap. Herald

[PATCH] D67499: [Alignment] Move OffsetToAlignment to Alignment.h

2019-09-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 219923. gchatelet marked an inline comment as done. gchatelet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67499/new/ https://reviews.llvm.org/D67499 Files:

[PATCH] D67499: [Alignment] Move OffsetToAlignment to Alignment.h

2019-09-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL371742: [Alignment] Move OffsetToAlignment to Alignment.h (authored by gchatelet, committed by ). Herald added a subscriber: kristina. Changed prior to commit:

[PATCH] D68028: [clang] Add no_builtin attribute

2019-10-01 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked 7 inline comments as done. gchatelet added a comment. thx @aaron.ballman , I'm waiting for your reply before uploading the new patch (some of my comments won't have the accompanying code update sorry) Comment at: clang/lib/Sema/SemaDeclAttr.cpp:1072

[PATCH] D68268: [Alignment][NFC] Remove StoreInst::setAlignment(unsigned)

2019-10-01 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added a reviewer: bollu. Herald added subscribers: llvm-commits, cfe-commits, asbirlea, hiraditya. Herald added a reviewer: jdoerfert. Herald added projects: clang, LLVM. This is patch is part of a series to introduce an

[PATCH] D68274: [Alignment][Clang][NFC] Add CharUnits::getAsAlign

2019-10-01 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: cfe-commits, jholewinski. Herald added a project: clang. This is a prerequisite to removing `llvm::GlobalObject::setAlignment(unsigned)`. This is patch is part of a series to introduce an Alignment

[PATCH] D68028: [clang] Add no_builtin attribute

2019-09-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 221939. gchatelet added a comment. - Checks function name validity and errors when passed 0 argument. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68028/new/ https://reviews.llvm.org/D68028 Files:

[PATCH] D68028: [clang] Add no_builtin attribute

2019-09-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 221924. gchatelet marked 11 inline comments as done. gchatelet added a comment. - Address aaron ballman comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68028/new/ https://reviews.llvm.org/D68028

[PATCH] D68028: [clang] Add no_builtin attribute

2019-09-26 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. @aaron.ballman thx a lot for the review. I really appreciate it, especially because I'm not too familiar with this part of the codebase. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:1092 + // Wildcard is a super set of all builtins, we keep only

[PATCH] D68142: [Alignment][NFC] Remove LoadInst::setAlignment(unsigned)

2019-09-27 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: llvm-commits, cfe-commits, asbirlea, hiraditya. Herald added a reviewer: jdoerfert. Herald added projects: clang, LLVM. This is patch is part of a series to introduce an Alignment type. See this thread

[PATCH] D68028: [clang] Add no_builtin attribute

2019-09-27 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 222163. gchatelet added a comment. - Update documentation and rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68028/new/ https://reviews.llvm.org/D68028 Files: clang/include/clang/Basic/Attr.td

[PATCH] D68028: [clang] Add no_builtin attribute

2019-09-27 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. @tejohnson I believe this is the missing part for D67923 . I'm unsure if we still need the `BitVector` at all in the `TLI` since it could be a simple attribute lookup on the function. Do you see any problematic interactions with the

[PATCH] D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

2019-09-27 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: llvm-commits, cfe-commits, hiraditya, eraman, nhaehnle, jvesely, arsenm, jholewinski. Herald added projects: clang, LLVM. This is patch is part of a series to introduce an Alignment type. See this

[PATCH] D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

2019-10-02 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked an inline comment as done. gchatelet added inline comments. Comment at: llvm/trunk/lib/Target/AArch64/AArch64StackTagging.cpp:65 -static constexpr unsigned kTagGranuleSize = 16; +static const Align kTagGranuleSize = Align(16); arichardson

[PATCH] D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373207: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned) (authored by gchatelet, committed by ). Changed prior to commit: https://reviews.llvm.org/D68141?vs=222400=222409#toc Repository:

[PATCH] D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 222400. gchatelet marked an inline comment as done. gchatelet added a comment. Herald added a reviewer: bollu. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68141/new/

[PATCH] D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked an inline comment as done. gchatelet added inline comments. Comment at: llvm/trunk/lib/Target/AArch64/AArch64StackTagging.cpp:65 -static constexpr unsigned kTagGranuleSize = 16; +static const Align kTagGranuleSize = Align(16); arichardson

[PATCH] D68142: [Alignment][NFC] Remove LoadInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. This patch broke polly, I'm working on a fix. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68142/new/ https://reviews.llvm.org/D68142 ___ cfe-commits mailing list

[PATCH] D68142: [Alignment][NFC] Remove LoadInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D68142#1687693 , @gchatelet wrote: > This patch broke polly, I'm working on a fix. https://reviews.llvm.org/rL373199 Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68142/new/

[PATCH] D68142: [Alignment][NFC] Remove LoadInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 222380. gchatelet marked an inline comment as done. gchatelet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68142/new/ https://reviews.llvm.org/D68142 Files:

[PATCH] D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 222372. gchatelet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68141/new/ https://reviews.llvm.org/D68141 Files: clang/lib/CodeGen/CGBuiltin.cpp

[PATCH] D68142: [Alignment][NFC] Remove LoadInst::setAlignment(unsigned)

2019-09-30 Thread Guillaume Chatelet via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373195: [Alignment][NFC] Remove LoadInst::setAlignment(unsigned) (authored by gchatelet, committed by ). Changed prior to commit: https://reviews.llvm.org/D68142?vs=222380=222381#toc Repository: rL

[PATCH] D61634: [clang/llvm] Allow efficient implementation of libc's memory functions in C/C++

2019-11-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D61634#1732884 , @tejohnson wrote: > In D61634#1682660 , @gchatelet wrote: > > > In D61634#1679331 , @tejohnson > > wrote: > > > > > In

[PATCH] D71193: [clang] Turn -fno-builtin flag into an IR Attribute

2019-12-09 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added reviewers: aaron.ballman, courbet. Herald added a project: clang. Herald added a subscriber: cfe-commits. This is a follow up on https://reviews.llvm.org/D61634#1742154 to turn the clang driver -fno-builtin flag into an IR attribute. I also

[PATCH] D71213: [Alignment][NFC] CreateMemSet use MaybeAlign

2019-12-09 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: llvm-commits, cfe-commits, hiraditya, nhaehnle, jvesely, arsenm. Herald added projects: clang, LLVM. This is patch is part of a series to introduce an Alignment type. See this thread for context:

[PATCH] D71213: [Alignment][NFC] CreateMemSet use MaybeAlign

2019-12-10 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 233074. gchatelet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71213/new/ https://reviews.llvm.org/D71213 Files: clang/lib/CodeGen/CGAtomic.cpp

[PATCH] D71213: [Alignment][NFC] CreateMemSet use MaybeAlign

2019-12-10 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. Thx for the review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71213/new/ https://reviews.llvm.org/D71213 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D71213: [Alignment][NFC] CreateMemSet use MaybeAlign

2019-12-10 Thread Guillaume Chatelet via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1b2842bf902a: [Alignment][NFC] CreateMemSet use MaybeAlign (authored by gchatelet). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71213/new/

[PATCH] D71213: [Alignment][NFC] CreateMemSet use MaybeAlign

2019-12-10 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked 2 inline comments as done. gchatelet added inline comments. Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:2910 +const Align Alignment = +assumeAligned(cast(I.getArgOperand(2))->getZExtValue()); Value *Mask =

[PATCH] D71193: [clang] Turn -fno-builtin flag into an IR Attribute

2019-12-11 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet updated this revision to Diff 233272. gchatelet marked 3 inline comments as done. gchatelet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71193/new/ https://reviews.llvm.org/D71193 Files:

[PATCH] D71213: [Alignment][NFC] CreateMemSet use MaybeAlign

2019-12-13 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D71213#1783467 , @nhaehnle wrote: > In D71213#1781322 , @gchatelet wrote: > > > LLVM has this `LLVM_ATTRIBUTE_DEPRECATED` macro, it's convenient to get a > > warning but it only works

[PATCH] D67923: [TLI] Support for per-Function TLI that overrides available libfuncs

2019-12-15 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet accepted this revision. gchatelet added a comment. Thx ! Comment at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:227 + const TargetLibraryInfoImpl , + LLVM_ATTRIBUTE_UNUSED Optional F = None) + : Impl(), OverrideAsUnavailable(NumLibFuncs) {

[PATCH] D71193: [clang] Turn -fno-builtin flag into an IR Attribute

2019-12-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked an inline comment as done. gchatelet added inline comments. Comment at: clang/test/CodeGen/libcalls-fno-builtin.c:163 -// CHECK: [[ATTR]] = { nobuiltin } +// GLOBAL: #2 = { nobuiltin "no-builtins" } +// INDIVIDUAL: #2 = { nobuiltin "no-builtin-ceil"

[PATCH] D71213: [Alignment][NFC] CreateMemSet use MaybeAlign

2019-12-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. @foad do you have any insights on how to go with the deprecation? LLVM has this `LLVM_ATTRIBUTE_DEPRECATED` macro, it's convenient to get a warning but it only works when building without `-Wall`. Bots and in-tree users have it set by default, it's fine as I'll be

[PATCH] D71420: [Alignment][NFC] Adding Align compatible methods to IntrinsicInst/IRBuilder

2019-12-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet created this revision. gchatelet added a reviewer: courbet. Herald added subscribers: llvm-commits, cfe-commits, hiraditya. Herald added projects: clang, LLVM. This is patch is part of a series to introduce an Alignment type. See this thread for context:

[PATCH] D71193: [clang] Turn -fno-builtin flag into an IR Attribute

2019-12-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet marked an inline comment as done. gchatelet added inline comments. Comment at: clang/test/CodeGen/libcalls-fno-builtin.c:163 -// CHECK: [[ATTR]] = { nobuiltin } +// GLOBAL: #2 = { nobuiltin "no-builtins" } +// INDIVIDUAL: #2 = { nobuiltin "no-builtin-ceil"

[PATCH] D71420: [Alignment][NFC] Adding Align compatible methods to IntrinsicInst/IRBuilder

2019-12-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdbc5acf8ce8a: [Alignment][NFC] Adding Align compatible methods to IntrinsicInst/IRBuilder (authored by gchatelet). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D71193: [clang] Turn -fno-builtin flag into an IR Attribute

2019-12-12 Thread Guillaume Chatelet via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0508c994f0b1: [clang] Turn -fno-builtin flag into an IR Attribute (authored by gchatelet). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71193/new/

[PATCH] D71213: [Alignment][NFC] CreateMemSet use MaybeAlign

2019-12-11 Thread Guillaume Chatelet via Phabricator via cfe-commits
gchatelet added a comment. In D71213#1779841 , @foad wrote: > @gchatelet in general would it be possible to make changes like this in a > backwards-compatible way, or in two stages without a "flag day" change? We > have out-of-tree users of CreateMemSet

  1   2   3   >