[PATCH] D110037: [X86] Always check the size of SourceTy before getting the next type

2021-09-20 Thread Pengfei Wang 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 rG227673398c2d: [X86] Always check the size of SourceTy before getting the next type (authored by pengfei). Repository: rG LLVM Github Monorepo CHA

[PATCH] D109658: [X86][FP16] Change the order of the operands in complex FMA intrinsics to allow swap between the mul operands.

2021-09-22 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/Headers/avx512fp16intrin.h:2972 #define _mm_mask_fcmadd_round_sch(A, U, B, C, R) \ ((__m128h)__builtin_ia32_selectps_128( \ (__mmask8)(U & 1),

[PATCH] D109658: [X86][FP16] Change the order of the operands in complex FMA intrinsics to allow swap between the mul operands.

2021-09-22 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/Headers/avx512fp16intrin.h:2972 #define _mm_mask_fcmadd_round_sch(A, U, B, C, R) \ ((__m128h)__builtin_ia32_selectps_128( \ (__mmask8)(U & 1),

[PATCH] D109658: [X86][FP16] Change the order of the operands in complex FMA intrinsics to allow swap between the mul operands.

2021-09-22 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. By the way, we synced with GCC and we are using the same order in the builtins now. https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=db3b96df03fdbe2fb770729501e2e9b65e66c2da;hp=ed643e9f171e99b0aa1453b3f29ed1103e9b5c80 We still have some different builtin names due to hi

[PATCH] D109658: [X86][FP16] Change the order of the operands in complex FMA intrinsics to allow swap between the mul operands.

2021-09-22 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. Thanks Craig! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109658/new/ https://reviews.llvm.org/D109658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[PATCH] D109658: [X86][FP16] Change the order of the operands in complex FMA intrinsics to allow swap between the mul operands.

2021-09-22 Thread Pengfei Wang 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 rGebec077e07f5: [X86][FP16] Change the order of the operands in complex FMA intrinsics to allow… (authored by pengfei). Repository: rG LLVM Github M

[PATCH] D110336: [X86][FP16] Add more builtins to avoid multi evaluation problems & add 2 missed intrinsics

2021-09-23 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei created this revision. pengfei added reviewers: LuoYuanke, craig.topper, RKSimon, yubing. pengfei requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D110

[PATCH] D110336: [X86][FP16] Add more builtins to avoid multi evaluation problems & add 2 missed intrinsics

