[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-05-11 Thread Yingwei Zheng via cfe-commits
@@ -1352,20 +1352,43 @@ static void AddParamAndFnBasicAttributes(const CallBase , auto = CalledFunction->getContext(); // Collect valid attributes for all params. - SmallVector ValidParamAttrs; + SmallVector ValidObjParamAttrs, ValidExactParamAttrs; bool

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-05-11 Thread Yingwei Zheng via cfe-commits
@@ -1352,20 +1352,43 @@ static void AddParamAndFnBasicAttributes(const CallBase , auto = CalledFunction->getContext(); // Collect valid attributes for all params. - SmallVector ValidParamAttrs; + SmallVector ValidObjParamAttrs, ValidExactParamAttrs; bool

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-05-10 Thread Yingwei Zheng via cfe-commits
@@ -1383,15 +1406,54 @@ static void AddParamAndFnBasicAttributes(const CallBase , AttributeList AL = NewInnerCB->getAttributes(); for (unsigned I = 0, E = InnerCB->arg_size(); I < E; ++I) { // Check if the underlying value for the parameter is an argument.

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-05-10 Thread Yingwei Zheng via cfe-commits
@@ -1352,20 +1352,43 @@ static void AddParamAndFnBasicAttributes(const CallBase , auto = CalledFunction->getContext(); // Collect valid attributes for all params. - SmallVector ValidParamAttrs; + SmallVector ValidObjParamAttrs, ValidExactParamAttrs; bool

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-05-10 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw commented: Oops I forgot to submit my review comment :( https://github.com/llvm/llvm-project/pull/91101 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Inliner] Propagate more attributes to params when inlining (PR #91101)

2024-05-10 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw edited https://github.com/llvm/llvm-project/pull/91101 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add processor definition and scheduling model for XiangShan-KunMingHu (PR #90392)

2024-04-28 Thread Yingwei Zheng via cfe-commits
=?utf-8?b?6YOd5bq36L6+?= Message-ID: In-Reply-To: @@ -0,0 +1,1489 @@ +//==- RISCVSchedXiangShanKunMingHu.td - XiangShanKunMingHu Scheduling Defs -*- tablegen -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See

[clang] [llvm] [RISCV] Add processor definition and scheduling model for XiangShan-KunMingHu (PR #90392)

2024-04-28 Thread Yingwei Zheng via cfe-commits
=?utf-8?b?6YOd5bq36L6+?= Message-ID: In-Reply-To: @@ -0,0 +1,1489 @@ +//==- RISCVSchedXiangShanKunMingHu.td - XiangShanKunMingHu Scheduling Defs -*- tablegen -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See

[clang] [llvm] [RISCV] Add processor definition and scheduling model for XiangShan-KunMingHu (PR #90392)

2024-04-28 Thread Yingwei Zheng via cfe-commits
=?utf-8?b?6YOd5bq36L6+?= Message-ID: In-Reply-To: @@ -0,0 +1,1489 @@ +//==- RISCVSchedXiangShanKunMingHu.td - XiangShanKunMingHu Scheduling Defs -*- tablegen -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See

[clang] [llvm] [RISCV] Add processor definition and scheduling model for XiangShan-KunMingHu (PR #90392)

2024-04-28 Thread Yingwei Zheng via cfe-commits
=?utf-8?b?6YOd5bq36L6+?= Message-ID: In-Reply-To: @@ -0,0 +1,1489 @@ +//==- RISCVSchedXiangShanKunMingHu.td - XiangShanKunMingHu Scheduling Defs -*- tablegen -*-=// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See

[clang] [llvm] [RISCV] Add processor definition and scheduling model for XiangShan-KunMingHu (PR #90392)

2024-04-28 Thread Yingwei Zheng via cfe-commits
=?utf-8?b?6YOd5bq36L6+?= Message-ID: In-Reply-To: @@ -378,3 +378,31 @@ def XIANGSHAN_NANHU : RISCVProcessorModel<"xiangshan-nanhu", TuneZExtHFusion, TuneZExtWFusion,

[clang] [llvm] [InstCombine] Swap out range metadata to range attribute for cttz/ctlz/ctpop (PR #88776)

2024-04-24 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/88776 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add processor definition for XiangShan-KunMingHu (PR #89359)

2024-04-22 Thread Yingwei Zheng via cfe-commits
@@ -378,3 +378,30 @@ def XIANGSHAN_NANHU : RISCVProcessorModel<"xiangshan-nanhu", TuneZExtHFusion, TuneZExtWFusion, TuneShiftedZExtWFusion]>;

[clang] [llvm] [mlir] Fix warning about mismatches between function parameter and call-site args names (PR #89294)

2024-04-19 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > Isn't the warning about a mismatch between declaration and definition, not > call args? The InstCombine change does make the definition and declaration > match. > […](#) > On Fri, Apr 19, 2024, at 17:07, Mehdi Amini wrote: ***@***. commented on > this pull request. In

[clang] [llvm] [mlir] Fix Definition Mismatches (PR #89294)

2024-04-19 Thread Yingwei Zheng via cfe-commits
@@ -433,7 +433,7 @@ class LLVM_LIBRARY_VISIBILITY InstCombinerImpl final Value *foldAndOrOfICmpsOfAndWithPow2(ICmpInst *LHS, ICmpInst *RHS, Instruction *CxtI, bool IsAnd, bool IsLogical = false); -

[clang] [llvm] [mlir] Fix Definition Mismatches (PR #89294)

2024-04-19 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw requested changes to this pull request. https://github.com/llvm/llvm-project/pull/89294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] Fix Definition Mismatches (PR #89294)

2024-04-19 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw edited https://github.com/llvm/llvm-project/pull/89294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] Add canonicalization of `sitofp` -> `uitofp nneg` (PR #88299)

2024-04-17 Thread Yingwei Zheng via cfe-commits
@@ -1964,11 +1964,25 @@ Instruction *InstCombinerImpl::visitFPToSI(FPToSIInst ) { } Instruction *InstCombinerImpl::visitUIToFP(CastInst ) { - return commonCastTransforms(CI); + if (Instruction *R = commonCastTransforms(CI)) +return R; + if (!CI.hasNonNeg() &&

[clang] [llvm] [ValueTracking] Convert `isKnownNonZero` to use SimplifyQuery (PR #85863)

2024-04-12 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/85863 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ValueTracking] Convert `isKnownNonZero` to use SimplifyQuery (PR #85863)

2024-04-12 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > Looks like the clang build is failing again? Done. https://github.com/llvm/llvm-project/pull/85863 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ValueTracking] Convert `isKnownNonZero` to use SimplifyQuery (PR #85863)

2024-04-12 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/85863 >From 9b725ffdb93b3029263129063d021063783f9cd9 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Thu, 21 Mar 2024 21:10:46 +0800 Subject: [PATCH 1/4] [ValueTracking] Add pre-commit tests. NFC. ---

[clang] [llvm] [InstCombine] Infer nsw/nuw for trunc (PR #87910)

2024-04-11 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/87910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] Add canonicalization of `sitofp` -> `uitofp nneg` (PR #88299)

2024-04-11 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/88299 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] Add canonicalization of `sitofp` -> `uitofp nneg` (PR #88299)

2024-04-11 Thread Yingwei Zheng via cfe-commits
@@ -1964,11 +1964,25 @@ Instruction *InstCombinerImpl::visitFPToSI(FPToSIInst ) { } Instruction *InstCombinerImpl::visitUIToFP(CastInst ) { - return commonCastTransforms(CI); + if (Instruction *R = commonCastTransforms(CI)) +return R; + if (!CI.hasNonNeg() &&

[clang] [libclc] [libcxx] [lld] [llvm] [openmp] llvm encode decode (PR #87187)

2024-04-11 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Please send this PR to your downstream fork https://github.com/x-codingman/llvm-project. https://github.com/llvm/llvm-project/pull/87187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [libclc] [libcxx] [lld] [llvm] [openmp] llvm encode decode (PR #87187)

2024-04-11 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/87187 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [InstCombine] Infer nsw/nuw for trunc (PR #87910)

2024-04-10 Thread Yingwei Zheng via cfe-commits
@@ -897,7 +897,20 @@ Instruction *InstCombinerImpl::visitTrunc(TruncInst ) { } } - return nullptr; + bool Changed = false; + if (!Trunc.hasNoSignedWrap() && + ComputeMaxSignificantBits(Src, /*Depth=*/0, ) <= DestWidth) { +Trunc.setHasNoSignedWrap(true); +

[clang] [llvm] [InstCombine] Infer nsw/nuw for trunc (PR #87910)

2024-04-09 Thread Yingwei Zheng via cfe-commits
@@ -897,7 +897,20 @@ Instruction *InstCombinerImpl::visitTrunc(TruncInst ) { } } - return nullptr; + bool Changed = false; + if (!Trunc.hasNoSignedWrap() && + ComputeMaxSignificantBits(Src, /*Depth=*/0, ) <= DestWidth) { +Trunc.setHasNoSignedWrap(true); +

[clang] [llvm] [InstCombine] Infer nsw/nuw for trunc (PR #87910)

2024-04-09 Thread Yingwei Zheng via cfe-commits
@@ -897,7 +897,20 @@ Instruction *InstCombinerImpl::visitTrunc(TruncInst ) { } } - return nullptr; + bool Changed = false; + if (!Trunc.hasNoSignedWrap() && + ComputeMaxSignificantBits(Src, /*Depth=*/0, ) <= DestWidth) { +Trunc.setHasNoSignedWrap(true); +

[clang] [llvm] [ValueTracking] Convert `isKnownNonZero` to use SimplifyQuery (PR #85863)

2024-03-21 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > Can you please fix the clang build? Done. https://github.com/llvm/llvm-project/pull/85863 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ValueTracking] Convert `isKnownNonZero` to use SimplifyQuery (PR #85863)

2024-03-21 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/85863 >From bacdc24af088560a986028824a0ac43e929c2f1b Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Thu, 21 Mar 2024 21:10:46 +0800 Subject: [PATCH 1/2] [ValueTracking] Add pre-commit tests. NFC. ---

[clang] [llvm] [InstCombine] Canonicalize `(sitofp x)` -> `(uitofp x)` if `x >= 0` (PR #82404)

2024-03-21 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > Apart from the correctness issues, we've seen some regressions on various > benchmarks from LLVM Test Suite after this patch. Specifically, around 3-5% > regression on x86-64 in various metrics of the >

[clang] [lld] [llvm] [IR] Change representation of getelementptr inrange (PR #84341)

2024-03-20 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > This is a very niche feature, and I don't think trying to upgrade it is > worthwhile. It exists in many real-world applications. If you are not willing to implement the upgrader, I will do this for the original IR files in my benchmark :)

[clang] [lld] [llvm] [IR] Change representation of getelementptr inrange (PR #84341)

2024-03-20 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > bin/opt: ../../llvm-opt-benchmark/bench/icu/original/servlkf.ll:776:98: > error: expected ')' in constantexpr store ptr getelementptr inbounds ({ [11 x ptr] }, ptr @_ZTVN6icu_7516LocaleKeyFactoryE, i32 0, inrange i32 0, i32 2), ptr %this1, align 8 @nikic Do we need an

[clang] [llvm] [RISCV] Add back SiFive's cdiscard.d.l1, cflush.d.l1, and cease instructions. (PR #83896)

2024-03-13 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. https://github.com/llvm/llvm-project/pull/83896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Eliminate trailing white space causing CI build failure (PR #84632)

2024-03-09 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/84632 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add back SiFive's cdiscard.d.l1 and cflush.d.l1 instructions. (PR #83896)

2024-03-04 Thread Yingwei Zheng via cfe-commits
@@ -60,6 +60,8 @@ // CHECK-NOT: __riscv_xsfvfwmaccqqq {{.*$}} // CHECK-NOT: __riscv_xsfqmaccdod {{.*$}} // CHECK-NOT: __riscv_xsfvqmaccqoq {{.*$}} +// CHECK-NOT: __riscv_sifivecdiscarddlone {{.*$}} +// CHECK-NOT: __riscv_sifivecflushdlone {{.*$}} dtcxzyw

[clang] [llvm] [RISCV] Add support of Sscofpmf (PR #83831)

2024-03-04 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. LGTM. Nice catch! Related patch: https://github.com/llvm/llvm-project/pull/79399 https://github.com/llvm/llvm-project/pull/83831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [RISCV] Support RISC-V Profiles in -march option (PR #76357)

2024-03-01 Thread Yingwei Zheng via cfe-commits
@@ -839,6 +860,33 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension, "string must be lowercase"); } + bool IsProfile = Arch.starts_with("rvi") || Arch.starts_with("rva") || +

[clang] [llvm] [RISCV] Remove experimental from Zacas. (PR #83195)

2024-02-28 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/83195 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Disable generation of asynchronous unwind tables for RISCV baremetal (PR #81727)

2024-02-14 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw edited https://github.com/llvm/llvm-project/pull/81727 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RISCV] Add assumptions to vsetvli/vsetvlimax (PR #79975)

2024-02-12 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Can we implement this in `computeKnownBitsFromOperator/getRangeForIntrinsic`? https://github.com/llvm/llvm-project/blob/b21e3282864c9f7ad656c64bc375f5869ef76d19/llvm/lib/Analysis/ValueTracking.cpp#L1578-L1584 https://github.com/llvm/llvm-project/pull/79975

[clang] [llvm] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

2024-02-07 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. LGTM. Thanks! https://github.com/llvm/llvm-project/pull/74056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

2024-02-07 Thread Yingwei Zheng via cfe-commits
@@ -1877,3 +1877,139 @@ Value *InstCombinerImpl::SimplifyDemandedVectorElts(Value *V, return MadeChange ? I : nullptr; } + +/// For floating-point classes that resolve to a single bit pattern, return that +/// value. +static Constant *getFPClassConstant(Type *Ty,

[clang] [llvm] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

2024-02-07 Thread Yingwei Zheng via cfe-commits
@@ -1877,3 +1877,139 @@ Value *InstCombinerImpl::SimplifyDemandedVectorElts(Value *V, return MadeChange ? I : nullptr; } + +/// For floating-point classes that resolve to a single bit pattern, return that +/// value. +static Constant *getFPClassConstant(Type *Ty,

[clang] [llvm] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

2024-02-07 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > > I don't know why it fails: > > ``` > > error: patch failed: > > llvm/lib/Transforms/InstCombine/InstCombineInternal.h:551 > > error: llvm/lib/Transforms/InstCombine/InstCombineInternal.h: patch does > > not apply > > error: patch failed: > >

[clang] [llvm] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

2024-02-07 Thread Yingwei Zheng via cfe-commits
@@ -1877,3 +1877,139 @@ Value *InstCombinerImpl::SimplifyDemandedVectorElts(Value *V, return MadeChange ? I : nullptr; } + +/// For floating-point classes that resolve to a single bit pattern, return that +/// value. +static Constant *getFPClassConstant(Type *Ty,

[clang] [llvm] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

2024-02-07 Thread Yingwei Zheng via cfe-commits
@@ -1877,3 +1877,139 @@ Value *InstCombinerImpl::SimplifyDemandedVectorElts(Value *V, return MadeChange ? I : nullptr; } + +/// For floating-point classes that resolve to a single bit pattern, return that +/// value. +static Constant *getFPClassConstant(Type *Ty,

[clang] [llvm] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

2024-02-07 Thread Yingwei Zheng via cfe-commits
@@ -1877,3 +1877,139 @@ Value *InstCombinerImpl::SimplifyDemandedVectorElts(Value *V, return MadeChange ? I : nullptr; } + +/// For floating-point classes that resolve to a single bit pattern, return that +/// value. +static Constant *getFPClassConstant(Type *Ty,

[clang] [llvm] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

2024-02-07 Thread Yingwei Zheng via cfe-commits
@@ -1877,3 +1877,139 @@ Value *InstCombinerImpl::SimplifyDemandedVectorElts(Value *V, return MadeChange ? I : nullptr; } + +/// For floating-point classes that resolve to a single bit pattern, return that +/// value. +static Constant *getFPClassConstant(Type *Ty,

[clang] [llvm] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

2024-02-07 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw requested changes to this pull request. https://github.com/llvm/llvm-project/pull/74056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

2024-02-07 Thread Yingwei Zheng via cfe-commits
@@ -1877,3 +1877,139 @@ Value *InstCombinerImpl::SimplifyDemandedVectorElts(Value *V, return MadeChange ? I : nullptr; } + +/// For floating-point classes that resolve to a single bit pattern, return that +/// value. +static Constant *getFPClassConstant(Type *Ty,

[clang] [llvm] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

2024-02-07 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw edited https://github.com/llvm/llvm-project/pull/74056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

2024-02-07 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > > @arsenm Can you rebase this patch first? > > It was already fresh, I just re-merged again with no conflicts I don't know why it fails: ``` error: patch failed: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:551 error:

[clang] [llvm] [clang-tools-extra] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

2024-02-06 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: @arsenm Can you rebase this patch first? https://github.com/llvm/llvm-project/pull/74056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] Revert "InstCombine: Fold is.fpclass(x, fcInf) to fabs+fcmp" (PR #76338)

2024-02-06 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > @dtcxzyw are you planning on a codegen patch to improve the backend handling? I will post a patch this week. https://github.com/llvm/llvm-project/pull/76338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[llvm] [clang] [RISCV] Add Ssqosid support to -march. (PR #80747)

2024-02-05 Thread Yingwei Zheng via cfe-commits
@@ -1612,6 +1613,14 @@ // RUN: -o - | FileCheck --check-prefix=CHECK-SUPM-EXT %s // CHECK-SUPM-EXT: __riscv_supm 8000{{$}} +// RUN: %clang --target=riscv32 -menable-experimental-extensions \ +// RUN: -march=rv32i_ssqosid1p0 -E -dM %s \ +// RUN: -o - | FileCheck

[clang] [Clang][CodeGen] Mark `__dynamic_cast` as `willreturn` (PR #80409)

2024-02-03 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/80409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Mark `__dynamic_cast` as `willreturn` (PR #80409)

2024-02-02 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/80409 According to the C++ standard, `dynamic_cast` of pointers either returns a pointer (7.6.1.7) or results in undefined behavior (11.9.5). This patch marks `__dynamic_cast` as `willreturn` to remove unused calls.

[clang] [llvm] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-18 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > I guess Zaamo + Zacas is technically a way one could implement atomics > without LR/SC? The Zacas extension depends upon the A extension. https://github.com/llvm/llvm-project/pull/77424 ___ cfe-commits mailing list

[llvm] [flang] [clang] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2024-01-18 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Ping? https://github.com/llvm/llvm-project/pull/68882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][clang] Optimize memory usage of intrinsic lookup table (PR #77487)

2024-01-09 Thread Yingwei Zheng via cfe-commits
@@ -463,7 +464,7 @@ void RISCVIntrinsicManagerImpl::CreateRVVIntrinsicDecl(LookupResult , bool RISCVIntrinsicManagerImpl::CreateIntrinsicIfFound(LookupResult , IdentifierInfo *II,

[clang] [llvm] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-09 Thread Yingwei Zheng via cfe-commits
@@ -0,0 +1,11 @@ +# RUN: not llvm-mc -triple riscv32 -mattr=+experimental-zaamo < %s 2>&1 | FileCheck %s dtcxzyw wrote: Can we split `rv32a-invalid.s` into two files? I think it is better than duplicating tests for new extensions.

[clang] [llvm] Revert "InstCombine: Fold is.fpclass(x, fcInf) to fabs+fcmp" (PR #76338)

2024-01-07 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/76338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] static operators should evaluate object argument (PR #68485)

2024-01-04 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Ping. https://github.com/llvm/llvm-project/pull/68485 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[lld] [clang] [llvm] [FuncAttrs] Deduce `noundef` attributes for return values (PR #76553)

2024-01-01 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > Can you please fix or revert > https://lab.llvm.org/buildbot/#/builders/74/builds/24592 ? Should be fixed by https://github.com/llvm/llvm-project/commit/7e405eb722e40c79b7726201d0f76b5dab34ba0f. https://lab.llvm.org/buildbot/#/builders/74/builds/24613

[lld] [llvm] [clang] [FuncAttrs] Deduce `noundef` attributes for return values (PR #76553)

2024-01-01 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > > Yeah, we should skip this inference for functions with the sanitize_memory > > attribute. > > I will post a patch later. Candidate patch: https://github.com/llvm/llvm-project/pull/76691 https://github.com/llvm/llvm-project/pull/76553

[llvm] [lld] [clang] [FuncAttrs] Deduce `noundef` attributes for return values (PR #76553)

2024-01-01 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > Yeah, we should skip this inference for functions with the sanitize_memory > attribute. I will post a patch later. https://github.com/llvm/llvm-project/pull/76553 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[llvm] [clang] [lld] [FuncAttrs] Deduce `noundef` attributes for return values (PR #76553)

2024-01-01 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > Can you please fix or revert > https://lab.llvm.org/buildbot/#/builders/74/builds/24592 ? Thank you for reporting this! I will check the error log. https://github.com/llvm/llvm-project/pull/76553 ___ cfe-commits mailing list

[llvm] [clang] [lld] [FuncAttrs] Deduce `noundef` attributes for return values (PR #76553)

2023-12-31 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/76553 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [lld] [FuncAttrs] Deduce `noundef` attributes for return values (PR #76553)

2023-12-31 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw edited https://github.com/llvm/llvm-project/pull/76553 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] [FuncAttrs] Deduce `noundef` attributes for return values (PR #76553)

2023-12-31 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/76553 >From 30dcc33c4ea3ab50397a7adbe85fe977d4a400bd Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Fri, 29 Dec 2023 14:27:22 +0800 Subject: [PATCH 1/2] [FuncAttrs] Add pre-commit tests. NFC. ---

[lld] [clang] [llvm] [FuncAttrs] Deduce `noundef` attributes for return values (PR #76553)

2023-12-31 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > Failed Tests (3): LLVM :: CodeGen/BPF/loop-exit-cond.ll LLVM :: CodeGen/NVPTX/nvvm-reflect-opaque.ll LLVM :: CodeGen/NVPTX/nvvm-reflect.ll https://github.com/llvm/llvm-project/pull/76553 ___ cfe-commits mailing list

[llvm] [clang] [lld] [FuncAttrs] Deduce `noundef` attributes for return values (PR #76553)

2023-12-31 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > There are lld test failures. Done. https://github.com/llvm/llvm-project/pull/76553 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [lld] [FuncAttrs] Deduce `noundef` attributes for return values (PR #76553)

2023-12-31 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/76553 >From 30dcc33c4ea3ab50397a7adbe85fe977d4a400bd Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Fri, 29 Dec 2023 14:27:22 +0800 Subject: [PATCH 1/2] [FuncAttrs] Add pre-commit tests. NFC. ---

[llvm] [clang] [lld] [FuncAttrs] Deduce `noundef` attributes for return values (PR #76553)

2023-12-31 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/76553 >From 30dcc33c4ea3ab50397a7adbe85fe977d4a400bd Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Fri, 29 Dec 2023 14:27:22 +0800 Subject: [PATCH 1/2] [FuncAttrs] Add pre-commit tests. NFC. ---

[clang] [llvm] [RFC][RISCV] Support RISC-V Profiles in -march option (PR #76357)

2023-12-28 Thread Yingwei Zheng via cfe-commits
@@ -0,0 +1,112 @@ +// RUN: %clang -### -c %s 2>&1 -march=rvi20u32 | FileCheck -check-prefix=RVI20U32 %s +// RVI20U32: "-target-cpu" "generic-rv32" +// RVI20U32: "-target-feature" "-a" +// RVI20U32: "-target-feature" "-c" +// RVI20U32: "-target-feature" "-d" +// RVI20U32:

[llvm] [clang] [RFC][RISCV] Support RISC-V Profiles in -march option (PR #76357)

2023-12-28 Thread Yingwei Zheng via cfe-commits
@@ -206,6 +210,17 @@ static const RISCVSupportedExtension SupportedExperimentalExtensions[] = { {"zvfbfwma", RISCVExtensionVersion{0, 8}}, }; +static const RISCVProfile SupportedProfiles[] = { +{"rvi20u32", "rv32i"}, dtcxzyw wrote: Profile names

[clang] [llvm] [FuncAttrs] Deduce `noundef` attributes for return values (PR #76553)

2023-12-28 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/76553 This patch deduces `noundef` attributes for return values. IIUC, a function returns `noundef` values iff all of its return values are guaranteed not to be `undef` or `poison`. Definition of `noundef` from

[clang] [llvm] [FuncAttrs] Infer `norecurse` for funcs with calls to `nocallback` callees (PR #76372)

2023-12-26 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/76372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [FuncAttrs] Infer `norecurse` for funcs with calls to `nocallback` callees (PR #76372)

2023-12-26 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > There is a failing clang test. Fixed. https://github.com/llvm/llvm-project/pull/76372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [FuncAttrs] Infer `norecurse` for funcs with calls to `nocallback` callees (PR #76372)

2023-12-26 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/76372 >From 5ceb22715cdcfc52b77b451110295ea083c09327 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 26 Dec 2023 05:10:06 +0800 Subject: [PATCH] [FuncAttrs] Infer `norecurse` for funcs with calls to

[llvm] [clang] Revert "InstCombine: Fold is.fpclass(x, fcInf) to fabs+fcmp" (PR #76338)

2023-12-24 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/76338 >From a646e872e72bab7b143db7496adfeb633b882dc4 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Mon, 25 Dec 2023 01:39:27 +0800 Subject: [PATCH] Revert "InstCombine: Fold is.fpclass(x, fcInf) to fabs+fcmp"

[clang] [Clang][RISCV] Add missing support for `__riscv_clmulr_32/64` in `riscv_bitmanip.h` (PR #76289)

2023-12-24 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/76289 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RISCV] Use `__builtin_popcount` in `__riscv_cpop_32/64` (PR #76286)

2023-12-24 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/76286 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RISCV] Add missing support for `__builtin_riscv_cpop_32/64` (PR #76256)

2023-12-24 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/76256 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RISCV] Add missing support for `__riscv_clmulr_32/64` in `riscv_bitmanip.h` (PR #76289)

2023-12-23 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/76289 This patch adds support for `__riscv_clmulr_32/64` in `riscv_bitmanip.h`. It also fixes the extension requirements of `clmul/clmulh`. Thank @Liaoshihua for reporting this! >From

[clang] [Clang][RISCV] Use `__builtin_popcount` in `__riscv_cpop_32/64` (PR #76286)

2023-12-23 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/76286 This patch replaces `__builtin_riscv_cpop_32/64` with `__builtin_popcount(ll)` because `__builtin_riscv_cpop_32/64` is not implemented in clang. Thank @Liaoshihua for reporting this! It is an alternative to

[clang] [Clang][RISCV] Add missing support for `__builtin_riscv_cpop_32/64` (PR #76256)

2023-12-22 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/76256 This patch adds support for `__builtin_riscv_cpop_32/64`, which are used by `riscv_bitmanip.h`. See also

[llvm] [flang] [clang] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2023-12-21 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > arrayidx We should teach `foldCmpLoadFromIndexedGlobal` to handle constant GEPs with i8 source element type. https://github.com/llvm/llvm-project/pull/68882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[llvm] [flang] [clang] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2023-12-21 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > @nikic Could you please have a look at > [dtcxzyw/llvm-opt-benchmark#17](https://github.com/dtcxzyw/llvm-opt-benchmark/pull/17)? > One regression: > > ``` > diff --git a/bench/brotli/optimized/compound_dictionary.c.ll > b/bench/brotli/optimized/compound_dictionary.c.ll >

[flang] [llvm] [clang] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2023-12-21 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: An unique regression: ``` diff --git a/bench/openssl/optimized/hexstr_test-bin-hexstr_test.ll b/bench/openssl/optimized/hexstr_test-bin-hexstr_test.ll index 534c0a07..85a097fc 100644 --- a/bench/openssl/optimized/hexstr_test-bin-hexstr_test.ll +++

[flang] [llvm] [clang] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2023-12-21 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > @dtcxzyw GitHub can't display the diff, and struggles to clone the repo. Can > you share the diffs for just the mentioned files? I have posted the diff between optimized IRs. https://github.com/llvm/llvm-project/pull/68882 ___

[clang] [flang] [llvm] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2023-12-21 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Another example: ``` diff --git a/bench/hermes/optimized/Sorting.cpp.ll b/bench/hermes/optimized/Sorting.cpp.ll index 1a808c47..e03089ca 100644 --- a/bench/hermes/optimized/Sorting.cpp.ll +++ b/bench/hermes/optimized/Sorting.cpp.ll @@ -41,20 +41,22 @@ if.end:

[flang] [llvm] [clang] [InstCombine] Canonicalize constant GEPs to i8 source element type (PR #68882)

2023-12-21 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: @nikic Could you please have a look at https://github.com/dtcxzyw/llvm-opt-benchmark/pull/17? One regression: ``` diff --git a/bench/brotli/optimized/compound_dictionary.c.ll b/bench/brotli/optimized/compound_dictionary.c.ll index 21fd37fd..b9894810 100644 ---

[clang] [clang] static operators should evaluate object argument (PR #68485)

2023-12-14 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Ping. https://github.com/llvm/llvm-project/pull/68485 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add support for experimental Zimop extension (PR #74824)

2023-12-08 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: I guess you should split it into patch series. + [ ] MC support (and docs) + [ ] Sched support + [ ] ISel support + [ ] Builtin intrinsic support in clang https://github.com/llvm/llvm-project/pull/74824 ___ cfe-commits mailing list

[clang] [llvm] [ValueTracking] Add dominating condition support in computeKnownBits() (PR #73662)

2023-12-06 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. The regression in `Shootout-C++-ary2` may be caused by ThinLTO. But I think it is OK to go ahead and merge :) https://github.com/llvm/llvm-project/pull/73662 ___ cfe-commits mailing list

[clang] [llvm] [ValueTracking] Add dominating condition support in computeKnownBits() (PR #73662)

2023-12-04 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Looks like the regression in `DILATE` has been addressed. Could you please have a look at `MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec/mpeg2decode`? https://github.com/llvm/llvm-project/pull/73662 ___ cfe-commits mailing list

[clang] [llvm] [ValueTracking] Add dominating condition support in computeKnownBits() (PR #73662)

2023-12-03 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Could you please rebase this patch on https://github.com/llvm/llvm-project/pull/74246 and add a test for https://github.com/llvm/llvm-project/issues/74242? https://github.com/llvm/llvm-project/pull/73662 ___ cfe-commits mailing list

  1   2   3   4   >