[clang] 7cac7e0 - [IR] Prefer hasFnAttribute() where possible (NFC)

2020-06-15 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2020-06-15T09:30:35+02:00 New Revision: 7cac7e0cfc72c865bfe42cc5c068e17218e600d5 URL: https://github.com/llvm/llvm-project/commit/7cac7e0cfc72c865bfe42cc5c068e17218e600d5 DIFF: https://github.com/llvm/llvm-project/commit/7cac7e0cfc72c865bfe42cc5c068e17218e600d5.diff

[clang] afc287e - Fix clang test after D76886

2020-04-30 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2020-04-30T23:42:38+02:00 New Revision: afc287e0abec710398465ee1f86237513f2b5091 URL: https://github.com/llvm/llvm-project/commit/afc287e0abec710398465ee1f86237513f2b5091 DIFF: https://github.com/llvm/llvm-project/commit/afc287e0abec710398465ee1f86237513f2b5091.diff

[clang] 25af353 - [NewPM][LVI] Abandon LVI after CVP

2020-08-01 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2020-08-01T23:47:46+02:00 New Revision: 25af353b0e74907d5d50c8616b885bd1f73a68b3 URL: https://github.com/llvm/llvm-project/commit/25af353b0e74907d5d50c8616b885bd1f73a68b3 DIFF: https://github.com/llvm/llvm-project/commit/25af353b0e74907d5d50c8616b885bd1f73a68b3.diff

[clang] f89f7da - [IR] Convert null-pointer-is-valid into an enum attribute

2020-05-15 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2020-05-15T19:41:07+02:00 New Revision: f89f7da999f362e4213c69923328dd1033276e59 URL: https://github.com/llvm/llvm-project/commit/f89f7da999f362e4213c69923328dd1033276e59 DIFF: https://github.com/llvm/llvm-project/commit/f89f7da999f362e4213c69923328dd1033276e59.diff

[clang] c04eab8 - [Flang] Use find_program() to find clang-tblgen

2022-08-29 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-08-29T11:09:25+02:00 New Revision: c04eab8c78e517210c7641551ec008b09bfe20d0 URL: https://github.com/llvm/llvm-project/commit/c04eab8c78e517210c7641551ec008b09bfe20d0 DIFF: https://github.com/llvm/llvm-project/commit/c04eab8c78e517210c7641551ec008b09bfe20d0.diff

[libclc] a11e2d7 - [libclc] Quote addition of CLC/LLAsm flags

2022-08-31 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-08-31T11:10:24+02:00 New Revision: a11e2d7366a11385e23d142ac93065a861b70a16 URL: https://github.com/llvm/llvm-project/commit/a11e2d7366a11385e23d142ac93065a861b70a16 DIFF: https://github.com/llvm/llvm-project/commit/a11e2d7366a11385e23d142ac93065a861b70a16.diff

[clang] 7179779 - [OpenMP] Mark -fopenmp-implicit-rpath as NoArgumentUnused

2022-09-06 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-09-06T09:44:45+02:00 New Revision: 71797797f7a759245cb39b93307e0641c511170c URL: https://github.com/llvm/llvm-project/commit/71797797f7a759245cb39b93307e0641c511170c DIFF: https://github.com/llvm/llvm-project/commit/71797797f7a759245cb39b93307e0641c511170c.diff

[clang] 98a3a34 - [ConstantExpr] Don't create fneg expressions

2022-09-07 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-09-07T11:27:25+02:00 New Revision: 98a3a340c3612c06c51d7bb36bfc5857ab06a951 URL: https://github.com/llvm/llvm-project/commit/98a3a340c3612c06c51d7bb36bfc5857ab06a951 DIFF: https://github.com/llvm/llvm-project/commit/98a3a340c3612c06c51d7bb36bfc5857ab06a951.diff

[clang] fd24750 - Revert "C++/ObjC++: switch to gnu++17 as the default standard"

