[clang] [compiler-rt] [UBSan] Diagnose assumption violation (PR #104741)

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

[clang] [compiler-rt] [UBSan] Diagnose assumption violation (PR #104741)

2024-09-24 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/104741 >From fdadb0fdc2288b18d4dfe4f4510d057a7552ee39 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Mon, 19 Aug 2024 15:22:39 +0800 Subject: [PATCH 1/4] [UBSan] Diagnose assumption violation --- clang/lib/CodeGe

[clang] [compiler-rt] [UBSan] Diagnose assumption violation (PR #104741)

2024-09-24 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/104741 >From fdadb0fdc2288b18d4dfe4f4510d057a7552ee39 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Mon, 19 Aug 2024 15:22:39 +0800 Subject: [PATCH 1/3] [UBSan] Diagnose assumption violation --- clang/lib/CodeGe

[clang] [compiler-rt] [Clang][compiler-rt][UBSan] Improve `__ubsan_handle_invalid_builtin` (PR #109088)

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

[clang] [lldb] [llvm] [mlir] [APInt] Fix APInt constructions where value does not fit bitwidth (NFCI) (PR #80309)

2024-09-22 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: https://github.com/llvm/llvm-project/blob/62f737f7409b5d2b33c746158c62f14e5bb78aed/llvm/lib/Transforms/Utils/SimplifyCFG.cpp#L6516 We should allow truncations here. ``` ; bin/opt -passes='simplifycfg' reduced.ll -S target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:6

[clang] [RISCV] Implement validateGlobalRegisterVariable. (PR #109596)

2024-09-22 Thread Yingwei Zheng via cfe-commits
@@ -486,3 +486,15 @@ bool RISCVTargetInfo::validateCpuSupports(StringRef Feature) const { bool RISCVTargetInfo::isValidFeatureName(StringRef Name) const { return llvm::RISCVISAInfo::isSupportedExtensionFeature(Name); } + +bool RISCVTargetInfo::validateGlobalRegisterVariable(

[clang] [RISCV] Implement validateGlobalRegisterVariable. (PR #109596)

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

[clang] [RISCV] Implement validateGlobalRegisterVariable. (PR #109596)

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

[clang] [llvm] [Loads] Check context instruction for context-sensitive derefability (PR #109277)

2024-09-20 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. Nice catch! https://github.com/llvm/llvm-project/pull/109277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CVP] Infer range return attribute (PR #99620)

2024-09-20 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. LGTM. Thank you! https://github.com/llvm/llvm-project/pull/99620 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [CVP] Infer range return attribute (PR #99620)

2024-09-19 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Missing fold: https://alive2.llvm.org/ce/z/2rmc3h See https://github.com/dtcxzyw/llvm-opt-benchmark/pull/1342#discussion_r1767033125 https://github.com/llvm/llvm-project/pull/99620 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

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

2024-09-18 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw requested changes to this pull request. Reproducer: ``` ; bin/opt -passes=inline reduced.ll -S target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" define i64 @caller(ptr %p1,

[clang] [compiler-rt] [Clang][compiler-rt][UBSan] Remove `BuiltinCheckKind` (PR #109088)

2024-09-17 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/109088 This patch removes unneeded enum `BuiltinCheckKind` and fixes a copy-paste mistake in `__ubsan_handle_invalid_builtin`. Address comment https://github.com/llvm/llvm-project/pull/104741#discussion_r1764323722.

[clang] [llvm] [RISCV] Add Syntacore SCR7 processor definition (PR #108406)

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

[clang] [llvm] [RISCV] Add Syntacore SCR7 processor definition (PR #108406)

2024-09-12 Thread Yingwei Zheng via cfe-commits
@@ -502,3 +502,28 @@ // RUN: %clang --target=riscv64 -### -c %s 2>&1 -mtune=syntacore-scr5-rv64 | FileCheck -check-prefix=MTUNE-SYNTACORE-SCR5-RV64 %s // MTUNE-SYNTACORE-SCR5-RV64: "-tune-cpu" "syntacore-scr5-rv64" + +// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=synt

[clang] [FMV][Clang][CodeGen] Resolves corresponding callee for multi-versioning callers (PR #107822)

2024-09-09 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/107822 Closes #94949. >From 110eea45aaaca6508f41032641a083df1c43092f Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Mon, 9 Sep 2024 15:53:05 +0800 Subject: [PATCH 1/2] [FMV][Clang][CodeGen] Add pre-commit tests.

[clang] [compiler-rt] [UBSan] Diagnose assumption violation (PR #104741)

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

[clang] [Clang][CodeGen] Don't emit assumptions if current block is unreachable. (PR #106936)

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

[clang] [Clang][CodeGen] Don't emit assumptions if current block is unreachable. (PR #106936)

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

[clang] [Clang][CodeGen] Don't emit assumptions if current block is unreachable. (PR #106936)

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

[clang] [Clang][CodeGen] Fix type for atomic float incdec operators (PR #107075)

2024-09-03 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: /cherry-pick 9fef09fd2918e7d8c357b98a9a798fe207941f73 https://github.com/llvm/llvm-project/pull/107075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Fix type for atomic float incdec operators (PR #107075)

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

[clang] [Clang][CodeGen] Fix type for atomic float incdec operators (PR #107075)

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

[clang] [llvm] [ValueLattice][SCCP] Do not track undefs (PR #107105)

2024-09-03 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw commented: Crash reproducer: ``` ; bin/opt -passes=sccp reduced.ll -S define void @debug_send_line1() { %1 = load ptr, ptr null, align 8 %2 = load ptr, ptr %1, align 8 call void %2() ret void } define void @debug_send_line2() { %1 = load ptr, ptr undef, alig

[clang] [Clang][CodeGen] Fix type for atomic float incdec operators (PR #107075)

2024-09-03 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: cc @Krishna-13-cyber https://github.com/llvm/llvm-project/pull/107075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Fix type for atomic float incdec operators (PR #107075)

2024-09-03 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/107075 `llvm::ConstantFP::get(llvm::LLVMContext&, APFloat(float))` always returns a f32 constant. Fix https://github.com/llvm/llvm-project/issues/107054. >From eb403d3195cda22ca53411b2a12f259ad557f820 Mon Sep 17 00:0

[clang] [Clang][CodeGen] Don't emit assumptions if current block is unreachable. (PR #106936)

2024-09-01 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/106936 Fixes https://github.com/llvm/llvm-project/issues/106898. When emitting an infinite loop, clang codegen will delete the whole block and leave builder's current block as nullptr: https://github.com/llvm/llvm-pro

[clang] [llvm] [SCCP] Infer return attributes in SCCP as well (PR #106732)

2024-08-30 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > This causes some compile-time regression on lencod with LTO > (https://llvm-compile-time-tracker.com/compare.php?from=eaf87d32754beb5bec10bab517bf56e25575b48e&to=b03af0f9bc4e83de8ed78b55b1e0fc0abb9af24e&stat=instructions%3Au). > I've seen a similar regression when testing a sim

[clang] [llvm] [SCCP] Infer return attributes in SCCP as well (PR #106732)

2024-08-30 Thread Yingwei Zheng via cfe-commits
@@ -277,34 +277,12 @@ static bool runIPSCCP( // whether other functions are optimizable. SmallVector ReturnsToZap; + Solver.inferReturnAttributes(); for (const auto &I : Solver.getTrackedRetVals()) { Function *F = I.first; const ValueLatticeElement &ReturnVal

[clang] [llvm] [SCCP] Infer return attributes in SCCP as well (PR #106732)

2024-08-30 Thread Yingwei Zheng via cfe-commits
@@ -354,6 +354,36 @@ bool SCCPSolver::removeNonFeasibleEdges(BasicBlock *BB, DomTreeUpdater &DTU, return true; } +void SCCPSolver::inferReturnAttributes() const { + for (const auto &I : getTrackedRetVals()) { +Function *F = I.first; +const ValueLatticeElement &Retu

[clang] [llvm] [SCCP] Infer return attributes in SCCP as well (PR #106732)

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

[clang] [llvm] [SCCP] Infer return attributes in SCCP as well (PR #106732)

2024-08-30 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. LG. After this patch, some redundant null checks/error handlings are eliminated :) https://github.com/llvm/llvm-project/pull/106732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

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

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

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

[clang] [clang][RISCV] Fix typo of vector crypto in SemaRISCV.cpp. NFC (PR #106485)

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

[clang] [compiler-rt] [UBSan] Diagnose assumption violation (PR #104741)

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

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-27 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Please update these failed tests: > Failed Tests (2): LLVM :: CodeGen/AMDGPU/anyext.ll LLVM :: CodeGen/AMDGPU/fneg-modifier-casting.ll https://github.com/llvm/llvm-project/pull/97762 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-27 Thread Yingwei Zheng via cfe-commits
@@ -5921,6 +5921,63 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts, break; } + case Instruction::BitCast: { +const Value *Src; +if (!match(Op, m_ElementWiseBitCast(m_Value(Src))) || +!Src->getType()->isIntOrIntVectorTy()) + b

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

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

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-27 Thread Yingwei Zheng via cfe-commits
@@ -5921,6 +5921,63 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts, break; } + case Instruction::BitCast: { +const Value *Src; +if (!match(Op, m_ElementWiseBitCast(m_Value(Src))) || +!Src->getType()->isIntOrIntVectorTy()) + b

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

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

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-22 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Reverse ping :) https://github.com/llvm/llvm-project/pull/97762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Remove experimental for Ssqosid ext (PR #105476)

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

[clang] [llvm] [RISCV] Add CSRs and an instruction for Smctr and Ssctr extensions. (PR #105148)

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

[clang] [llvm] [RISCV] Add CSRs and an instruction for Smctr and Ssctr extensions. (PR #105148)

2024-08-20 Thread Yingwei Zheng via cfe-commits
@@ -1054,6 +1054,19 @@ def FeatureStdExtSupm : RISCVExperimentalExtension<"supm", 1, 0, "'Supm' (Indicates User-mode Pointer Masking)">; +def FeatureStdExtSmctr +: RISCVExperimentalExtension<"smctr", 1, 0, +

[clang] [llvm] [RISCV] Add CSRs and an instruction for Smctr and Ssctr extensions. (PR #105148)

2024-08-20 Thread Yingwei Zheng via cfe-commits
@@ -839,6 +839,14 @@ def HLV_D : HLoad_r<0b0110110, 0b0, "hlv.d">, Sched<[]>; def HSV_D : HStore_rr<0b0110111, "hsv.d">, Sched<[]>; } +let Predicates = [HasStdExtSmctrOrSsctr] in { +def SCTRCLR : Priv<"sctrclr", 0b0001000>, Sched<[]> { dtcxzyw wrote:

[clang] [llvm] [RISCV] Add CSRs and an instruction for Smctr and Ssctr extensions. (PR #105148)

2024-08-20 Thread Yingwei Zheng via cfe-commits
@@ -1054,6 +1054,19 @@ def FeatureStdExtSupm : RISCVExperimentalExtension<"supm", 1, 0, "'Supm' (Indicates User-mode Pointer Masking)">; +def FeatureStdExtSmctr +: RISCVExperimentalExtension<"smctr", 1, 0, +

[clang] [compiler-rt] [UBSan] Diagnose assumption violation (PR #104741)

2024-08-19 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/104741 This patch extends [D34590](https://reviews.llvm.org/D34590) to check assumption violations. >From e2ce302a0d3649594ff1a6b94420f815d0e1acde Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Mon, 19 Aug 2024

[clang] [llvm] [RISCV][MC] Support experimental extensions Zvbc32e and Zvkgs (PR #103709)

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

[clang] [llvm] [RISCV][MC] Support experimental extensions Zvbc32e and Zvkgs (PR #103709)

2024-08-14 Thread Yingwei Zheng via cfe-commits
@@ -150,6 +150,14 @@ let Predicates = [HasStdExtZvkg], RVVConstraint = NoConstraint in { SchedBinaryMC<"WriteVGMULV", "ReadVGMULV", "ReadVGMULV">; } // Predicates = [HasStdExtZvkg] +let Predicates = [HasStdExtZvkgs], RVVConstraint = NoConstraint in {

[clang] [llvm] [RISCV][MC] Support experimental extensions Zvbc32e and Zvkgs (PR #103709)

2024-08-14 Thread Yingwei Zheng via cfe-commits
@@ -302,6 +302,9 @@ The primary goal of experimental support is to assist in the process of ratifica ``experimental-zicfilp``, ``experimental-zicfiss`` LLVM implements the `1.0 release specification `__. +``experimental

[clang] [llvm] [RISCV] Add NutShell RV32/64 processors definition (PR #102899)

2024-08-12 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw requested changes to this pull request. After consulting with NutShell's maintainer @poemonsense, I think this PR should be rejected for the following reasons: 1. There are no commercial plans for this educational processor. 2. This project is no longer maintained. h

[clang] [llvm] [RISCV] Add Hazard3 CPU (PR #102452)

2024-08-08 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: It looks like a toy project :( The RTL design is not frozen. https://github.com/llvm/llvm-project/pull/102452 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add Syntacore SCR5 RV32/64 processors definition (PR #102285)

2024-08-07 Thread Yingwei Zheng via cfe-commits
@@ -378,6 +378,32 @@ def SYNTACORE_SCR4_RV64 : RISCVProcessorModel<"syntacore-scr4-rv64", FeatureStdExtC], [TuneNoDefaultUnroll, FeaturePostRAScheduler]>; +def SYNTACORE_SCR5_RV32 :

[clang] [llvm] [RISCV] Add sifive-p470 processor (PR #102022)

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

[clang] [llvm] [RISCV] Add sifive-p470 processor (PR #102022)

2024-08-06 Thread Yingwei Zheng via cfe-commits
@@ -266,11 +272,47 @@ def SIFIVE_P450 : RISCVProcessorModel<"sifive-p450", SiFiveP400Model, FeatureStdExtZfhmin, FeatureUnalignedScalarMem, FeatureUnalignedVect

[clang] [Clang][CodeGen] Add metadata for load from reference (PR #98746)

2024-07-23 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Compile-time impact: http://llvm-compile-time-tracker.com/compare.php?from=f0fad9f3e00dbe8e58024d1c98e36b7b9b1b17a9&to=f01369d38b67364b5c35bf87984f813a53ce18d1&stat=instructions%3Au https://github.com/llvm/llvm-project/pull/98746 ___ cf

[clang] [Clang][CodeGen] Add metadata for load from reference (PR #98746)

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

[clang] [llvm] [RISCV] Mark zacas as experimental again due to unresolved ABI issue (PR #99898)

2024-07-22 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Please update this line :) https://github.com/llvm/llvm-project/blob/90569e02e63ff5d0915446919f564e9b3638fe2a/llvm/lib/TargetParser/Host.cpp#L2070 https://github.com/llvm/llvm-project/pull/99898 ___ cfe-commits mailing list cfe-commits@l

[clang] [Clang][CodeGen] Add metadata for load from reference (PR #98746)

2024-07-22 Thread Yingwei Zheng via cfe-commits
@@ -2799,9 +2799,37 @@ CodeGenFunction::EmitLoadOfReference(LValue RefLVal, llvm::LoadInst *Load = Builder.CreateLoad(RefLVal.getAddress(), RefLVal.isVolatile()); CGM.DecorateInstructionWithTBAA(Load, RefLVal.getTBAAInfo()); - return makeNaturalAddressForPointer(Load

[clang] [Clang][CodeGen] Add metadata for load from reference (PR #98746)

2024-07-20 Thread Yingwei Zheng via cfe-commits
@@ -1,8 +1,8 @@ // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s -O2 | FileCheck %s -// Make sure the call to b() doesn't get optimized out. +// Make sure the call to b() is eliminated. extern struct x {char& x,y;}y; int b(); int a() { if (!&y.x) b();

[clang] [Clang][CodeGen] Add metadata for load from reference (PR #98746)

2024-07-20 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw ready_for_review https://github.com/llvm/llvm-project/pull/98746 ___ 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-07-16 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: I don't see any performance benefits based on IR diff or instruction count. Changes on code size are mainly affected by JumpThreading/Inlining. But I don't object to propagating more attributes if the compile-time impact is negligible :) https://github.com/llvm/llvm-project/p

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-07-15 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/94352 ___ 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 getHostCPUFeatures using hwprobe (PR #94352)

2024-07-14 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/94352 >From ff839bef048a65760f4cd0e9abafe11cfebd9362 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 4 Jun 2024 21:08:27 +0800 Subject: [PATCH 01/20] [RISCV] Add support for getHostCPUFeatures using hwprobe C

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-07-14 Thread Yingwei Zheng via cfe-commits
@@ -290,8 +290,24 @@ std::string riscv::getRISCVArch(const llvm::opt::ArgList &Args, // 2. Get march (isa string) based on `-mcpu=` if (const Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { StringRef CPU = A->getValue(); -if (CPU == "native") +if (CPU == "nat

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-07-13 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Ping @wangpc-pp @topperc @preames https://github.com/llvm/llvm-project/pull/94352 ___ 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 getHostCPUFeatures using hwprobe (PR #94352)

2024-07-13 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/94352 >From ff839bef048a65760f4cd0e9abafe11cfebd9362 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 4 Jun 2024 21:08:27 +0800 Subject: [PATCH 01/19] [RISCV] Add support for getHostCPUFeatures using hwprobe C

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-07-13 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: ``` dtcxzyw@bananapif3:/data/llvm-build$ bin/clang -mcpu=native --print-enabled-extensions clang version 19.0.0git Target: riscv64-unknown-linux-gnu Thread model: posix InstalledDir: /data/llvm-build/bin Build config: +assertions Extensions enabled for the given RISC-V target

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-07-13 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/94352 >From ff839bef048a65760f4cd0e9abafe11cfebd9362 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 4 Jun 2024 21:08:27 +0800 Subject: [PATCH 01/18] [RISCV] Add support for getHostCPUFeatures using hwprobe C

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-07-13 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: I will rebase on the top of https://github.com/llvm/llvm-project/pull/97824. https://github.com/llvm/llvm-project/pull/94352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [llvm] [RISCV] Add ability to list extensions enabled for a target (PR #98207)

2024-07-10 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. LGTM. Thank you! https://github.com/llvm/llvm-project/pull/98207 ___ 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 getHostCPUFeatures using hwprobe (PR #94352)

2024-07-10 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/94352 >From ff839bef048a65760f4cd0e9abafe11cfebd9362 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 4 Jun 2024 21:08:27 +0800 Subject: [PATCH 01/17] [RISCV] Add support for getHostCPUFeatures using hwprobe C

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-07-10 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/94352 >From ff839bef048a65760f4cd0e9abafe11cfebd9362 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 4 Jun 2024 21:08:27 +0800 Subject: [PATCH 01/16] [RISCV] Add support for getHostCPUFeatures using hwprobe C

[clang] [llvm] [RISCV] Add ability to list extensions enabled for a target (PR #98207)

2024-07-09 Thread Yingwei Zheng via cfe-commits
@@ -116,6 +115,44 @@ void llvm::riscvExtensionsHelp(StringMap DescMap) { "For example, clang -march=rv32i_v1p0\n"; } +void RISCVISAInfo::printEnabledExtensions( +bool IsRV64, std::set &EnabledFeatureNames, +StringMap &DescMap) { + outs() << "Extensions en

[clang] [RISCV][Driver] Refactor `riscv::getRISCVArch` to return `std::string`. NFC. (PR #97965)

2024-07-07 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/97965 See the discussion in https://github.com/llvm/llvm-project/pull/94352#discussion_r1657074801 >From 21a8c00e8276f0ea4fa5c52296b257b8d113b947 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Mon, 8 Jul 2024 02:

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-07-07 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/94352 >From ff839bef048a65760f4cd0e9abafe11cfebd9362 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 4 Jun 2024 21:08:27 +0800 Subject: [PATCH 01/14] [RISCV] Add support for getHostCPUFeatures using hwprobe C

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-07-07 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > This patch is motivated by an internal benchmark where there were some cases > where this helped, though even that case is in some sense artificial. It is ok to optimize some pattern in proxy apps/benchmarks :) > Is this a necessary criteria for landing this change? As recurs

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-07-05 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Can you add some tests to demonstrate that this patch will enable more optimizations in some real-world applications? https://github.com/llvm/llvm-project/pull/97762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-07-05 Thread Yingwei Zheng via cfe-commits
@@ -1549,30 +1549,10 @@ define amdgpu_kernel void @multiple_uses_fneg_select_f64(double %x, double %y, i define amdgpu_kernel void @fnge_select_f32_multi_use_regression(float %.i2369) { ; GCN-LABEL: fnge_select_f32_multi_use_regression: ; GCN: ; %bb.0: ; %.entry -; GCN-

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-30 Thread Yingwei Zheng via cfe-commits
@@ -290,8 +290,24 @@ StringRef riscv::getRISCVArch(const llvm::opt::ArgList &Args, // 2. Get march (isa string) based on `-mcpu=` if (const Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { StringRef CPU = A->getValue(); -if (CPU == "native") +if (CPU == "nativ

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-27 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/94352 >From ff839bef048a65760f4cd0e9abafe11cfebd9362 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 4 Jun 2024 21:08:27 +0800 Subject: [PATCH 01/13] [RISCV] Add support for getHostCPUFeatures using hwprobe C

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-27 Thread Yingwei Zheng via cfe-commits
@@ -290,8 +290,24 @@ StringRef riscv::getRISCVArch(const llvm::opt::ArgList &Args, // 2. Get march (isa string) based on `-mcpu=` if (const Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { StringRef CPU = A->getValue(); -if (CPU == "native") +if (CPU == "nativ

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-27 Thread Yingwei Zheng via cfe-commits
@@ -83,8 +83,14 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple, // and other features (ex. mirco architecture feature) from mcpu if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { StringRef CPU = A->getValue(); -if (CPU == "nat

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-27 Thread Yingwei Zheng via cfe-commits
@@ -83,8 +83,14 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple, // and other features (ex. mirco architecture feature) from mcpu if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { StringRef CPU = A->getValue(); -if (CPU == "nat

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-27 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/94352 >From ff839bef048a65760f4cd0e9abafe11cfebd9362 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 4 Jun 2024 21:08:27 +0800 Subject: [PATCH 01/12] [RISCV] Add support for getHostCPUFeatures using hwprobe C

[clang] [llvm] [Pipelines] Move IPSCCP after inliner pipeline (PR #96620)

2024-06-27 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > Does that mean it has a negative net effect, or its neutral It is neutral. > (in which case the original motivating case should be enough). But this patch may have an impact on compile time. https://github.com/llvm/llvm-project/pull/96620 ___

[clang] [llvm] [Pipelines] Move IPSCCP after inliner pipeline (PR #96620)

2024-06-27 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > This patch causes some significant performance regressions on llvm-test-suite > (rv64gc-O3-thinlto): > > Name Before After Ratio > SingleSource/Benchmarks/Shootout/Shootout-random 2.150161677 > 3.300161641 + 53.5% > SingleSource/Benchmarks/Polybench/linear-alg

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-27 Thread Yingwei Zheng via cfe-commits
@@ -83,8 +83,14 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple, // and other features (ex. mirco architecture feature) from mcpu if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ)) { StringRef CPU = A->getValue(); -if (CPU == "nat

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-27 Thread Yingwei Zheng via cfe-commits
@@ -2002,6 +2003,76 @@ bool sys::getHostCPUFeatures(StringMap &Features) { return true; } +#elif defined(__linux__) && defined(__riscv) +// struct riscv_hwprobe +struct RISCVHwProbe { + int64_t Key; + uint64_t Value; +}; +bool sys::getHostCPUFeatures(StringMap &Features) {

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-26 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Any thoughts? Hopefully I can catch up with the 19 release :) https://github.com/llvm/llvm-project/pull/94352 ___ 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 getHostCPUFeatures using hwprobe (PR #94352)

2024-06-24 Thread Yingwei Zheng via cfe-commits
@@ -2002,6 +2003,76 @@ bool sys::getHostCPUFeatures(StringMap &Features) { return true; } +#elif defined(__linux__) && defined(__riscv) +// struct riscv_hwprobe +struct RISCVHwProbe { + int64_t Key; + uint64_t Value; +}; +bool sys::getHostCPUFeatures(StringMap &Features) {

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-24 Thread Yingwei Zheng via cfe-commits
@@ -2002,6 +2003,76 @@ bool sys::getHostCPUFeatures(StringMap &Features) { return true; } +#elif defined(__linux__) && defined(__riscv) +// struct riscv_hwprobe +struct RISCVHwProbe { + int64_t Key; + uint64_t Value; +}; +bool sys::getHostCPUFeatures(StringMap &Features) {

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-24 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw edited https://github.com/llvm/llvm-project/pull/94352 ___ 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 getHostCPUFeatures using hwprobe (PR #94352)

2024-06-24 Thread Yingwei Zheng via cfe-commits
@@ -2002,6 +2003,76 @@ bool sys::getHostCPUFeatures(StringMap &Features) { return true; } +#elif defined(__linux__) && defined(__riscv) +// struct riscv_hwprobe +struct RISCVHwProbe { + int64_t Key; + uint64_t Value; +}; +bool sys::getHostCPUFeatures(StringMap &Features) {

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-24 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/94352 >From ff839bef048a65760f4cd0e9abafe11cfebd9362 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 4 Jun 2024 21:08:27 +0800 Subject: [PATCH 01/11] [RISCV] Add support for getHostCPUFeatures using hwprobe C

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-24 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/94352 >From ff839bef048a65760f4cd0e9abafe11cfebd9362 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 4 Jun 2024 21:08:27 +0800 Subject: [PATCH 01/10] [RISCV] Add support for getHostCPUFeatures using hwprobe C

[clang] [llvm] [RISCV] Remove experimental from Ztso. (PR #96465)

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

[clang] [llvm] [RISCV] Remove experimental from Ztso. (PR #96465)

2024-06-24 Thread Yingwei Zheng via cfe-commits
@@ -365,24 +365,30 @@ // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZFHMIN %s // RV32-ZFHMIN: "-target-feature" "+zfhmin" -// RUN: not %clang --target=riscv32-unknown-elf -march=rv32iztso -### %s \ +// RUN: not %clang --target=riscv32-unknown-elf -march=rv32izalasr

[clang] [llvm] [RISCV] Add support for getHostCPUFeatures using hwprobe (PR #94352)

2024-06-24 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: See https://github.com/llvm/llvm-project/pull/96465 https://github.com/llvm/llvm-project/pull/94352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   >