2021-09-23 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/include/clang/Basic/BuiltinsX86.def:2021 TARGET_BUILTIN(__builtin_ia32_vfmaddcph256_maskz, "V8fV8fV8fV8fUc", "ncV:256:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddcph512_mask, "V16fV16fV16fV16fUsIi", "ncV:512

[PATCH] D110336: [X86][FP16] Add more builtins to avoid multi evaluation problems & add 2 missed intrinsics

2021-09-23 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 374704. pengfei added a comment. Move mask to the second to last operand. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110336/new/ https://reviews.llvm.org/D110336 Files: clang/include/clang/Basic/BuiltinsX

[PATCH] D110336: [X86][FP16] Add more builtins to avoid multi evaluation problems & add 2 missed intrinsics

2021-09-26 Thread Pengfei Wang 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 rG7d6889964ab5: [X86][FP16] Add more builtins to avoid multi evaluation problems & add 2 missed… (authored by pengfei). Changed prior to commit: htt

[PATCH] D109607: [X86] Refactor GetSSETypeAtOffset to fix pr51813

2021-09-29 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. In D109607#3030478 , @dyung wrote: > Hi, our internal testing started to hit an assertion failure in one of our > tests after this commit. I have put the details in PR52011, can you please > take a look? Sure. Thanks for report

[PATCH] D111037: [X86] Check if struct is blank before getting the inner types

2021-10-03 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei created this revision. pengfei added reviewers: dyung, LuoYuanke. pengfei requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This fixes pr52011. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D111037 Files: clang/

[PATCH] D107141: [Inline-asm] Add structure type handling when they are tied in input and output constraints

2021-10-05 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 377168. pengfei added a comment. Rebase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107141/new/ https://reviews.llvm.org/D107141 Files: clang/lib/CodeGen/CGStmt.cpp clang/lib/Sema/SemaStmtAsm.cpp clan

[PATCH] D96315: [X86][AMX] Assemble new AMX interface to an experiment header file.

2021-02-08 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/Headers/amxintrin_experiment.h:12 + * This file is experiment interface for AMX new programming model. + */ + It's better to add such macros: ``` #ifndef __AMXINTRIN_EXPERIMENT_H #define __AMXINTRIN_EXPERIMENT_

[PATCH] D96315: [X86][AMX] Assemble new AMX interface to an experiment header file.

2021-02-08 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. Hi @craig.topper, this patch is intent upon LLVM 12.0 release stablization, since the new AMX interface is on development and has some know issues. Do you think it is necessary and enough for the release? If it does, we can commit it to both trunk and 12.x branch. Rep

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-09 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:433 +bool X86LowerAMXIntrinsics::visit() { + bool C; + SmallVector TileDPBSSDs; `bool C = false` Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cp

[PATCH] D96110: [X86] Pass to transform tdpbf16ps intrinsics to scalar operation.

2021-02-09 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/test/CodeGen/X86/AMX/amx-low-intrinsics.ll:174-175 +; CHECK-NEXT:[[TMP13:%.*]] = bitcast i32 [[TMP12]] to <2 x i16> +; CHECK-NEXT:[[TMP14:%.*]] = zext <2 x i16> [[TMP11]] to <2 x i32> +; CHECK-NEXT:[[TMP15:%.*]] = shl <2

[PATCH] D96231: [X86] Always assign reassoc flag for intrinsics *reduce_add/mul_ps/pd.

2021-02-09 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 322344. pengfei marked 7 inline comments as done. pengfei added a comment. Address Sanjay's comments. Thanks for the thoroughly review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96231/new/ https://reviews.l

[PATCH] D96231: [X86] Always assign reassoc flag for intrinsics *reduce_add/mul_ps/pd.

2021-02-09 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/CodeGen/CGBuiltin.cpp:13829 CGM.getIntrinsic(Intrinsic::vector_reduce_fadd, Ops[1]->getType()); +Builder.getFastMathFlags().setAllowReassoc(true); return Builder.CreateCall(F, {Ops[0], Ops[1]}); --

[PATCH] D96231: [X86] Always assign reassoc flag for intrinsics *reduce_add/mul_ps/pd.

2021-02-09 Thread Pengfei Wang 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 rGdd2460ed5d77: [X86] Always assign reassoc flag for intrinsics *reduce_add/mul_ps/pd. (authored by pengfei). Repository: rG LLVM Github Monorepo C

[PATCH] D93179: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

2021-02-09 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei commandeered this revision. pengfei edited reviewers, added: RKSimon; removed: pengfei. pengfei added a comment. @RKSimon Sure, with pleasure😊 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93179/new/ https://reviews.llvm.org/D93179 ___

[PATCH] D93179: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

2021-02-10 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 322611. pengfei added a comment. Add nnan and nsz flags for fmin/fmax llvm.reduction intrinsics. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93179/new/ https://reviews.llvm.org/D93179 Files: clang/include/

[PATCH] D93179: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

2021-02-10 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 322613. pengfei added a comment. Minor fixes in tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93179/new/ https://reviews.llvm.org/D93179 Files: clang/include/clang/Basic/BuiltinsX86.def clang/lib/Co

[PATCH] D93179: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

2021-02-10 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 322615. pengfei added a comment. Minor fixes in tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93179/new/ https://reviews.llvm.org/D93179 Files: clang/include/clang/Basic/BuiltinsX86.def clang/lib/Co

[PATCH] D93179: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

2021-02-10 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 322616. pengfei added a comment. Minor fixes in tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93179/new/ https://reviews.llvm.org/D93179 Files: clang/include/clang/Basic/BuiltinsX86.def clang/lib/Co

[PATCH] D93179: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

2021-02-14 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 323601. pengfei added a comment. Address Sanjay's comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93179/new/ https://reviews.llvm.org/D93179 Files: clang/include/clang/Basic/BuiltinsX86.def clang/li

[PATCH] D93179: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

2021-02-14 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/Headers/avx512fintrin.h:9305 + * 1. The elements are reassociable when using fadd/fmul intrinsics; + * 2. There's no nan and signed zero in the elements when using fmin/max + intrinsics; spatel wrote: > If I un

[PATCH] D93179: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

2021-02-14 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 323602. pengfei added a comment. Update test accordingly. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93179/new/ https://reviews.llvm.org/D93179 Files: clang/include/clang/Basic/BuiltinsX86.def clang/lib

[PATCH] D93179: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

2021-02-14 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 323603. pengfei added a comment. Minor fix. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93179/new/ https://reviews.llvm.org/D93179 Files: clang/include/clang/Basic/BuiltinsX86.def clang/lib/CodeGen/CGBui

[PATCH] D93179: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

2021-02-14 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/Headers/avx512fintrin.h:9305 + * 1. The elements are reassociable when using fadd/fmul intrinsics; + * 2. There's no nan and signed zero in the elements when using fmin/max + intrinsics; spatel wrote: > pengfei

[PATCH] D93179: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

2021-02-14 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 323616. pengfei added a comment. Address Sanjay's comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93179/new/ https://reviews.llvm.org/D93179 Files: clang/include/clang/Basic/BuiltinsX86.def clang/li

[PATCH] D93179: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction intrinsics (PR47506)

2021-02-14 Thread Pengfei Wang 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 rG61da20575d6c: [X86] Convert fmin/fmax _mm_reduce_* intrinsics to emit llvm.reduction… (authored by pengfei). Repository: rG LLVM Github Monorepo

[PATCH] D96709: Add Windows ehcont section support (/guard:ehcont).

2021-02-15 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei created this revision. pengfei added reviewers: arlosi, rnk, thakis, ajpaverd, theraven, pcc. Herald added subscribers: dexonsmith, dang. Herald added a reviewer: jansvoboda11. pengfei requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-comm

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-21 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:490 + Instruction &Inst = *II++; + if (match(&Inst, m_Intrinsic()) || + match(&Inst, m_Intrinsic()) || Should be better to use ``` if (auto *Inst = dyn_ca

[PATCH] D97259: [X86] Support amx-int8 intrinsic.

2021-02-23 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei accepted this revision. pengfei added a comment. This revision is now accepted and ready to land. LGTM. Comment at: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:4625 + +case Intrinsic::x86_tdpbssd_internal: +case Intrinsic::x86_tdpbsud_internal: Nit:

[PATCH] D97318: [clang][CodeGen] Allow fp16 arg pass by register

2021-02-23 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei requested changes to this revision. pengfei added inline comments. This revision now requires changes to proceed. Comment at: clang/lib/CodeGen/TargetInfo.cpp:2821 +} else if (k == BuiltinType::Float16 || k == BuiltinType::Half) { + // AMD64 does not support _Flo

[PATCH] D97318: [clang][CodeGen] Allow fp16 arg pass by register

2021-02-23 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. I don't think the patch is doing right. Comment at: clang/lib/CodeGen/TargetInfo.cpp:2821 +} else if (k == BuiltinType::Float16 || k == BuiltinType::Half) { + // AMD64 does not support operations on _Float16 or __fp16 other than + // load

[PATCH] D97358: [X86] Support amx-bf16 intrinsic.

2021-02-23 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/Headers/amxintrin.h:283 +typedef struct __tile1024bf16_str { + const unsigned short row; Is there much value to differentiate the type? We are using the same AMX type in the builtins. What do you think? @Lu

[PATCH] D97358: [X86] Support amx-bf16 intrinsic.

2021-02-23 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/Headers/amxintrin.h:283 +typedef struct __tile1024bf16_str { + const unsigned short row; LiuChen3 wrote: > LuoYuanke wrote: > > pengfei wrote: > > > Is there much value to differentiate the type? We are usin

[PATCH] D97358: [X86] Support amx-bf16 intrinsic.

2021-02-24 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei accepted this revision. pengfei added a comment. This revision is now accepted and ready to land. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97358/new/ https://reviews.llvm.org/D97358 __

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-24 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/include/llvm/CodeGen/Passes.h:496 + + /// The pass transform amx intrinsics to scalar operation if the function has + /// optnone attribute or it is O0. transforms Comment at: llvm/lib/Target/X8

[PATCH] D93594: [X86] Pass to transform amx intrinsics to scalar operation.

2021-02-24 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:311 + Value *ResElt = B.CreateAdd(EltC, SubVecR); + Value *NewVecC = B.CreateInsertElement(VecCPhi, ResElt, IdxC); + Value *NewVecD = B.CreateInsertElement(VecDPhi, ResElt, IdxC);

[PATCH] D99675: [llvm][clang] Create new intrinsic llvm.arith.fence to control FP optimization at expression level

2021-06-07 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/docs/LangRef.rst:21195 +'``llvm.arithmetic_fence``' Intrinsic +^^ + Should be equal to the text? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D99675: [llvm][clang] Create new intrinsic llvm.arith.fence to control FP optimization at expression level

2021-06-09 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/docs/LangRef.rst:21195 +'``llvm.arithmetic_fence``' Intrinsic +^^ + pengfei wrote: > Should be equal to the text? Yeah, a good catch. But I initially meant `^^^` should be equal to the ti

[PATCH] D87981: [X86] AMX programming model.

2021-06-15 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:4675 } +case Intrinsic::x86_tilestored64_internal: { + unsigned Opc = X86::PTILESTOREDV; yubing wrote: > It seems there should be a check here, according to line4575:

[PATCH] D104145: [clang] NFC: adjust indentation of statements with more than one lines

2021-06-20 Thread Pengfei Wang via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG735ad67a4ce8: [clang] NFC: adjust indentation of statements with more than one lines (authored by zhouyizhou, committed by pengfei). Herald added a project: clang. Herald added a subscriber: cfe-commits.

[PATCH] D104604: [clang] NFC: add line break at the end of if expressions

2021-06-20 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei accepted this revision. pengfei added a comment. This revision is now accepted and ready to land. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104604/new/ https://reviews.llvm.org/D104604

[PATCH] D103943: [X86] Add -mgeneral-regs-only support.

2021-06-21 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/include/clang/Driver/Options.td:3214 -def mgeneral_regs_only : Flag<["-"], "mgeneral-regs-only">, Group, - HelpText<"Generate code which only uses the general purpose registers (AArch64 only)">; +def mgeneral_regs_only : Flag<

[PATCH] D103943: [X86] Add -mgeneral-regs-only support.

2021-06-23 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei accepted this revision. pengfei added a comment. This revision is now accepted and ready to land. LGTM. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103943/new/ https://reviews.llvm.org/D103943 ___ cfe-commits mailing list cfe-commit

[PATCH] D107141: [Inline-asm] Add semacheck for unsupported constraint

2021-07-30 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei created this revision. pengfei added reviewers: jyu2, epastor, ABataev, kbsmith1, LuoYuanke. pengfei requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Clang will crash if we tie a structure with a small size type. This patch adds chec

[PATCH] D107082: [X86][RFC] Enable `_Float16` type support on X86 following the psABI

2021-08-02 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. After the last refactor, I think this patch is mostly ready. This patch strips most of the ABI and _Float16 type related code from D105263 , which can be leaving with only AVX512-FP16 ISA enabling code. I think it should be more friendly

[PATCH] D107141: [Inline-asm] Add semacheck for unsupported constraint

2021-08-02 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. @jyu2, Thanks for the detailed information. > Besides, if we change "=rm" to "=r" > or "=m", GCC and ICC will report error differently. Which gives me an > impression that the use of constraint is undefined behavior. > To me it is defined behavior. Or I may missing some t

[PATCH] D107141: [Inline-asm] Add semacheck for unsupported constraint

2021-08-02 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. > First I did not say "code doesn't make much sense to me". This is copy form > your description. Oop, my bad understanding. :) > both gcc and icc generated code is not making sense to you. Yes. Unless there's document to specify the behavior clearly. > So instead, yo

[PATCH] D107141: [Inline-asm] Add semacheck for unsupported constraint

2021-08-03 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 363746. pengfei added a comment. Implemented the handling for structure types. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107141/new/ https://reviews.llvm.org/D107141 Files: clang/lib/CodeGen/CGStmt.cpp

[PATCH] D107141: [Inline-asm] Add structure type handling when they are tied in input and output constraints

2021-08-03 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 363974. pengfei added a comment. Address Jennifer comments from off-line. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107141/new/ https://reviews.llvm.org/D107141 Files: clang/lib/CodeGen/CGStmt.cpp clan

[PATCH] D105263: [X86] AVX512FP16 instructions enabling 1/6

2021-08-06 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei marked 7 inline comments as done. pengfei added a comment. Thanks Yuanke. Comment at: clang/lib/Headers/avx512fp16intrin.h:292 + + return (__m128h)__builtin_ia32_loadsh128_mask((__v8hf *)__A, src, __U & 1); +} LuoYuanke wrote: > Just be curious, why no

[PATCH] D105263: [X86] AVX512FP16 instructions enabling 1/6

2021-08-06 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/X86InstrAVX512.td:4478 + let Predicates = [HasFP16] in { +def VMOVSHZrr_REV: AVX512<0x11, MRMDestReg, (outs VR128X:$dst), +(ins VR128X:$src1, VR128X:$src2), craig.topper wrote: > pengfei

[PATCH] D105263: [X86] AVX512FP16 instructions enabling 1/6

2021-08-08 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:3471 + ContainsFloatAtOffset(IRType, IROffset + 4, getDataLayout())) +return llvm::FixedVectorType::get(llvm::Type::getHalfTy(getVMContext()), 4); + LuoYuanke wrote: > For 2 flo

[PATCH] D105462: [X86] Add CRC32 feature.

2021-08-09 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/Headers/crc32intrin.h:13 + +#define __DEFAULT_FN_ATTRS \ + __attribute__((__always_inline__, __nodebug__, __target__("crc32"))) Better to follow Lint's suggestions. Comment at: clang/lib/Hea

[PATCH] D105331: [CFE][X86] Enable complex _Float16.

2021-08-09 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. In D105331#2933893 , @LuoYuanke wrote: > Would you check the failure of the test cases? They failed due to they are built based on the ToT instead of the 1st patch of FP16. Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D105331: [CFE][X86] Enable complex _Float16.

2021-08-09 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 365360. pengfei added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105331/new/ https://reviews.llvm.org/D105331 Files: clang/lib/CodeGen/TargetInfo.cpp clang/lib/Sema/DeclSpec.cpp cl

[PATCH] D107843: [X86] Add parentheses around casts in some of the X86 intrinsic headers.

2021-08-10 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei accepted this revision. pengfei added a comment. This revision is now accepted and ready to land. Thanks Craig. I haven't find time to work on it. I think this is a good start. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107843/new/

[PATCH] D105263: [X86] AVX512FP16 instructions enabling 1/6

2021-08-11 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/X86InstrAVX512.td:4159 +defm VMOVSHZ : avx512_move_scalar<"vmovsh", X86Movsh, X86vzload16, f16x_info, + [HasFP16]>, + VEX_LIG, T_MAP5XS, EVEX_CD8<16, C

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-08-11 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 365738. pengfei marked 6 inline comments as done. pengfei added a comment. 1. Rebase to the first merged FP16 patch. 2. Address Yuanke's comments. 3. Add parentheses around casts. 4. Remove OptForSize predicate for vmovsh. 5. Add more immediate value for encod

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-08-11 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/include/clang/Basic/BuiltinsX86.def:1860 +TARGET_BUILTIN(__builtin_ia32_minph512, "V32xV32xV32xIi", "ncV:512:", "avx512fp16") + +TARGET_BUILTIN(__builtin_ia32_minph256, "V16xV16xV16x", "ncV:256:", "avx512fp16,avx512vl")

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-08-11 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. Thanks for the review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105264/new/ https://reviews.llvm.org/D105264 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-08-11 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 365895. pengfei marked 3 inline comments as done. pengfei added a comment. Address Yuanke's comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105264/new/ https://reviews.llvm.org/D105264 Files: clang/i

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-08-11 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3197 + else if (PatchedName.endswith("sh")) +PatchedName = IsVCMP ? "vcmpsh" : "cmpsh"; + else if (PatchedName.endswith("ph")) LuoYuanke wrote: > There is

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-08-11 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 365899. pengfei added a comment. Update missing changes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105264/new/ https://reviews.llvm.org/D105264 Files: clang/include/clang/Basic/BuiltinsX86.def clang/li

[PATCH] D107946: [X86] Reverse *_set_ph and *_setr_ph 's set order.

2021-08-11 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei accepted this revision. pengfei added a comment. This revision is now accepted and ready to land. LGTM. Thanks Freddy. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107946/new/ https://reviews.llvm.org/D107946 _

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-08-12 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 365995. pengfei marked an inline comment as done. pengfei added a comment. Address Yuanke's comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105264/new/ https://reviews.llvm.org/D105264 Files: clang/i

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-08-12 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/X86InstrFoldTables.cpp:4838 { X86::VMULSDZrr_Intk,X86::VMULSDZrm_Intk, TB_NO_REVERSE }, + { X86::VMULSHZrr_Intk,X86::VMULSHZrm_Intk, TB_NO_REVERSE }, { X86::VMULS

[PATCH] D105265: [X86] AVX512FP16 instructions enabling 3/6

2021-08-12 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/Headers/avx512fp16intrin.h:1748 + +#define _mm_cvt_roundsh_i32(A, R) \ + (int)__builtin_ia32_vcvtsh2si32((__v8hf)(A), (int)(R)) LuoYuanke wrote: > Does it also ret

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-08-12 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 366194. pengfei added a comment. Address Yuanke's comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105264/new/ https://reviews.llvm.org/D105264 Files: clang/include/clang/Basic/BuiltinsX86.def clang/

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-08-12 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. Thanks for the review! Comment at: clang/lib/Headers/avx512vlfp16intrin.h:368 +_mm256_reduce_add_ph(__m256h __W) { + return __builtin_ia32_reduce_fadd_ph256(0.0f16, __W); +} LuoYuanke wrote: > From https://llvm.org/docs/LangRef.html#ll

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-08-14 Thread Pengfei Wang 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 rGf1de9d6dae17: [X86] AVX512FP16 instructions enabling 2/6 (authored by pengfei). Changed prior to commit: https://reviews.llvm.org/D105264?vs=36619

[PATCH] D105265: [X86] AVX512FP16 instructions enabling 3/6

2021-08-14 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 366470. pengfei marked an inline comment as done. pengfei added a comment. Rebased. Add extra parentheses for macro. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105265/new/ https://reviews.llvm.org/D105265 F

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-08-15 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. Thanks Craig! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105264/new/ https://reviews.llvm.org/D105264 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[PATCH] D105265: [X86] AVX512FP16 instructions enabling 3/6

2021-08-16 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 366630. pengfei added a comment. 1. Address Yuanke's comments. 2. Add missed strict FP handling. 3. Refactor the repeated declarations for strict FP. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105265/new/ ht

[PATCH] D105265: [X86] AVX512FP16 instructions enabling 3/6

2021-08-16 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:1996 setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v16f16, Custom); + setOperationAction(ISD::SINT_TO_FP, MVT::v16i16, Legal); + setOperationAction(ISD::STRICT_SINT_TO_F

[PATCH] D105265: [X86] AVX512FP16 instructions enabling 3/6

2021-08-16 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:1996 setOperationAction(ISD::SCALAR_TO_VECTOR, MVT::v16f16, Custom); + setOperationAction(ISD::SINT_TO_FP, MVT::v16i16, Legal); + setOperationAction(ISD::STRICT_SINT_TO_F

[PATCH] D105268: [X86] AVX512FP16 instructions enabling 5/6

2021-08-17 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 366873. pengfei added a comment. Rebased. Add extra parentheses for macro. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105268/new/ https://reviews.llvm.org/D105268 Files: clang/include/clang/Basic/Builtins

[PATCH] D105268: [X86] AVX512FP16 instructions enabling 5/6

2021-08-17 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/Headers/avx512fp16intrin.h:2373 + (__v32hf)(__m512h)(A), (__v32hf)(__m512h)(B), (__v32hf)(__m512h)(C), \ + (__mmask32)-1, (int)(R)) + RKSimon wrote: > Add outer brackets to all the defines to pre

[PATCH] D105265: [X86] AVX512FP16 instructions enabling 3/6

2021-08-17 Thread Pengfei Wang 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 rG2379949aadce: [X86] AVX512FP16 instructions enabling 3/6 (authored by pengfei). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D105331: [CFE][X86] Enable complex _Float16 support

2021-08-17 Thread Pengfei Wang via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5aeca3b0a595: [CFE][X86] Enable complex _Float16 support (authored by pengfei). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105331/new/ https://reviews.ll

[PATCH] D105267: [X86] AVX512FP16 instructions enabling 4/6

2021-08-17 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/include/clang/Basic/BuiltinsX86.def:1897 + +TARGET_BUILTIN(__builtin_ia32_rndscaleph_128_mask, "V8xV8xIiV8xUc", "ncV:128:", "avx512fp16,avx512vl") +TARGET_BUILTIN(__builtin_ia32_rndscaleph_256_mask, "V16xV16xIiV16xUs", "ncV:256:"

[PATCH] D105267: [X86] AVX512FP16 instructions enabling 4/6

2021-08-19 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. Thanks Yuanke and Craig. Comment at: llvm/lib/Target/X86/X86InstrAVX512.td:9279 /// avx512_fp14_s rcp14ss, rcp14sd, rsqrt14ss, rsqrt14sd multiclass avx512_fp14_s opc, string OpcodeStr, SDNode OpNode, + X86FoldableSchedWrite sch

[PATCH] D104604: [clang] NFC: add line break at the end of if expressions

2021-06-30 Thread Pengfei Wang via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2fd75507d185: [clang] NFC: add line break at the end of if expressions (authored by zhouyizhou, committed by pengfei). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-06-30 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei created this revision. pengfei added reviewers: craig.topper, RKSimon, spatel, LiuChen3, FreddyYe, yubing, LuoYuanke. Herald added a subscriber: hiraditya. pengfei requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. E

[PATCH] D105265: [X86] AVX512FP16 instructions enabling 3/6

2021-06-30 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei created this revision. pengfei added reviewers: craig.topper, RKSimon, spatel, LiuChen3, FreddyYe, yubing, LuoYuanke. Herald added a subscriber: hiraditya. pengfei requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. E

[PATCH] D105265: [X86] AVX512FP16 instructions enabling 3/6

2021-06-30 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 355786. pengfei added a comment. Remove unexpected intrinsics. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105265/new/ https://reviews.llvm.org/D105265 Files: clang/include/clang/Basic/BuiltinsX86.def cl

[PATCH] D105268: [X86] AVX512FP16 instructions enabling 5/6

2021-07-01 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei created this revision. pengfei added reviewers: craig.topper, RKSimon, spatel, LiuChen3, FreddyYe, yubing, LuoYuanke. Herald added a subscriber: hiraditya. pengfei requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. E

[PATCH] D105263: [X86] AVX512FP16 instructions enabling 1/6

2021-07-01 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. In D105263#2852295 , @tschuett wrote: > Could you add a link to a reference? Done. Thanks for reminding. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105263/new/ https://reviews.

[PATCH] D105331: [CFE][X86] Enable complex _Float16.

2021-07-01 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei created this revision. pengfei requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D105331 Files: clang/lib/CodeGen/TargetInfo.cpp clang/lib/Sema/DeclSpec.cpp clang/

[PATCH] D105263: [X86] AVX512FP16 instructions enabling 1/6

2021-07-01 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/test/CodeGen/X86/avx512fp16-complex.c:1 +// RUN: %clang_cc1 %s -O0 -fno-experimental-new-pass-manager -emit-llvm -triple x86_64-unknown-unknown -target-feature +avx512fp16 -o - | FileCheck %s --check-prefix=X86 +

[PATCH] D105331: [CFE][X86] Enable complex _Float16.

2021-07-02 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added a comment. In D105331#2854934 , @SjoerdMeijer wrote: > The patch on itself looks reasonable to me. I was just wondering about the > _Float16 support on X86 in general because the Clang docs says: > > _Float16 is currently only supported

[PATCH] D105263: [X86] AVX512FP16 instructions enabling 1/6

2021-07-02 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/Headers/avx512fp16intrin.h:38 + +static __inline__ _Float16 __DEFAULT_FN_ATTRS512 _mm512_cvtsh_h(__m512h __a) { + return __a[0]; RKSimon wrote: > I realize its a lot of work, but is there any chance that we co

[PATCH] D105264: [X86] AVX512FP16 instructions enabling 2/6

2021-07-03 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 356364. pengfei marked 2 inline comments as done. pengfei added a comment. Add prefix AVX512BW for non FP16 cases. Thanks Simon for review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105264/new/ https://revi

[PATCH] D105263: [X86] AVX512FP16 instructions enabling 1/6

2021-07-04 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: clang/lib/Headers/avx512fp16intrin.h:38 + +static __inline__ _Float16 __DEFAULT_FN_ATTRS512 _mm512_cvtsh_h(__m512h __a) { + return __a[0]; RKSimon wrote: > pengfei wrote: > > RKSimon wrote: > > > I realize its a lot of

[PATCH] D105268: [X86] AVX512FP16 instructions enabling 5/6

2021-07-05 Thread Pengfei Wang via Phabricator via cfe-commits
pengfei added inline comments. Comment at: llvm/test/CodeGen/X86/stack-folding-fp-avx512fp16vl-fma.ll:193-194 +define <8 x half> @stack_fold_fmsub123ph(<8 x half> %a0, <8 x half> %a1, <8 x half> %a2) { + ;check-label: stack_fold_fmsub123ph: + ;check: vfmsub213ph {{-?[0-9

<    1   2   3   >