[PATCH] D117829: [Clang] Add integer add/mul reduction builtins

2022-01-21 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a subscriber: junaire. fhahn added a comment. Thanks for the patch! > For other reductions, we've tried to share builtins for float/integer > vectors, but the fadd/fmul reduction builtins also take a starting value > argument. Technically I could support float by using default

[PATCH] D105169: [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default

2022-01-20 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2535 ArgAttrs[FirstIRArg + i] = llvm::AttributeSet::get(getLLVMContext(), Attrs); } nlopes wrote: > sammccall wrote: > > fhahn wrote: > > > nlopes wrote: > > > >

[PATCH] D117431: [IRBuilder] Migrate and-folding to value-based FoldAnd.

2022-01-20 Thread Florian Hahn via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG782c0dd1a1c2: [IRBuilder] Migrate and-folding to value-based FoldAnd. (authored by fhahn). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117431/new/

[PATCH] D105169: [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default

2022-01-20 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2535 ArgAttrs[FirstIRArg + i] = llvm::AttributeSet::get(getLLVMContext(), Attrs); } nlopes wrote: > fhahn wrote: > > nlopes wrote: > > > ab wrote: > > > > Hmm, if

[PATCH] D105169: [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default

2022-01-19 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2535 ArgAttrs[FirstIRArg + i] = llvm::AttributeSet::get(getLLVMContext(), Attrs); } nlopes wrote: > ab wrote: > > Hmm, if I'm reading this right, this overwrites the

[PATCH] D117431: [IRBuilder] Migrate and-folding to value-based FoldAnd.

2022-01-19 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 401253. fhahn added a comment. rebase to trigger new run of precommit tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117431/new/ https://reviews.llvm.org/D117431 Files:

[PATCH] D117431: [IRBuilder] Migrate and-folding to value-based FoldAnd.

2022-01-17 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 400583. fhahn added a subscriber: Meinersbur. fhahn added a comment. Herald added a reviewer: bollu. Fix failing polly tests. @Meinersbur looks like some Polly tests were relying on the IRBuilder folding `and i1 %X, true`. This patch moves the logic to a

[PATCH] D117431: [IRBuilder] Migrate and-folding to value-based FoldAnd.

2022-01-17 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 400531. fhahn added a comment. Rebase to re-trigger tests. Looks like there are a couple of additional tests that need updating. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117431/new/

[PATCH] D117431: [IRBuilder] Migrate and-folding to value-based FoldAnd.

2022-01-16 Thread Florian Hahn via Phabricator via cfe-commits
fhahn created this revision. fhahn added reviewers: reames, nikic, lebedev.ri, nhaehnle. Herald added a subscriber: dexonsmith. fhahn requested review of this revision. Herald added projects: clang, LLVM. Herald added a subscriber: cfe-commits. Similar to the migration of or-folding to FoldOr,

[PATCH] D117091: [Clang] Add attributes alloc_size and alloc_align to mm_malloc

2022-01-16 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. Not really familiar with testing for clang headers. Is it possible to test the new attributes have the desired effect? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117091/new/ https://reviews.llvm.org/D117091

[PATCH] D116736: [Clang] Add __builtin_reduce_or and __builtin_reduce_and

2022-01-14 Thread Florian Hahn via Phabricator via cfe-commits
fhahn accepted this revision. fhahn added a comment. This revision is now accepted and ready to land. In D116736#3242623 , @junaire wrote: >> @junaire did you already get commit access or should I commit this change on >> your behalf? > > Yeah, I

[PATCH] D116736: [Clang] Add __builtin_reduce_or and __builtin_reduce_and

2022-01-13 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. @junaire did you already get commit access or should I commit this change on your behalf? In D116736#3239530 , @junaire wrote: > In D116736#3230040 , @fhahn wrote: > >> LGTM, thanks! >>

