[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-27 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added a comment. In D107420#2969715 , @nickdesaulniers wrote: > In D107420#2929115 , @craig.topper > wrote: > >> In D107420#2929039 , >> @aaron.ballman wro

[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-27 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. In D107420#2929115 , @craig.topper wrote: > In D107420#2929039 , @aaron.ballman > wrote: > >> In D107420#2928975 , @craig.topper >> wro

[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-05 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe added a comment. In D107420#2928975 , @craig.topper wrote: > I put up a patch for a simple fix for this in the backend. > https://reviews.llvm.org/D107581 The generated code is not optimal, but > maybe better than frontend workarounds. THX f

[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-05 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. In D107420#2929115 , @craig.topper wrote: > In D107420#2929039 , @aaron.ballman > wrote: > >> In D107420#2928975 , @craig.topper >> wrote: >

[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-05 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added a comment. In D107420#2929039 , @aaron.ballman wrote: > In D107420#2928975 , @craig.topper > wrote: > >> I put up a patch for a simple fix for this in the backend. >> https://reviews.llvm.org

[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-05 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D107420#2928975 , @craig.topper wrote: > I put up a patch for a simple fix for this in the backend. > https://reviews.llvm.org/D107581 The generated code is not optimal, but > maybe better than frontend workarounds.

[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-05 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added a comment. I put up a patch for a simple fix for this in the backend. https://reviews.llvm.org/D107581 The generated code is not optimal, but maybe better than frontend workarounds. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-05 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe added a comment. In D107420#2927856 , @lebedev.ri wrote: > I don't personally care, but i think this diag doesn't make sense. > What is "backend"? Which one? All of them? What happens when one, but not all > of them supports it? > What if i don

[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-05 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. I don't personally care, but i think this diag doesn't make sense. What is "backend"? Which one? All of them? What happens when one, but not all of them supports it? What if i don't intend to codegen this into an assembly, but only want to produce the IR? Repository

[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-04 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe updated this revision to Diff 364349. FreddyYe added a comment. update lit test, clang-format, if condition, diagnostic Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107420/new/ https://reviews.llvm.org/D107420 Files: clang/include/clan

[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-04 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe marked an inline comment as done. FreddyYe added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8351-8353 +def err_overflow_builtin_special_combination_max_size : Error< + "__builtin_mul_overflow does not suport unsigned overflow check aft

[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-04 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe marked an inline comment as done. FreddyYe added a comment. Addressed. THX review! Comment at: clang/test/Sema/builtins-overflow.c:45 +unsigned _ExtInt(128) result; +_Bool status = __builtin_mul_overflow(x, y, &result); // expected-error {{__builtin_mul_overfl

[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-03 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe updated this revision to Diff 363950. FreddyYe added a comment. update commit message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107420/new/ https://reviews.llvm.org/D107420 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td c

[PATCH] D107420: [sema] Disallow __builtin_mul_overflow under special condition.

2021-08-03 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe created this revision. FreddyYe requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. When __builtin_mul_overflow has input combination of (signed, signed, unsigned*) and arbitary width is larger than 64 bits, it will also generate i256