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

2023-12-01 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: My CI detected some significant regressions caused by this patch: https://github.com/dtcxzyw/llvm-ci/pull/839#issuecomment-1836976355 https://github.com/llvm/llvm-project/pull/73662 ___ cfe-commits mailing list

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

2023-12-01 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. The implementation looks good to me. Waiting for the result of my CI. https://github.com/dtcxzyw/llvm-ci/actions/runs/7066692655 @goldsteinn Any comments? https://github.com/llvm/llvm-project/pull/73662

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

2023-11-28 Thread Yingwei Zheng via cfe-commits
@@ -75,7 +75,8 @@ define void @idom_sign_bit_check_edge_dominates_select(i64 %a, i64 %b) { ; CHECK: land.lhs.true: ; CHECK-NEXT:br label [[LOR_END:%.*]] ; CHECK: lor.rhs: -; CHECK-NEXT:[[CMP3_NOT:%.*]] = icmp eq i64 [[A]], [[B:%.*]] +; CHECK-NEXT:

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

2023-11-28 Thread Yingwei Zheng via cfe-commits
@@ -0,0 +1,74 @@ +//===- DomConditionCache.cpp --===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] [clang] [llvm] [InstCombine] Convert or concat to fshl if opposite or concat exists (PR #68502)

2023-11-12 Thread Yingwei Zheng via cfe-commits
@@ -2840,6 +2841,46 @@ static Instruction *matchFunnelShift(Instruction , InstCombinerImpl ) { return nullptr; FShiftArgs = {ShVal0, ShVal1, ShAmt}; + } else if (isa(Or0) || isa(Or1)) { +// If there are two 'or' instructions concat variables in opposite order,

[llvm] [clang] [InstCombine] Use zext's nneg flag for icmp folding (PR #70845)

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

[clang] [llvm] [InstCombine] Use zext's nneg flag for icmp folding (PR #70845)

2023-11-11 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. LGTM. Thank you! Do you have the access to merge PR? https://github.com/llvm/llvm-project/pull/70845 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[llvm] [clang] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

2023-11-11 Thread Yingwei Zheng via cfe-commits
@@ -0,0 +1,145 @@ +; RUN: opt < %s --O3 -S | FileCheck %s dtcxzyw wrote: My command: `bin/opt -S -O3 -print-changed min_max.ll` Then I got IR after the SROA pass :) https://github.com/llvm/llvm-project/pull/70845 ___

[llvm] [clang] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

2023-11-11 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw commented: LGTM https://github.com/llvm/llvm-project/pull/70845 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

2023-11-11 Thread Yingwei Zheng via cfe-commits
@@ -0,0 +1,111 @@ +; RUN: opt < %s -O3 -S | FileCheck %s +; See issue #55013 and PR #70845 for more details. +; This test comes from the following C program, compiled with clang +; +;; short vecreduce_smin_v2i16(int n, short* v) +;; { +;; short p = 0; +;; for (int i = 0; i <

[llvm] [clang] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

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

[llvm] [clang] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

2023-11-11 Thread Yingwei Zheng via cfe-commits
@@ -0,0 +1,112 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3 +; RUN: opt < %s -O3 -S | FileCheck %s +; See issue #55013 and PR #70845 for more details. +; This test comes from the following C program, compiled with clang +;

[llvm] [clang-tools-extra] [clang] [RISCV] Eliminate dead li after emitting VSETVLIs (PR #65934)

2023-11-11 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > Oh nice, I'm running into something similar in #71657. Are all these dead > ADDIs coming from the backwards local postpass? Yes. I believe this PR can address the issue. https://github.com/llvm/llvm-project/pull/65934 ___

[llvm] [clang] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

2023-11-11 Thread Yingwei Zheng via cfe-commits
@@ -0,0 +1,145 @@ +; RUN: opt < %s --O3 -S | FileCheck %s dtcxzyw wrote: ``` define i16 @vecreduce_smin_v2i16(i32 %n, ptr %v) { entry: br label %for.cond for.cond: %p.0 = phi i16 [ 0, %entry ], [ %conv8, %for.inc ] %i.0 = phi i32 [ 0, %entry ], [ %inc,

[llvm] [clang] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

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

[llvm] [clang] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

2023-11-11 Thread Yingwei Zheng via cfe-commits
@@ -0,0 +1,145 @@ +; RUN: opt < %s --O3 -S | FileCheck %s dtcxzyw wrote: ```suggestion ; RUN: opt < %s -O3 -S | FileCheck %s ``` https://github.com/llvm/llvm-project/pull/70845 ___ cfe-commits mailing list

[llvm] [clang] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

2023-11-11 Thread Yingwei Zheng via cfe-commits
@@ -0,0 +1,145 @@ +; RUN: opt < %s --O3 -S | FileCheck %s dtcxzyw wrote: Could you please: 1. Convert this IR into SSA form as @nikic mentioned. 2. Drop unused attributes. 3. Re-generate tests with `llvm/utils/update_test_checks.py`.

[llvm] [clang] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

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

[llvm] [clang] [InstCombine] Infer zext nneg flag (PR #71534)

2023-11-09 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Reduced test case: https://godbolt.org/z/d4ETPhbno https://github.com/llvm/llvm-project/pull/71534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

2023-11-08 Thread Yingwei Zheng via cfe-commits
@@ -0,0 +1,175 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3 +; See PR-70845 for more details +; RUN: opt < %s -S -passes=instcombine | FileCheck %s + + +define signext i32 @sext_sext(i16 %x, i16 %y) {

[clang] [llvm] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

2023-11-08 Thread Yingwei Zheng via cfe-commits
@@ -0,0 +1,175 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3 +; See PR-70845 for more details +; RUN: opt < %s -S -passes=instcombine | FileCheck %s + + +define signext i32 @sext_sext(i16 %x, i16 %y) { +; CHECK-LABEL: define

[clang] [llvm] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

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

[llvm] [clang] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

2023-11-08 Thread Yingwei Zheng via cfe-commits
@@ -0,0 +1,126 @@ +; RUN: opt < %s --O3 -S | FileCheck %s + +define signext i16 @vecreduce_smax_v2i16(i32 noundef %0, ptr noundef %1) #0 { dtcxzyw wrote: Could you please reduce the test case and move it into `InstCombine`?

[llvm] [clang] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

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

[llvm] [clang] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)

2023-11-08 Thread Yingwei Zheng via cfe-commits
@@ -5587,11 +5587,20 @@ Instruction *InstCombinerImpl::foldICmpWithZextOrSext(ICmpInst ) { return new ICmpInst(ICmp.getPredicate(), Builder.CreateOr(X, Y), Constant::getNullValue(X->getType())); + // Treat "zext nneg" as "sext" +

[clang] [llvm] [InstCombine] Infer zext nneg flag (PR #71534)

2023-11-07 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw approved this pull request. LGTM. Thanks! We can improve the compile time by adding `nneg` flag during the zext creation (e.g., `cttz(zext(x)) -> zext nneg(cttz(x))`). https://github.com/llvm/llvm-project/pull/71534 ___

[polly] [llvm] [clang] [mlir] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-07 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Please also update existing uses in `lldb`. Buildbot failure: https://lab.llvm.org/buildbot/#/builders/68/builds/63101 https://github.com/llvm/llvm-project/pull/71029 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[llvm] [clang] [RISCV] Add processor definition for XiangShan-NanHu (PR #70294)

2023-11-07 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw closed https://github.com/llvm/llvm-project/pull/70294 ___ 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-NanHu (PR #70294)

2023-11-01 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/70294 >From 1222b8bda348af58f4921a45d8cddca726875bb9 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Thu, 26 Oct 2023 13:47:39 +0800 Subject: [PATCH 1/2] [RISCV] Add processor definition for XiangShan-NanHu

[clang] [llvm] [RISCV] Add processor definition for XiangShan-NanHu (PR #70294)

2023-11-01 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Ping. @preames Any more comments? https://github.com/llvm/llvm-project/pull/70294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Eliminate dead li after emitting VSETVLIs (PR #65934)

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

[clang] [RISCV] Add sched model for XiangShan-NanHu (PR #70232)

2023-10-28 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Rebased on top of #70241. https://github.com/llvm/llvm-project/pull/70232 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Add sched model for XiangShan-NanHu (PR #70232)

2023-10-28 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/70232 >From b34055dca42c23682bb9f0e9e022f17e9dbf2aca Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 28 Oct 2023 20:46:37 +0800 Subject: [PATCH] [RISCV] Add sched model for XiangShan-NanHu Co-authored-by:

[clang] [RISCV] Add processor definition for XiangShan-NanHu (PR #70294)

2023-10-26 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Any more questions about XiangShan? If there is no question, I will merge this PR tomorrow. https://github.com/llvm/llvm-project/pull/70294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [RISCV] Add processor definition for XiangShan-NanHu (PR #70294)

2023-10-26 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > LGTM in general, except one question: will zicbom and zicboz be in the final > RTL? You can find the full implementation of `zicbom` and `zicboz` here: https://github.com/OpenXiangShan/XiangShan/commit/ca18a0b47b0e4089fd0dd1c085091cb90bf98f25. cc @poemonsense

[clang] [RISCV] Add sched model for XiangShan-NanHu (PR #70232)

2023-10-26 Thread Yingwei Zheng via cfe-commits
@@ -20,6 +20,17 @@ // MCPU-SYNTACORE-SCR1-MAX: "-target-feature" "+zicsr" "-target-feature" "+zifencei" // MCPU-SYNTACORE-SCR1-MAX: "-target-abi" "ilp32" +// RUN: %clang --target=riscv64 -### -c %s 2>&1 -mcpu=xiangshan-nanhu | FileCheck -check-prefix=MCPU-XIANGSHAN-NANHU %s

[clang] [RISCV] Add processor definition for XiangShan-NanHu (PR #70294)

2023-10-26 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/70294 >From a4e46c81c5235754bf7b4e0b3dd3ff8805b3e56d Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Thu, 26 Oct 2023 13:47:39 +0800 Subject: [PATCH 1/2] [RISCV] Add processor definition for XiangShan-NanHu

[clang] [RISCV] Add sched model for XiangShan-NanHu (PR #70232)

2023-10-25 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: > Can you separate out the basic processor definition (using NoSchedModel), and > a patch which adds the scheduling model? We can at least get the processor > definition landed while we iterate on the scheduling related pieces. > > edit: For clarity, I'm requesting that the

[clang] [RISCV] Add processor definition for XiangShan-NanHu (PR #70294)

2023-10-25 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/70294 This PR adds the processor definition for XiangShan-NanHu, an open-source high-performance RISC-V processor. According to the official [documentation](https://xiangshan-doc.readthedocs.io/zh-cn/latest/arch/),

[clang] [RISCV] Add sched model for XiangShan-NanHu (PR #70232)

2023-10-25 Thread Yingwei Zheng via cfe-commits
@@ -302,7 +302,7 @@ def FSW : FPStore_r<0b010, "fsw", FPR32, WriteFST32>; } // Predicates = [HasStdExtF] foreach Ext = FExts in { - let SchedRW = [WriteFMA32, ReadFMA32, ReadFMA32, ReadFMA32] in { + let SchedRW = [WriteFMA32, ReadFMA32, ReadFMA32, ReadFMA32Addend] in {

[clang] [RISCV] Add sched model for XiangShan-NanHu (PR #70232)

2023-10-25 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/70232 [XiangShan](https://github.com/OpenXiangShan/XiangShan) is an open-source high-performance RISC-V processor. This PR adds the schedule model for XiangShan-NanHu, the 2nd Gen core of the XiangShan processor

[clang] [Clang] Handle real and imaginary parts of complex lvalue in `APValue::printPretty` (PR #69252)

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

[clang] [Clang] Handle real and imaginary parts of complex lvalue in `APValue::printPretty` (PR #69252)

2023-10-23 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/69252 >From 6e34e74e8e8046aaa086869e8a8aecb781dd3b3b Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 17 Oct 2023 05:17:17 +0800 Subject: [PATCH 1/3] [Clang] Add pre-commit tests for PR69218. NFC. ---

[clang] [Clang] Handle real and imaginary parts of complex lvalue in `APValue::printPretty` (PR #69252)

2023-10-23 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/69252 >From 8f0ebe5b5cfed069c8274c0761559d6595d4dea8 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 17 Oct 2023 05:17:17 +0800 Subject: [PATCH 1/3] [Clang] Add pre-commit tests for PR69218. NFC. ---

[clang] [Clang] Handle real and imaginary parts of complex lvalue in `APValue::printPretty` (PR #69252)

2023-10-23 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/69252 >From 8f0ebe5b5cfed069c8274c0761559d6595d4dea8 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 17 Oct 2023 05:17:17 +0800 Subject: [PATCH 1/3] [Clang] Add pre-commit tests for PR69218. NFC. ---

[clang-tools-extra] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

2023-10-23 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: @nikic Any comments about this PR? https://github.com/llvm/llvm-project/pull/67917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

2023-10-23 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: @nikic Any comments about this PR? https://github.com/llvm/llvm-project/pull/67917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

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

[clang-tools-extra] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

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

[clang] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)

2023-10-20 Thread Yingwei Zheng via cfe-commits
@@ -6411,6 +6411,41 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value *Op0, Value *Op1, return Constant::getNullValue(ReturnType); break; } + case Intrinsic::ptrmask: { +if (isa(Op0) || isa(Op1)) + return PoisonValue::get(Op0->getType()); + +

[clang] [Clang] Handle real and imaginary parts of complex lvalue in `APValue::printPretty` (PR #69252)

2023-10-16 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw created https://github.com/llvm/llvm-project/pull/69252 This patch handles formatting of real and imaginary parts of complex lvalue. Fixes #69218. >From 8f0ebe5b5cfed069c8274c0761559d6595d4dea8 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 17 Oct 2023

[clang-tools-extra] [RISCV] Eliminate dead li after emitting VSETVLIs (PR #65934)

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

[clang] 411ceac - [Clang] Fix tautological assertion in `Sema::CheckX86BuiltinTileDuplicate`

2023-10-13 Thread Yingwei Zheng via cfe-commits
Author: Yingwei Zheng Date: 2023-10-13T15:19:35+08:00 New Revision: 411ceacf4351bd3af9db75b859063864b19e71e1 URL: https://github.com/llvm/llvm-project/commit/411ceacf4351bd3af9db75b859063864b19e71e1 DIFF: https://github.com/llvm/llvm-project/commit/411ceacf4351bd3af9db75b859063864b19e71e1.diff

[clang-tools-extra] [InstCombine] Canonicalize `(X +/- Y) & Y` into `~X & Y` when Y is a power of 2 (PR #67915)

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

[clang] [RISCV] Eliminate dead li after emitting VSETVLIs (PR #65934)

2023-10-11 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Gentle ping. https://github.com/llvm/llvm-project/pull/65934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [RISCV] Eliminate dead li after emitting VSETVLIs (PR #65934)

2023-10-11 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: Gentle ping. https://github.com/llvm/llvm-project/pull/65934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][RISCV] Fix the condition of checking signature in getIndex (PR #67403)

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

[clang-tools-extra] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

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

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

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

[clang] [InstCombine] Canonicalize `(X +/- Y) & Y` into `~X & Y` when Y is a power of 2 (PR #67915)

2023-10-06 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/67915 >From c4ce28c942c172e5646b5922f0b02b4169197840 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sun, 1 Oct 2023 21:52:47 +0800 Subject: [PATCH 1/2] [InstCombine] Canonicalize `(X +/- Y) & Y` into `~X & Y`

[clang-tools-extra] [InstCombine] Canonicalize `(X +/- Y) & Y` into `~X & Y` when Y is a power of 2 (PR #67915)

2023-10-06 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/67915 >From c4ce28c942c172e5646b5922f0b02b4169197840 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sun, 1 Oct 2023 21:52:47 +0800 Subject: [PATCH 1/2] [InstCombine] Canonicalize `(X +/- Y) & Y` into `~X & Y`

[clang-tools-extra] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-10-06 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: The conflict resolution should be correct now. https://github.com/llvm/llvm-project/pull/65852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-10-06 Thread Yingwei Zheng via cfe-commits
dtcxzyw wrote: The conflict resolution should be correct now. https://github.com/llvm/llvm-project/pull/65852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-10-06 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH 01/10] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq

[clang-tools-extra] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-10-06 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH 01/10] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq

[clang-tools-extra] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-10-06 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH 01/10] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-10-06 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH 01/10] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq

[clang] [InstCombine] Canonicalize `(X +/- Y) & Y` into `~X & Y` when Y is a power of 2 (PR #67915)

2023-10-06 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/67915 >From c4ce28c942c172e5646b5922f0b02b4169197840 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sun, 1 Oct 2023 21:52:47 +0800 Subject: [PATCH 1/2] [InstCombine] Canonicalize `(X +/- Y) & Y` into `~X & Y`

[clang-tools-extra] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-10-06 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH 01/10] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-10-06 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH 01/10] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq

[clang] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

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

[clang-tools-extra] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

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

[clang] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

2023-10-05 Thread Yingwei Zheng via cfe-commits
@@ -1735,6 +1746,122 @@ ConstantRange ConstantRange::ctlz(bool ZeroIsPoison) const { return getNonEmpty(APInt(getBitWidth(), getUnsignedMax().countl_zero()), APInt(getBitWidth(), getUnsignedMin().countl_zero() + 1)); } +static ConstantRange

[clang-tools-extra] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

2023-10-05 Thread Yingwei Zheng via cfe-commits
@@ -1735,6 +1746,122 @@ ConstantRange ConstantRange::ctlz(bool ZeroIsPoison) const { return getNonEmpty(APInt(getBitWidth(), getUnsignedMax().countl_zero()), APInt(getBitWidth(), getUnsignedMin().countl_zero() + 1)); } +static ConstantRange

[clang] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

2023-10-05 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/67917 >From b5d134c88a04c524b1d9120a1c1a5dae3722904c Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sun, 1 Oct 2023 22:17:35 +0800 Subject: [PATCH 1/4] [ConstantRange] Handle `Intrinsic::cttz` and

[clang-tools-extra] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

2023-10-05 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/67917 >From b5d134c88a04c524b1d9120a1c1a5dae3722904c Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sun, 1 Oct 2023 22:17:35 +0800 Subject: [PATCH 1/4] [ConstantRange] Handle `Intrinsic::cttz` and

[clang] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

2023-10-05 Thread Yingwei Zheng via cfe-commits
@@ -1735,6 +1746,122 @@ ConstantRange ConstantRange::ctlz(bool ZeroIsPoison) const { return getNonEmpty(APInt(getBitWidth(), getUnsignedMax().countl_zero()), APInt(getBitWidth(), getUnsignedMin().countl_zero() + 1)); } +static ConstantRange

[clang-tools-extra] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

2023-10-05 Thread Yingwei Zheng via cfe-commits
@@ -1735,6 +1746,122 @@ ConstantRange ConstantRange::ctlz(bool ZeroIsPoison) const { return getNonEmpty(APInt(getBitWidth(), getUnsignedMax().countl_zero()), APInt(getBitWidth(), getUnsignedMin().countl_zero() + 1)); } +static ConstantRange

[clang] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

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

[clang] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

2023-10-05 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/67917 >From b5d134c88a04c524b1d9120a1c1a5dae3722904c Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sun, 1 Oct 2023 22:17:35 +0800 Subject: [PATCH 1/3] [ConstantRange] Handle `Intrinsic::cttz` and

[clang-tools-extra] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

2023-10-05 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/67917 >From b5d134c88a04c524b1d9120a1c1a5dae3722904c Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sun, 1 Oct 2023 22:17:35 +0800 Subject: [PATCH 1/3] [ConstantRange] Handle `Intrinsic::cttz` and

[clang-tools-extra] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

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

[clang] [ConstantRange] Handle `Intrinsic::cttz` (PR #67917)

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

[clang-tools-extra] [ConstantRange] Handle `Intrinsic::cttz` and `Intrinsic::ctpop` (PR #67917)

2023-10-05 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/67917 >From b5d134c88a04c524b1d9120a1c1a5dae3722904c Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sun, 1 Oct 2023 22:17:35 +0800 Subject: [PATCH 1/2] [ConstantRange] Handle `Intrinsic::cttz` and

[clang] [ConstantRange] Handle `Intrinsic::cttz` and `Intrinsic::ctpop` (PR #67917)

2023-10-05 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/67917 >From b5d134c88a04c524b1d9120a1c1a5dae3722904c Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sun, 1 Oct 2023 22:17:35 +0800 Subject: [PATCH 1/2] [ConstantRange] Handle `Intrinsic::cttz` and

[clang] [InstCombine] Canonicalize `(X +/- Y) & Y` into `~X & Y` when Y is a power of 2 (PR #67915)

2023-10-05 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/67915 >From c4ce28c942c172e5646b5922f0b02b4169197840 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sun, 1 Oct 2023 21:52:47 +0800 Subject: [PATCH] [InstCombine] Canonicalize `(X +/- Y) & Y` into `~X & Y` when Y

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

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

[clang-tools-extra] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

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

[clang-tools-extra] [RISCV] Eliminate dead li after emitting VSETVLIs (PR #65934)

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

[clang-tools-extra] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-10-01 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH 1/9] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-10-01 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH 1/9] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq

[clang-tools-extra] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-10-01 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH 1/9] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-10-01 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65852 >From d9d8bcbb98e8f5aecb9733329389d61a489bd731 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Sat, 9 Sep 2023 23:07:29 +0800 Subject: [PATCH 1/9] [InstCombine] Simplify the pattern `a ne/eq (zext (a ne/eq

[clang] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-10-01 Thread Yingwei Zheng via cfe-commits
@@ -6380,7 +6380,71 @@ Instruction *InstCombinerImpl::foldICmpUsingBoolRange(ICmpInst ) { Y->getType()->isIntOrIntVectorTy(1) && Pred == ICmpInst::ICMP_ULE) return BinaryOperator::CreateOr(Builder.CreateIsNull(X), Y); + // icmp eq/ne X, (zext/sext (icmp eq/ne X,

[clang] [RISCV] Eliminate dead li after emitting VSETVLIs (PR #65934)

2023-10-01 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/65934 >From 2fe5756dd4d49580d3a23b0ff1b72535f725915e Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Mon, 11 Sep 2023 15:51:46 +0800 Subject: [PATCH 1/4] [RISCV] Eliminate dead li after emitting VSETVLIs ---

[clang-tools-extra] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

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

[clang] [InstCombine] Canonicalize `and(zext(A), B)` into `select A, B & 1, 0` (PR #66740)

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

[clang-tools-extra] [InstCombine] Canonicalize `and(zext(A), B)` into `select A, B & 1, 0` (PR #66740)

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

[clang-tools-extra] [ValueTracking] Simplify uaddo pattern (PR #65910)

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

[clang] [InstCombine] Canonicalize `and(zext(A), B)` into `select A, B & 1, 0` (PR #66740)

2023-09-28 Thread Yingwei Zheng via cfe-commits
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/66740 >From 85f7911dfe0f1e9112881a9f503bcd68edfde580 Mon Sep 17 00:00:00 2001 From: Yingwei Zheng Date: Tue, 19 Sep 2023 10:19:46 +0800 Subject: [PATCH 1/3] [InstCombine] Canonicalize `and(zext(A), B)` into `select

<    1   2   3   4   >