[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-12 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. It looks like this may be causing the following bot to fail https://lab.llvm.org/buildbot/#/builders/16/builds/22138 with TEST 'lld :: COFF/lto-lazy-reference.ll' FAILED Script: -- : 'RUN: at line 2';

[PATCH] D116919: [AST] Add RParen loc for decltype AutoTypeloc.

2022-01-12 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D116919#3236899 , @mstorsjo wrote: > The relanded version in rG41fbdfa4d5601cccbcdc0ded8ef35190d502f7f3 > seems > to be breaking some builds with PCH for

[PATCH] D116935: [IRBuilder] Introduce folder using inst-simplify, use for Or fold.

2022-01-11 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D116935#3232763 , @craig.topper wrote: > Do the programs in compile-time tracker make much use of bitfields? I'd expect some bitfields, but nothing excessive/pathological. > Is there any indication in rdar://7362516 what

[PATCH] D116736: [Clang] Add __builtin_reduce_or and __builtin_reduce_and

2022-01-09 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added reviewers: aaron.ballman, erichkeane. fhahn added a comment. LGTM, thanks! > The last __builtin_reduce_add will be seperated into another one. Are you planning on putting up a patch for this one as well? What makes add a bit different is that `‘llvm.vector.reduce.fadd.*’` can only

[PATCH] D115429: [Clang] Implement the rest of __builtin_elementwise_* functions.

2022-01-07 Thread Florian Hahn via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb2ed9f3f44d0: [Clang] Implement the rest of __builtin_elementwise_* functions. (authored by junaire, committed by fhahn). Repository: rG LLVM

[PATCH] D115429: [Clang] Implement the rest of __builtin_elementwise_* functions.

2022-01-04 Thread Florian Hahn via Phabricator via cfe-commits
fhahn accepted this revision. fhahn added a comment. This revision is now accepted and ready to land. LGTM, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115429/new/ https://reviews.llvm.org/D115429

[PATCH] D115429: [Clang] Implement the rest of __builtin_elementwise_* functions.

2022-01-04 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D115429#3219395 , @junaire wrote: > In D115429#3219338 , @fhahn wrote: > >> This now needs a rebase after landing 5c57e6aa5777 >>

[PATCH] D116161: [Clang] Extend emitUnaryBuiltin to avoid duplicate logic.

2022-01-04 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D116161#3219149 , @junaire wrote: > In D116161#3219080 , @fhahn wrote: > >> @junaire please let me know if you want me to land this on your behalf. > > Yeah, thanks a lot! > > You can

[PATCH] D115429: [Clang] Implement the rest of __builtin_elementwise_* functions.

2022-01-04 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. This now needs a rebase after landing 5c57e6aa5777 , then it should be good to go. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115429/new/

[PATCH] D116161: [Clang] Extend emitUnaryBuiltin to avoid duplicate logic.

2022-01-04 Thread Florian Hahn via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG5c57e6aa5777: [Clang] Extend emitUnaryBuiltin to avoid duplicate logic. (authored by junaire, committed by fhahn). Repository: rG LLVM Github

[PATCH] D116161: [Clang] Extend emitUnaryBuiltin to avoid duplicate logic.

2022-01-04 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. @junaire please let me know if you want me to land this on your behalf. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116161/new/ https://reviews.llvm.org/D116161 ___ cfe-commits

[PATCH] D116161: [Clang] Extend emitUnaryBuiltin to avoid duplicate logic.

2022-01-02 Thread Florian Hahn via Phabricator via cfe-commits
fhahn accepted this revision. fhahn added a comment. This revision is now accepted and ready to land. LGTM, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116161/new/ https://reviews.llvm.org/D116161

[PATCH] D116161: [Clang] Add an overload for emitUnaryBuiltin.

2021-12-28 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D116161#3211178 , @junaire wrote: > In order to use `emitUnaryBuiltin` in other cases, I changed the function > interface. > This allows us to use it in all `Builder.CreateUnaryIntrinsic()` cases, but > will make > the

[PATCH] D116161: [Clang] Add an overload for emitUnaryBuiltin.

2021-12-24 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D116161#3209286 , @junaire wrote: > 35: %0 = load float, float* %f1.addr, align 4 > 36: %1 = load float, float* %f1.addr, align 4 > 37: %elt.abs = call float @llvm.fabs.f32(float %1) It looks like the argument

[PATCH] D116161: [Clang] Add an overload for emitUnaryBuiltin.

2021-12-24 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/lib/CodeGen/CGBuiltin.cpp:3137 else Result = Builder.CreateUnaryIntrinsic(llvm::Intrinsic::fabs, Op0, nullptr, "elt.abs"); Should also be used here?

[PATCH] D116161: [Clang] Add an overload for emitUnaryBuiltin.

2021-12-22 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D116161#3206442 , @junaire wrote: > Update the existing place that can use `emitUnaryBuiltin`. I meant just update the existing uses *without* adding `floor`, `roundeven`, `trunc`, so this change should be NFC (non-functional

[PATCH] D116161: [Clang] Add an overload for emitUnaryBuiltin.

2021-12-22 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. Can you also update the existing places that could use it? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116161/new/ https://reviews.llvm.org/D116161 ___ cfe-commits mailing list

[PATCH] D115231: [Clang] Add __builtin_reduce_xor

2021-12-22 Thread Florian Hahn via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb55ea2fbc0a0: [Clang] Add __builtin_reduce_xor (authored by junaire, committed by fhahn). Changed prior to commit:

[PATCH] D115429: [Clang] Implement the rest of __builtin_elementwise_* functions.

2021-12-21 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D115429#3201713 , @junaire wrote: > Hi, @aaron.ballman I'm sorry for not updating the patch in time because I'm > preparing for my school final exam :-( > One thing I want to mention is that `__builtin_elementwise_roundeven`

[PATCH] D115231: [Clang] Add __builtin_reduce_xor

2021-12-21 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D115231#3197112 , @junaire wrote: > Thanks for accepting this patch! I would appreciate it if someone is willing > to commit this for me since I don't have commit access ;D > > You can use: > Jun Zhang > j...@junz.org It

[PATCH] D115231: [Clang] Add __builtin_reduce_xor

2021-12-16 Thread Florian Hahn via Phabricator via cfe-commits
fhahn accepted this revision. fhahn added a comment. LGTM, thanks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115231/new/ https://reviews.llvm.org/D115231 ___ cfe-commits mailing list

[PATCH] D113779: [Clang] Add mfp16, mfp16fml and mdotprod flags for ARM target features.

2021-12-16 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D113779#3192009 , @SjoerdMeijer wrote: > Ok, fair enough, perhaps adding features is a valid use-case. > > I will refrain from commenting on "things are terribly broken". I agree it > is broken, but in a different way than

[PATCH] D113779: [Clang] Add mfp16, mfp16fml and mdotprod flags for ARM target features.

2021-12-14 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. ping :) Any additional thoughts? Since the original concerns were raised both @manojgupta and myself tried to share a bit of additional background on the motivation and to clarify the difference between `-mXXX` and `-march`. Repository: rG LLVM Github Monorepo