2022-09-08 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-09-08T09:45:50+02:00 New Revision: fd2475049e882e6c70a745cbe0799749ba184910 URL: https://github.com/llvm/llvm-project/commit/fd2475049e882e6c70a745cbe0799749ba184910 DIFF: https://github.com/llvm/llvm-project/commit/fd2475049e882e6c70a745cbe0799749ba184910.diff

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

2023-11-06 Thread Nikita Popov via cfe-commits
nikic wrote: You also need to replace uses in polly. https://github.com/llvm/llvm-project/pull/71029 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [clang-tools-extra] [llvm] [clang] [InferAddressSpaces] Fix constant replace to avoid modifying other functions (PR #70611)

2023-11-07 Thread Nikita Popov via cfe-commits
@@ -334,6 +335,15 @@ template<> struct simplify_type { } }; +template <> struct GraphTraits { nikic wrote: > What's the issue with putting this here? Seems nicer than inlining yet > another DFS in another place. I have a couple of concerns about exposing

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

2023-11-07 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/71534 >From e965141dc8e0be4dceb3e302ea91761203015c72 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 6 Nov 2023 17:28:11 +0100 Subject: [PATCH] [InstCombine] Infer zext nneg flag Use KnownBits to infer the nneg fl

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

2023-11-08 Thread Nikita Popov via cfe-commits
https://github.com/nikic closed 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 Nikita Popov via cfe-commits
@@ -5587,11 +5587,20 @@ Instruction *InstCombinerImpl::foldICmpWithZextOrSext(ICmpInst &ICmp) { return new ICmpInst(ICmp.getPredicate(), Builder.CreateOr(X, Y), Constant::getNullValue(X->getType())); + // Treat "zext nneg" as "sext" +

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

2023-11-08 Thread Nikita Popov 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 { nikic wrote: I think the point of these tests is to check interaction between IPSCCP and InstCombine, so a PhaseOrdering te

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

2023-11-08 Thread Nikita Popov 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) { nikic w

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

2023-11-09 Thread Nikita Popov via cfe-commits
nikic wrote: It looks like simplifyAssocCastAssoc() is the problematic transform. It modifies a zext in-place without clearing poison flags. https://github.com/llvm/llvm-project/pull/71534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

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

2023-11-09 Thread Nikita Popov via cfe-commits
nikic wrote: Should be fixed by https://github.com/llvm/llvm-project/commit/1b1c81772fe50a1cb2b2adf8d8cf442c0b73602f. https://github.com/llvm/llvm-project/pull/71534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] cd7ba9f - [Clang] Generate test checks (NFC)

2023-11-10 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-11-10T16:27:37+01:00 New Revision: cd7ba9f3d090afb5d3b15b0dcf379d15d1e11e33 URL: https://github.com/llvm/llvm-project/commit/cd7ba9f3d090afb5d3b15b0dcf379d15d1e11e33 DIFF: https://github.com/llvm/llvm-project/commit/cd7ba9f3d090afb5d3b15b0dcf379d15d1e11e33.diff

[clang] 82f68a9 - [IR] Mark lshr and ashr constant expressions as undesirable

2023-11-10 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-11-10T16:29:13+01:00 New Revision: 82f68a992b9f89036042d57a5f6345cb2925b2c1 URL: https://github.com/llvm/llvm-project/commit/82f68a992b9f89036042d57a5f6345cb2925b2c1 DIFF: https://github.com/llvm/llvm-project/commit/82f68a992b9f89036042d57a5f6345cb2925b2c1.diff

[clang] 3a9cc17 - [Clang] Add missing REQUIRES to tests (NFC)

2023-11-10 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-11-10T16:31:38+01:00 New Revision: 3a9cc17ca088267348e4b4a6e64a88a38ae9c6e4 URL: https://github.com/llvm/llvm-project/commit/3a9cc17ca088267348e4b4a6e64a88a38ae9c6e4 DIFF: https://github.com/llvm/llvm-project/commit/3a9cc17ca088267348e4b4a6e64a88a38ae9c6e4.diff

[clang] [Clang][SME2] Add single and multi min and max builtins (PR #71688)

2023-11-10 Thread Nikita Popov via cfe-commits
nikic wrote: FYI I pushed https://github.com/llvm/llvm-project/commit/3a9cc17ca088267348e4b4a6e64a88a38ae9c6e4 to hopefully unbreak the build. https://github.com/llvm/llvm-project/pull/71688 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

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

2023-11-11 Thread Nikita Popov via cfe-commits
@@ -247,6 +355,19 @@ define i1 @sext_zext_uge_op0_wide(i16 %x, i8 %y) { ret i1 %c } + +define i1 @sext_zext_nneg_uge_op0_wide(i16 %x, i8 %y) { +; CHECK-LABEL: @sext_zext_nneg_uge_op0_wide( +; CHECK-NEXT:[[TMP1:%.*]] = sext i8 [[Y:%.*]] to i16 +; CHECK-NEXT:[[C:%.*]]

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

2023-11-11 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,145 @@ +; RUN: opt < %s --O3 -S | FileCheck %s nikic wrote: You need to use `-O2 -Xclang -disable-llvm-optzns`, or manually drop the `optnone` attributes. https://github.com/llvm/llvm-project/pull/70845 ___

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

2023-11-11 Thread Nikita Popov via cfe-commits
nikic wrote: Your original example does not verify: https://alive2.llvm.org/ce/z/Bkd89Z Can you please provide a correct example of what you're trying to do? https://github.com/llvm/llvm-project/pull/68502 ___ cfe-commits mailing list cfe-commits@list

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

2023-11-11 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. 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

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

2023-11-11 Thread Nikita Popov via cfe-commits
https://github.com/nikic 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] [clang-tools-extra] [InstCombine] Convert or concat to fshl if opposite or concat exists (PR #68502)

2023-11-12 Thread Nikita Popov via cfe-commits
nikic wrote: Yes, I understand that this transform is only a step towards handling the full pattern. I'm asking for a complete, working example of the original motivating case. The snippets posted in https://github.com/llvm/llvm-project/pull/68502#discussion_r1351618002 do not appear to be co

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

2023-11-12 Thread Nikita Popov via cfe-commits
nikic wrote: Thanks for the updated example! To explain what I meant in first comment using this example: We would perform the transform https://alive2.llvm.org/ce/z/nllcB_, which does not depend at all on how `%yx` is constructed, and whether there is any way to form the `fshl` separately. I

[clang] 1b36a9f - [clang] Use clang_cc1 in test (NFC)

2023-11-13 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-11-13T12:37:14+01:00 New Revision: 1b36a9f0b71abbf02b9bccc3c2d4fd668a68d59d URL: https://github.com/llvm/llvm-project/commit/1b36a9f0b71abbf02b9bccc3c2d4fd668a68d59d DIFF: https://github.com/llvm/llvm-project/commit/1b36a9f0b71abbf02b9bccc3c2d4fd668a68d59d.diff

[llvm] [clang] [flang] [DebugInfo] Move jump table test to X86 directory (PR #72118)

2023-11-13 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/72118 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [InstCombine] Infer disjoint flag on Or instructions. (PR #72912)

2023-12-04 Thread Nikita Popov via cfe-commits
nikic wrote: > We don't have a `isGuaranteedNotToBeUndef` only function, so that's the only > way. I would leave a fixme, since this call can be removed if we ever manage > to kill undef. I actually added this function earlier today. > @nikic is something like this the right fix? I'd move th

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

2023-12-05 Thread Nikita Popov via cfe-commits
nikic wrote: The problem for mpeg2decode seems to be that we do more `add` to `or disjoint` conversions. But `or disjoint` is still being implemented, so e.g. in SCEV we don't recognize it yet and fail to create an `add` SCEV for it. So I think we need to do some more work on `or disjoint` and

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

2023-12-05 Thread Nikita Popov via cfe-commits
nikic wrote: I've put up https://github.com/llvm/llvm-project/pull/74467 to use disjoint in SCEV. https://github.com/llvm/llvm-project/pull/73662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

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

2023-12-05 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/73662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2023-12-05 Thread Nikita Popov via cfe-commits
nikic wrote: Rebased over the SCEV change. @dtcxzyw Can you please give it another try? https://github.com/llvm/llvm-project/pull/73662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][IR] Add native vector support to ConstantInt & ConstantFP. (PR #74502)

2023-12-05 Thread Nikita Popov via cfe-commits
@@ -98,6 +99,13 @@ class ConstantInt final : public ConstantData { /// value. Otherwise return a ConstantInt for the given value. static Constant *get(Type *Ty, uint64_t V, bool IsSigned = false); + /// WARNING: Incomplete support, do not use. These methods exist for earl

[clang] [llvm] [LLVM][IR] Add native vector support to ConstantInt & ConstantFP. (PR #74502)

2023-12-05 Thread Nikita Popov via cfe-commits
@@ -343,7 +343,7 @@ static bool verifyTripCount(Value *RHS, Loop *L, // If the RHS of the compare is equal to the backedge taken count we need // to add one to get the trip count. if (SCEVRHS == BackedgeTCExt || SCEVRHS == BackedgeTakenCount) { - ConstantInt *O

[llvm] [clang] [LLVM][IR] Add native vector support to ConstantInt & ConstantFP. (PR #74502)

2023-12-05 Thread Nikita Popov via cfe-commits
@@ -136,7 +144,11 @@ class ConstantInt final : public ConstantData { inline const APInt &getValue() const { return Val; } /// getBitWidth - Return the bitwidth of this constant. - unsigned getBitWidth() const { return Val.getBitWidth(); } + unsigned getBitWidth() const {

[clang] [llvm] [LLVM][IR] Add native vector support to ConstantInt & ConstantFP. (PR #74502)

2023-12-05 Thread Nikita Popov via cfe-commits
@@ -98,6 +99,13 @@ class ConstantInt final : public ConstantData { /// value. Otherwise return a ConstantInt for the given value. static Constant *get(Type *Ty, uint64_t V, bool IsSigned = false); + /// WARNING: Incomplete support, do not use. These methods exist for earl

[clang] [llvm] [LLVM][IR] Add native vector support to ConstantInt & ConstantFP. (PR #74502)

2023-12-05 Thread Nikita Popov via cfe-commits
@@ -136,7 +144,11 @@ class ConstantInt final : public ConstantData { inline const APInt &getValue() const { return Val; } /// getBitWidth - Return the bitwidth of this constant. - unsigned getBitWidth() const { return Val.getBitWidth(); } + unsigned getBitWidth() const {

[clang] [llvm] [LLVM][IR] Add native vector support to ConstantInt & ConstantFP. (PR #74502)

2023-12-05 Thread Nikita Popov via cfe-commits
@@ -343,7 +343,7 @@ static bool verifyTripCount(Value *RHS, Loop *L, // If the RHS of the compare is equal to the backedge taken count we need // to add one to get the trip count. if (SCEVRHS == BackedgeTCExt || SCEVRHS == BackedgeTakenCount) { - ConstantInt *O

[llvm] [clang] [LLVM][IR] Add native vector support to ConstantInt & ConstantFP. (PR #74502)

2023-12-05 Thread Nikita Popov via cfe-commits
@@ -343,7 +343,7 @@ static bool verifyTripCount(Value *RHS, Loop *L, // If the RHS of the compare is equal to the backedge taken count we need // to add one to get the trip count. if (SCEVRHS == BackedgeTCExt || SCEVRHS == BackedgeTakenCount) { - ConstantInt *O

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

2023-12-06 Thread Nikita Popov via cfe-commits
nikic wrote: Okay, it looks like the mpeg2decode regression is indeed fixed. I think the only somewhat significant regression left is `Shootout-C++-ary2`, but in my IR diffs I don't see any regression there (only improvements with a bunch of conditions being optimized away). https://github.co

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

2023-12-06 Thread Nikita Popov via cfe-commits
https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/73662 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2023-12-11 Thread Nikita Popov via cfe-commits
nikic wrote: @bjope It looks like the InstCombine changes enable IndVars to perform LFTR, which is unprofitable in this case. Though the `umax(1)` call is actually completely unnecessary here, but SCEV doesn't realize it. I've put up https://github.com/llvm/llvm-project/pull/75039 to fix that.

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

2023-12-11 Thread Nikita Popov via cfe-commits
nikic wrote: @yonghong-song I think it may be possible to improve CVP to handle this better, in which case we won't need BPF workarounds. I'll look into it. https://github.com/llvm/llvm-project/pull/73662 ___ cfe-commits mailing list cfe-commits@lists

[clang] [llvm] split load to bytes to deduce load value (PR #72364)

2023-11-15 Thread Nikita Popov via cfe-commits
https://github.com/nikic requested changes to this pull request. I don't like the overall approach of assembling this from individual byte-sized loads here. What I would expect to see is more something along these lines: If we find a clobbering store that a) only clobbers some subset of the loa

[llvm] [clang] split load to bytes to deduce load value (PR #72364)

2023-11-15 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/72364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] split load to bytes to deduce load value (PR #72364)

2023-11-15 Thread Nikita Popov via cfe-commits
@@ -2128,6 +2129,105 @@ static void patchAndReplaceAllUsesWith(Instruction *I, Value *Repl) { I->replaceAllUsesWith(Repl); } +// split load to single byte loads and check if the value can be deduced +// +// Example: +// define i32 @f(i8* %P) +// 1: %b2 = getelementptr inbo

[llvm] [clang] split load to bytes to deduce load value (PR #72364)

2023-11-15 Thread Nikita Popov via cfe-commits
@@ -2128,6 +2129,105 @@ static void patchAndReplaceAllUsesWith(Instruction *I, Value *Repl) { I->replaceAllUsesWith(Repl); } +// split load to single byte loads and check if the value can be deduced +// +// Example: +// define i32 @f(i8* %P) +// 1: %b2 = getelementptr inbo

[llvm] [clang] split load to bytes to deduce load value (PR #72364)

2023-11-15 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,166 @@ +; RUN: opt -S -O3 < %s nikic wrote: GVN tests should use `-passes=gvn` only, not `-O3`. https://github.com/llvm/llvm-project/pull/72364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [NFC] Fix CSPGO clang pass manager test (PR #72681)

2023-11-17 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/72681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Ensure minimal alignment of global vars of incomplete type. (PR #72886)

2023-11-22 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,32 @@ +// RUN: %clang --target=s390x-linux -S -emit-llvm -o - %s | FileCheck %s nikic wrote: Why is this a Driver test rather than a CodeGen test using clang_cc1? https://github.com/llvm/llvm-project/pull/72886

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

2023-10-27 Thread Nikita Popov via cfe-commits
nikic wrote: The InstCombine/ptrmask.ll test is failing in CI. https://github.com/llvm/llvm-project/pull/67166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 03ec84a - Revert "Add two time-trace scope variables."

2023-10-31 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-10-31T10:46:49+01:00 New Revision: 03ec84a00ba4d540222ab39c407e02959058fbdd URL: https://github.com/llvm/llvm-project/commit/03ec84a00ba4d540222ab39c407e02959058fbdd DIFF: https://github.com/llvm/llvm-project/commit/03ec84a00ba4d540222ab39c407e02959058fbdd.diff

[clang] [time-trace] Add a new time trace scope variable named "ParseDeclarationOrFunctionDefinition". (PR #65268)

2023-10-31 Thread Nikita Popov via cfe-commits
nikic wrote: I've reverted this change because it causes a large compile-time regression: http://llvm-compile-time-tracker.com/compare.php?from=61b9176cf70444c54f3ac6eebd82fc9ffd69944d&to=33b85867e30e1adc2ff2173039c199b81c10f52b&stat=instructions:u >From a quick glance at your implementation, I

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

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

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

2023-11-01 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,185 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --tool ./bin/opt --version 3 +; See PRXXX for more details +; RUN-./bin/opt: opt < %s -S -passes=ipsccp | FileCheck %s nikic wrote: This is an ipsccp test in t

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

2023-11-01 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: %clang_cc1 %s -O2 -triple=x86_64-apple-darwin -emit-llvm -o - | FileCheck %s nikic wrote: We don't test end-to-end codegen with clang. If you want to test this, you should take the unoptimized clang IR and create a test in the llvm/te

[clang] 5084891 - [CGExprConstant] Avoid use of ConstantExpr::getIntegerCast() (NFC)

2023-11-01 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-11-01T12:02:19+01:00 New Revision: 50848916e5e4f07231c7366e6d0014de6f7bc362 URL: https://github.com/llvm/llvm-project/commit/50848916e5e4f07231c7366e6d0014de6f7bc362 DIFF: https://github.com/llvm/llvm-project/commit/50848916e5e4f07231c7366e6d0014de6f7bc362.diff

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

2023-11-01 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/67166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2023-11-01 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/67166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2023-11-01 Thread Nikita Popov via cfe-commits
@@ -978,8 +1031,10 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, } // If the client is only demanding bits that we know, return the known - // constant. - if (DemandedMask.isSubsetOf(Known.Zero|Known.One)) + // constant. We can't dir

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

2023-11-01 Thread Nikita Popov via cfe-commits
@@ -6411,6 +6411,44 @@ 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()); + +

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

2023-11-02 Thread Nikita Popov via cfe-commits
nikic wrote: > Also adds AS = 0 as an optional argument to get() methods. I believe that was intentionally omitted to make sure address spaces aren't forgotten (getUnqual is used for the case where they aren't relevant). cc @arsenm Not sure whether this consideration is still relevant with o

[llvm] [clang] [WebAssembly] Mark externref as not being valid vector elements (PR #71069)

2023-11-02 Thread Nikita Popov via cfe-commits
nikic wrote: @pmatos If you don't want to go all the way to target extension types, is it possible to gracefully handle this in wasm's TTI cost model? Return an invalid or very high cost in this case? https://github.com/llvm/llvm-project/pull/71069 _

[clang] [Clang][CodeGen] Emit `llvm.ptrmask` for `align_up` and `align_down` (PR #71238)

2023-11-03 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM As a possible followup, we can probably drop the alignment assumption now? I don't think it adds additional value if we're using ptrmask... https://github.com/llvm/llvm-project/pull/71238 ___

[llvm] [clang-tools-extra] [clang] [LLVM] Add IRNormalizer Pass (PR #68176)

2023-11-04 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,637 @@ +//===--- IRNormalizer.cpp - IR Normalizer ---===// +// +// 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: Apache-2.

[llvm] [clang] [clang-tools-extra] [LLVM] Add IRNormalizer Pass (PR #68176)

2023-11-04 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,637 @@ +//===--- IRNormalizer.cpp - IR Normalizer ---===// +// +// 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: Apache-2.

[clang] [llvm] [clang-tools-extra] [LLVM] Add IRNormalizer Pass (PR #68176)

2023-11-04 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,637 @@ +//===--- IRNormalizer.cpp - IR Normalizer ---===// +// +// 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: Apache-2.

[llvm] [clang] [clang-tools-extra] [LLVM] Add IRNormalizer Pass (PR #68176)

2023-11-04 Thread Nikita Popov via cfe-commits
@@ -543,6 +543,14 @@ variables with initializers are marked as internal. An interprocedural variant of :ref:`Sparse Conditional Constant Propagation `. +``ir-normalizer``: Transforms IR into a canonical form that's easier to diff nikic wrote: Looks like there

[clang] [llvm] [clang-tools-extra] [LLVM] Add IRNormalizer Pass (PR #68176)

2023-11-04 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/68176 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [clang-tools-extra] [LLVM] Add IRNormalizer Pass (PR #68176)

2023-11-04 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,637 @@ +//===--- IRNormalizer.cpp - IR Normalizer ---===// +// +// 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: Apache-2.

[clang] [llvm] [clang-tools-extra] [LLVM] Add IRNormalizer Pass (PR #68176)

2023-11-04 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,637 @@ +//===--- IRNormalizer.cpp - IR Normalizer ---===// +// +// 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: Apache-2.

[clang] [clang-tools-extra] [llvm] [LLVM] Add IRNormalizer Pass (PR #68176)

2023-11-04 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: Could you please update the patch description with some information on what kind of normalization the pass does? It would also be great to post some examples, because I don't really get what kind of renaming and reordering this does just looking at the test

[clang-tools-extra] [llvm] [clang] [LLVM] Add IRNormalizer Pass (PR #68176)

2023-11-04 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,637 @@ +//===--- IRNormalizer.cpp - IR Normalizer ---===// +// +// 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: Apache-2.

[llvm] [clang-tools-extra] [clang] [LLVM] Add IRNormalizer Pass (PR #68176)

2023-11-04 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,637 @@ +//===--- IRNormalizer.cpp - IR Normalizer ---===// +// +// 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: Apache-2.

[clang-tools-extra] [clang] [llvm] [LLVM] Add IRNormalizer Pass (PR #68176)

2023-11-04 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,637 @@ +//===--- IRNormalizer.cpp - IR Normalizer ---===// +// +// 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: Apache-2.

[clang-tools-extra] [llvm] [clang] [LLVM] Add IRNormalizer Pass (PR #68176)

2023-11-04 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,637 @@ +//===--- IRNormalizer.cpp - IR Normalizer ---===// +// +// 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: Apache-2.

[clang-tools-extra] [llvm] [clang] [LLVM] Add IRNormalizer Pass (PR #68176)

2023-11-04 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/68176 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][CodeGen] Stoping emitting alignment assumes for `align_{up,down}` (PR #71295)

2023-11-05 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. https://github.com/llvm/llvm-project/pull/71295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

2023-12-12 Thread Nikita Popov via cfe-commits
@@ -1577,7 +1577,7 @@ Value *PolynomialMultiplyRecognize::generate(BasicBlock::iterator At, static bool hasZeroSignBit(const Value *V) { if (const auto *CI = dyn_cast(V)) -return (CI->getType()->getSignBit() & CI->getSExtValue()) == 0; +return (CI->getIntegerType()-

[clang] [llvm] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

2023-12-12 Thread Nikita Popov via cfe-commits
@@ -868,7 +868,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, Constant *C1, } if (GVAlign > 1) { -unsigned DstWidth = CI2->getType()->getBitWidth(); +unsigned DstWidth = CI2->getIntegerType()->getBitWidth(); ---

[clang] [llvm] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

2023-12-12 Thread Nikita Popov via cfe-commits
@@ -1062,7 +1062,7 @@ void PolynomialMultiplyRecognize::promoteTo(Instruction *In, // Promote immediates. for (unsigned i = 0, n = In->getNumOperands(); i != n; ++i) { if (ConstantInt *CI = dyn_cast(In->getOperand(i))) - if (CI->getType()->getBitWidth() < DestBW)

[llvm] [clang] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

2023-12-12 Thread Nikita Popov via cfe-commits
@@ -673,8 +673,8 @@ void ConstantHoistingPass::findBaseConstants(GlobalVariable *BaseGV) { llvm::stable_sort(ConstCandVec, [](const ConstantCandidate &LHS, const ConstantCandidate &RHS) { if (LHS.ConstInt->getType() != RHS.ConstInt->g

[llvm] [clang] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

2023-12-12 Thread Nikita Popov via cfe-commits
@@ -1688,7 +1688,7 @@ void PolynomialMultiplyRecognize::setupPreSimplifier(Simplifier &S) { if (I->getOpcode() != Instruction::Or) return nullptr; ConstantInt *Msb = dyn_cast(I->getOperand(1)); - if (!Msb || Msb->getZExtValue() != Msb->getType()->getSi

[clang] [llvm] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

2023-12-12 Thread Nikita Popov via cfe-commits
@@ -6079,7 +6079,7 @@ static Value *simplifyRelativeLoad(Constant *Ptr, Constant *Offset, Type *Int32Ty = Type::getInt32Ty(Ptr->getContext()); auto *OffsetConstInt = dyn_cast(Offset); - if (!OffsetConstInt || OffsetConstInt->getType()->getBitWidth() > 64) + if (!OffsetC

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

2023-12-13 Thread Nikita Popov via cfe-commits
nikic wrote: @eddyz87 Right, this is exactly the change I have been working on, see https://github.com/llvm/llvm-project/pull/75311. Unfortunately, it doesn't actually fix the BPF case, because that one involves a loop, and LVI is currently terrible at handling those. (Basically, even though t

[llvm] [clang] [LVI] Support using block values when handling conditions (PR #75311)

2023-12-13 Thread Nikita Popov via cfe-commits
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/75311 >From 0b4f9e03bf84ffc0a24bc609879c96db9b1d2833 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 12 Dec 2023 15:55:29 +0100 Subject: [PATCH 1/2] [LVI] Support using block values when handling conditions Curren

[llvm] [clang] [LVI] Support using block values when handling conditions (PR #75311)

2023-12-13 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/75311 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

2023-12-13 Thread Nikita Popov via cfe-commits
nikic wrote: > Most all the recommended changes assume the code paths will work equally well > for vector types as they do for scalar types. Can we be so sure this is the > case? This is why I opted to keep the casting assertions with the exception > of a few places where I could be sure the c

[clang] [clang][fatlto] Don't set ThinLTO module flag with FatLTO (PR #75079)

2023-12-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM -- I think this change is clearly right, independently of the ModuleID issue. https://github.com/llvm/llvm-project/pull/75079 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/75448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-14 Thread Nikita Popov via cfe-commits
@@ -108,7 +143,23 @@ class generic_gep_type_iterator { // that. bool isStruct() const { return isa(CurTy); } - bool isSequential() const { return isa(CurTy); } + bool isVector() const { return isa(CurTy); } + bool isSequential() const { return !isStruct(); } + + // For

[clang] [llvm] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-14 Thread Nikita Popov via cfe-commits
@@ -111,6 +111,20 @@ define void @test_evaluate_gep_as_ptrs_array(ptr addrspace(2) %B) { ret void } +define void @test_overaligned_vec(i8 %B) { +; This should be turned into a constexpr instead of being an instruction +; CHECK-LABEL: @test_overaligned_vec( +; TODO:

[clang] [llvm] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: Looks fine to me. Alternative would be to forbid GEP indexing into vectors entirely. https://github.com/llvm/llvm-project/pull/75448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [mlir] [llvm] [LLVM][IR] Replace ConstantInt's specialisation of getType() with getIntegerType(). (PR #75217)

2023-12-15 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/75217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CGCUDANV] Unify PointerType members of CGNVCUDARuntime (NFC) (PR #75668)

2023-12-16 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM There are already C-style function signatures in the comments, so I don't see value in keeping separate variable names. https://github.com/llvm/llvm-project/pull/75668 ___ cfe-commits mailing

[clang] [AArch64][SME] Warn when using a streaming builtin from a non-streaming function (PR #75487)

2023-12-18 Thread Nikita Popov via cfe-commits
nikic wrote: When building clang with clang, the regression on SemaChecking.cpp is now "only" 60% in terms of instructions retired (plus 0.4% during thin link, which is another ~50% in terms of SemaChecking). https://github.com/llvm/llvm-project/pull/75487 _

  1   2   3   4   5   6   7   8   9   10   >