[PATCH] D115231: [Clang] Add __builtin_reduce_xor

2021-12-08 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:2116 + + // __builtin_reduce_xor restricts the element type to vector of integers type + // only. nit: the element type will be restricted to `int`, so maybe say something like `only

[PATCH] D114688: [Clang] Add __builtin_elementwise_ceil

2021-12-07 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. Thanks for the update, it looks like it should be in line with @aaron.ballman's suggestions! I think it might be good to split off the refactoring of `SemaBuiltinElementwiseMathOneArg`-> `PrepareBuiltinElementwiseMathOneArgCall` and the update for

[PATCH] D115231: [Clang] Add __builtin_reduce_xor

2021-12-07 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:2113 + case Builtin::BI__builtin_reduce_xor: if (SemaBuiltinReduceMath(TheCall)) return ExprError(); I think `reduce_xor` is only specified for integer types, so I think we

[PATCH] D114688: [Clang] Add __builtin_elementwise_ceil

2021-12-01 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:16727-16728 QualType TyA = A.get()->getType(); - if (checkMathBuiltinElementType(*this, ArgLoc, TyA)) + if (checkMathBuiltinElementType(*this, ArgLoc, TyA) || + ExtraCheck(TyA, ArgLoc))

[PATCH] D114688: [Clang] Add __builtin_elementwise_ceil

2021-12-01 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:2104 +TheCall, [this](QualType ArgTy, SourceLocation ArgLoc) -> bool { + QualType EltTy = ArgTy; + if (auto *VecTy = EltTy->getAs()) Could you add a

[PATCH] D114688: [Clang] Add __builtin_elementwise_ceil

2021-12-01 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:11337 +def err_builtin_float_invalid_arg_type: Error < + "%ordinal0 argument must be a " There's no need to add a new error message here. `err_builtin_invalid_arg_type`

[PATCH] D114688: [Clang] Add __builtin_elementwise_ceil

2021-11-30 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. Thanks for the patch! I left a suggestion inline. Comment at: clang/lib/Sema/SemaChecking.cpp:16721 +bool Sema::SemaBuiltinElementwiseMathFloatArg(CallExpr *TheCall) { + if (checkArgCount(*this, TheCall, 1)) If I understand correctly,

[PATCH] D114163: Use VersionTuple for parsing versions in Triple. This makes it possible to distinguish between "16" and "16.0" after parsing, which previously was not possible.

2021-11-30 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. It is also breaking building `llvm-project/llvm/unittests/Support/Host.cpp` on macOS: https://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/25781/consoleFull FAILED: unittests/Support/CMakeFiles/SupportTests.dir/Host.cpp.o

[PATCH] D113779: [Clang] Add mfp16, mfp16fml and mdotprod flags for ARM target features.

2021-11-15 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D113779#3130853 , @paulwalker-arm wrote: > Rather than adding connivence options after the fact what about allowing > `-march=` to be specified multiple times? The first must be the usual format > with later ones required to

[PATCH] D113779: [Clang] Add mfp16, mfp16fml and mdotprod flags for ARM target features.

2021-11-15 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D113779#3130744 , @DavidSpickett wrote: > There was a similar proposal for crypto https://reviews.llvm.org/D60472. > > Quoting @manojgupta for the pitch for that: > >> The motivation for this change is to make "crypto" setting

[PATCH] D113779: [Clang] Add mfp16, mfp16fml and mdotprod flags for ARM target features.

2021-11-15 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. In D113779#3130701 , @SjoerdMeijer wrote: > This introduces another way of setting (optional) architecture extensions and > having two ways to do the same is nearly always a bad thing, which is how one > of my colleagues phrased

[PATCH] D113779: [Clang] Add mfp16, mfp16fml and mdotprod flags for ARM target features.

2021-11-12 Thread Florian Hahn via Phabricator via cfe-commits
fhahn created this revision. fhahn added reviewers: aemerson, ab, dmgreen, SjoerdMeijer, scanon. Herald added subscribers: dang, kristof.beyls. fhahn requested review of this revision. Herald added a project: clang. This patch adds support for `-m[no]fpf16`, ` `-m[no]fpf16fml` and `-m[no]dotprod`

[PATCH] D113738: [LTO] Allow passing -Os/-Oz as the optimization level

2021-11-12 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. Could you add tests on the LLVM side for the new options as well? See also D95541 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113738/new/ https://reviews.llvm.org/D113738

[PATCH] D108832: [Builtins] Support ext_vector_type args for __builtin_fminf.

2021-11-03 Thread Florian Hahn via Phabricator via cfe-commits
fhahn abandoned this revision. fhahn added a comment. The vector builtin support took a different direction, see D111529 and following Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108832/new/

[PATCH] D112001: [Clang] Add min/max reduction builtins.

2021-11-02 Thread Florian Hahn via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG7999355106fb: [Clang] Add min/max reduction builtins. (authored by fhahn). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D112001: [Clang] Add min/max reduction builtins.

2021-11-01 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 383900. fhahn added a comment. In D112001#3099965 , @aaron.ballman wrote: > Precommit CI looks to be failing. > > > /var/lib/buildkite-agent/builds/llvm-project/clang/test/CodeGen/builtins-reduction-math.c:13:9: >

[PATCH] D112001: [Clang] Add min/max reduction builtins.

2021-11-01 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 383756. fhahn added a comment. rebase on top of recent changes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112001/new/ https://reviews.llvm.org/D112001 Files: clang/include/clang/Basic/Builtins.def

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-27 Thread Florian Hahn via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG01870d51b848: [Clang] Add elementwise abs builtin. (authored by fhahn). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111986/new/

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 382445. fhahn marked an inline comment as done. fhahn added a comment. add comment to arg of Diag message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111986/new/ https://reviews.llvm.org/D111986 Files:

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked an inline comment as done. fhahn added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:16547 + Expr *A = TheCall->getArg(0); + QualType TyA = A->getType(); + aaron.ballman wrote: > fhahn wrote: > > aaron.ballman wrote: > > > Should

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 382443. fhahn added a comment. Apply UsualUnaryConversions to input argument. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111986/new/ https://reviews.llvm.org/D111986 Files:

[PATCH] D112532: [Matrix] Replace some err kinds with err_builtin_invalid_arg_type. (NFC)

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. fhahn marked an inline comment as done. Closed by commit rGd7fbad0dcfc9: [Matrix] Replace some err kinds with err_builtin_invalid_arg_type. (NFC) (authored by fhahn). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D112532: [Matrix] Replace some err kinds with err_builtin_invalid_arg_type. (NFC)

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked an inline comment as done. fhahn added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:16582 +Diag(Matrix->getBeginLoc(), diag::err_builtin_invalid_arg_type) +<< 1 << 1 << Matrix->getType(); return ExprError();

[PATCH] D112532: [Matrix] Replace some err kinds with err_builtin_invalid_arg_type. (NFC)

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 382413. fhahn added a comment. Add comment to int selecting message as suggested. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112532/new/ https://reviews.llvm.org/D112532 Files:

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8754 +def err_elementwise_math_invalid_arg_type_2: Error < + "argument must have a %0 type, but was %1">; + aaron.ballman wrote: > I feel like we must already have a

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 382376. fhahn marked 2 inline comments as done. fhahn added a comment. Rebased and updated to use `err_builtin_invalid_arg_type`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111986/new/

[PATCH] D112532: [Matrix] Replace some err kinds with err_builtin_invalid_arg_type. (NFC)

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:16654 +Diag(PtrExpr->getBeginLoc(), diag::err_builtin_invalid_arg_type) +<< PtrArgIdx + 1 << "pointer to a valid matrix element type" +<< PtrExpr->getType(); erichkeane

[PATCH] D112532: [Matrix] Replace some err kinds with err_builtin_invalid_arg_type. (NFC)

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 382373. fhahn marked an inline comment as done. fhahn added a comment. Reabsed after landing D111985 . Also turned the custom message parts into a select as suggested. In D112532#3087371

[PATCH] D111985: [Clang] Add elementwise min/max builtins.

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. fhahn marked 3 inline comments as done. Closed by commit rG1ef25d28c19e: [Clang] Add elementwise min/max builtins. (authored by fhahn). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D111529: Specify Clang vector builtins.

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG025988ded6b2: Specify Clang vector builtins. (authored by fhahn). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111529/new/

[PATCH] D111985: [Clang] Add elementwise min/max builtins.

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked 3 inline comments as done. fhahn added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8747-8748 +def err_elementwise_math_arg_types_mismatch : Error < + "argument types do not match, %0 != %1">; + aaron.ballman

[PATCH] D111985: [Clang] Add elementwise min/max builtins.

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 382300. fhahn marked 3 inline comments as done. fhahn added a comment. Address latest comments, thanks - Added a generic `err_builtin_invalid_arg_type` diagnostic kind, which can also be used for some of the matrix type mismatches (see D112532

[PATCH] D112532: [Matrix] Replace some err kinds with err_builtin_invalid_arg_type. (NFC)

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn created this revision. fhahn added reviewers: aaron.ballman, erichkeane, rjmccall. Herald added a subscriber: tschuett. fhahn requested review of this revision. Herald added a project: clang. Replace some custom matrix diagnostic kinds with the more generic err_builtin_invalid_arg_type

[PATCH] D112001: [Clang] Add min/max reduction builtins.

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 382240. fhahn added a comment. Rebased after recent changes in D111985 https://reviews.llvm.org/D111985: changes the return type of SemaBuiltinReduceMath to bool and drop the CallResult argument. Also added tests with const

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 382226. fhahn marked 2 inline comments as done. fhahn added a comment. Rebased after recent changes in D111985 : changes the return type of SemaBuiltinElementwiseMathOneArg to bool and drop the CallResult argument. Also added

[PATCH] D111985: [Clang] Add elementwise min/max builtins.

2021-10-25 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked 4 inline comments as done. fhahn added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:16669 +ExprResult Sema::SemaBuiltinElementwiseMath(CallExpr *TheCall, +ExprResult CallResult) { + if

[PATCH] D111985: [Clang] Add elementwise min/max builtins.

2021-10-25 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 382128. fhahn marked an inline comment as done. fhahn added a comment. Address comments @aaron.ballman, thanks! The most notable changes are using `UsualArithmeticConversions` for argument conversion and checking the canonical types. Also added a bunch of

[PATCH] D111985: [Clang] Add elementwise min/max builtins.

2021-10-25 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked 6 inline comments as done. fhahn added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:16673-16678 + Expr *A = TheCall->getArg(0); + Expr *B = TheCall->getArg(1); + QualType TyA = A->getType(); + QualType TyB = B->getType(); + + if (TyA != TyB)

[PATCH] D111985: [Clang] Add elementwise min/max builtins.

2021-10-25 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked 5 inline comments as done. fhahn added a comment. Thanks for taking a look! Comment at: clang/lib/Sema/SemaChecking.cpp:16659-16660 +// false. +static bool checkMathBuiltinElementType(SourceLocation Loc, QualType Ty, +Sema )

[PATCH] D111985: [Clang] Add elementwise min/max builtins.

2021-10-25 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. ping :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111985/new/ https://reviews.llvm.org/D111985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-20 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked 2 inline comments as done. fhahn added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:16667 + + if (!TyA->getAs() && !ConstantMatrixType::isValidElementType(TyA)) +return Diag(A->getBeginLoc(), diag::err_elementwise_math_invalid_arg_type)

[PATCH] D112001: [Clang] Add min/max reduction builtins.

2021-10-20 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380948. fhahn marked an inline comment as done. fhahn added a comment. rebase on top of recently updated patches. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112001/new/ https://reviews.llvm.org/D112001

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-20 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380947. fhahn added a comment. Use checkMathBuiltinElementType helper added in D111985 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111986/new/

[PATCH] D111985: [Clang] Add elementwise min/max builtins.

2021-10-20 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380946. fhahn added a comment. Move type checking to helper function checkMathBuiltinElementType to be reused in D111986 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-19 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380756. fhahn added a comment. In D111986#3072946 , @scanon wrote: > What's the rationale for making abs undefined on the minimum value? AFAIK > every actual simd implementation defines the result and they agree (and

[PATCH] D111529: Specify Clang vector builtins.

2021-10-19 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380755. fhahn added a comment. As @scanon pointed out in D111986 , most simd implementations should handle abs(INT_MIN) consistently by returngin INT_MIN. It's therefore better to avoid defining abs(INT_MIN) as UB, which

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-19 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked 2 inline comments as done. fhahn added inline comments. Comment at: clang/lib/CodeGen/CGBuiltin.cpp:3109 + Result = Builder.CreateBinaryIntrinsic( + llvm::Intrinsic::abs, Op0, Builder.getFalse(), nullptr, "elt.abs"); +else

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-19 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380618. fhahn added a comment. Pass is_int_min_poison=true to llvm.abs.* to reflect latest update to the specification to make taking abs of the most negative integer undefined. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D111529: Specify Clang vector builtins.

2021-10-19 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380612. fhahn marked an inline comment as done. fhahn added a comment. Following feedback from D111986 , explicitly spell out abs behavior of most negative integer as undefined. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D111529: Specify Clang vector builtins.

2021-10-19 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked an inline comment as done. fhahn added inline comments. Comment at: clang/docs/LanguageExtensions.rst:579 + NaNs, fmax() return a NaN. + ET __builtin_reduce_add(VT a) \+

[PATCH] D111529: Specify Clang vector builtins.

2021-10-19 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380598. fhahn marked an inline comment as done. fhahn added a comment. Thanks @kito-cheng, the example should use `__builtin_reduce_add` instead of `_fadd`! Fixed Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D111529: Specify Clang vector builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked an inline comment as done. fhahn added inline comments. Comment at: clang/docs/LanguageExtensions.rst:557 +``i in [0, Number of elements / 2)``. If the numbers of elements is not a +power of 2, the vector is widening with neutral elements for the reduction +at the

[PATCH] D111529: Specify Clang vector builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380500. fhahn marked an inline comment as done. fhahn added a comment. Fix wording: widening -> widened, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111529/new/ https://reviews.llvm.org/D111529 Files:

[PATCH] D112001: [Clang] Add min/max reduction builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked an inline comment as done. fhahn added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:16673 + if (!VecTy) + if (!TyA->getAs()) + return Diag(A->getBeginLoc(), diag::err_elementwise_math_invalid_arg_type_2) craig.topper wrote: >

[PATCH] D112001: [Clang] Add min/max reduction builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380486. fhahn added a comment. Remove stray `!TyA->getAs()` check. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112001/new/ https://reviews.llvm.org/D112001 Files: clang/include/clang/Basic/Builtins.def

[PATCH] D112001: [Clang] Add min/max reduction builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn created this revision. fhahn added reviewers: aaron.ballman, scanon, craig.topper, rjmccall, erichkeane. fhahn requested review of this revision. Herald added a project: clang. This patch implements __builtin_reduce_max and __builtin_reduce_min as specified in D111529

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380411. fhahn added a comment. polish tests a bit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111986/new/ https://reviews.llvm.org/D111986 Files: clang/include/clang/Basic/Builtins.def

[PATCH] D111985: [Clang] Add elementwise min/max builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380409. fhahn added a comment. polish tests a bit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111985/new/ https://reviews.llvm.org/D111985 Files: clang/include/clang/Basic/Builtins.def

[PATCH] D111529: Specify Clang vector builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked 2 inline comments as done. fhahn added inline comments. Comment at: clang/docs/LanguageExtensions.rst:553 +Each builtin returns a scalar equivalent to applying the specified +operation(x, y) as horizontal recursive pairwise reduction to all vector +elements. In each

[PATCH] D111529: Specify Clang vector builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380352. fhahn marked an inline comment as done. fhahn added a comment. adjust padding wording. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111529/new/ https://reviews.llvm.org/D111529 Files:

[PATCH] D111529: Specify Clang vector builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 380351. fhahn marked an inline comment as done. fhahn added a comment. Thanks for the latest set of comments! I tried to incorporate the suggestions about improving the reduction wording. I also added an example. I also put up 2 patches to start with the

[PATCH] D111986: [Clang] Add elementwise abs builtin.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn created this revision. fhahn added reviewers: aaron.ballman, scanon, craig.topper, rjmccall, erichkeane. Herald added a subscriber: mstorsjo. fhahn requested review of this revision. Herald added a project: clang. This patch implements __builtin_elementwise_abs as specified in D111529

[PATCH] D111985: [Clang] Add elementwise min/max builtins.

2021-10-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn created this revision. fhahn added reviewers: aaron.ballman, scanon, craig.topper, rjmccall, erichkeane. fhahn requested review of this revision. Herald added a project: clang. This patch implements __builtin_elementwise_max and __builtin_elementwise_min, as specified in D111529

[PATCH] D111529: Specify Clang vector builtins.

2021-10-13 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked an inline comment as done. fhahn added inline comments. Comment at: clang/docs/LanguageExtensions.rst:552 +operation(x, y) as pairwise tree reduction to the input. The pairs are formed +by concatenating both inputs and pairing adjacent elements. +

[PATCH] D111529: Specify Clang vector builtins.

2021-10-13 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 379517. fhahn marked 2 inline comments as done. fhahn added a comment. Another stab at phrasing the reduction step. Also added a note that the implementation is work-in-progress. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

<    1   2   3   4   5   6   7   8   >