[clang] 8d4b139 - Revert "Consider reference, pointer, and pointer-to-member TemplateArguments to be different if they have different types."

2020-12-11 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2020-12-12T00:04:10+01:00 New Revision: 8d4b139e9dceb43aa91d0451f5458fd05a9fba33 URL: https://github.com/llvm/llvm-project/commit/8d4b139e9dceb43aa91d0451f5458fd05a9fba33 DIFF: https://github.com/llvm/llvm-project/commit/8d4b139e9dceb43aa91d0451f5458fd05a9fba33.diff

[clang] 395607a - Reapply [ConstantFold] Fold more operations to poison

2021-05-13 Thread Nikita Popov via cfe-commits
Author: Juneyoung Lee Date: 2021-05-13T16:04:12+02:00 New Revision: 395607af3cb80f25ee05420ea5ae0ad0be948533 URL: https://github.com/llvm/llvm-project/commit/395607af3cb80f25ee05420ea5ae0ad0be948533 DIFF: https://github.com/llvm/llvm-project/commit/395607af3cb80f25ee05420ea5ae0ad0be948533.diff

[clang] 656296b - Reapply [CaptureTracking] Do not check domination

2021-05-16 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-05-16T15:46:31+02:00 New Revision: 656296b1c2eca127cb48612227fa5f381c81b53b URL: https://github.com/llvm/llvm-project/commit/656296b1c2eca127cb48612227fa5f381c81b53b DIFF: https://github.com/llvm/llvm-project/commit/656296b1c2eca127cb48612227fa5f381c81b53b.diff

[clang] 65fd034 - [FunctionAttrs] Infer willreturn for functions without loops

2021-01-21 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-01-21T20:29:33+01:00 New Revision: 65fd034b95d69fa0e634861ee165b502ceb92a12 URL: https://github.com/llvm/llvm-project/commit/65fd034b95d69fa0e634861ee165b502ceb92a12 DIFF: https://github.com/llvm/llvm-project/commit/65fd034b95d69fa0e634861ee165b502ceb92a12.diff

[clang] 71a8e4e - [MemCopyOpt] Enable MemorySSA by default

2021-02-19 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-02-19T18:06:25+01:00 New Revision: 71a8e4e7d6b947c8b954ec0763ff7969b3879d7b URL: https://github.com/llvm/llvm-project/commit/71a8e4e7d6b947c8b954ec0763ff7969b3879d7b DIFF: https://github.com/llvm/llvm-project/commit/71a8e4e7d6b947c8b954ec0763ff7969b3879d7b.diff

[clang] 983565a - [ADT] Move DenseMapInfo for ArrayRef/StringRef into respective headers (NFC)

2021-06-03 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-06-03T18:34:36+02:00 New Revision: 983565a6fe4a9f40c7caf82b65c650c20dbcc104 URL: https://github.com/llvm/llvm-project/commit/983565a6fe4a9f40c7caf82b65c650c20dbcc104 DIFF: https://github.com/llvm/llvm-project/commit/983565a6fe4a9f40c7caf82b65c650c20dbcc104.diff

[clang] 0a03144 - [PassBuilder] Don't use MemorySSA for standalone LoopRotate passes

2021-08-16 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-08-16T20:34:18+02:00 New Revision: 0a031449b2c757400090b23bd6ddf4d896d32643 URL: https://github.com/llvm/llvm-project/commit/0a031449b2c757400090b23bd6ddf4d896d32643 DIFF: https://github.com/llvm/llvm-project/commit/0a031449b2c757400090b23bd6ddf4d896d32643.diff

[clang] 570c9be - [MemorySSA] Remove unnecessary MSSA dependencies

2021-08-16 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-08-16T20:40:55+02:00 New Revision: 570c9beb8ebb4bdcc807101518cc36ad5e20797c URL: https://github.com/llvm/llvm-project/commit/570c9beb8ebb4bdcc807101518cc36ad5e20797c DIFF: https://github.com/llvm/llvm-project/commit/570c9beb8ebb4bdcc807101518cc36ad5e20797c.diff

[clang] fabc171 - [IRBuilder] Add type argument to CreateMaskedLoad/Gather

2021-07-04 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-07-04T12:17:59+02:00 New Revision: fabc17192ec1c43cb5f6e34eda3e1a55cd9c78f3 URL: https://github.com/llvm/llvm-project/commit/fabc17192ec1c43cb5f6e34eda3e1a55cd9c78f3 DIFF: https://github.com/llvm/llvm-project/commit/fabc17192ec1c43cb5f6e34eda3e1a55cd9c78f3.diff

[clang] 693251f - [CodeGen] Avoid CreateGEP with nullptr type (NFC)

2021-07-08 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-07-08T20:38:54+02:00 New Revision: 693251fb2f001ac06591ae7d1254be265d36c9c7 URL: https://github.com/llvm/llvm-project/commit/693251fb2f001ac06591ae7d1254be265d36c9c7 DIFF: https://github.com/llvm/llvm-project/commit/693251fb2f001ac06591ae7d1254be265d36c9c7.diff

[clang] a0ea367 - [CodeGen] Avoid nullptr arg to CreateStructGEP (NFC)

2021-07-08 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-07-08T21:21:43+02:00 New Revision: a0ea3675629a1aecc60326e5439d811956b0f92a URL: https://github.com/llvm/llvm-project/commit/a0ea3675629a1aecc60326e5439d811956b0f92a DIFF: https://github.com/llvm/llvm-project/commit/a0ea3675629a1aecc60326e5439d811956b0f92a.diff

[clang] ff8b1b1 - Reapply [IR] Don't mark mustprogress as type attribute

2021-07-09 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-07-09T20:57:44+02:00 New Revision: ff8b1b1b9caef57046bda1ca36c95f0e03527c6e URL: https://github.com/llvm/llvm-project/commit/ff8b1b1b9caef57046bda1ca36c95f0e03527c6e DIFF: https://github.com/llvm/llvm-project/commit/ff8b1b1b9caef57046bda1ca36c95f0e03527c6e.diff

[clang] 68e0133 - [CGBuilder] Remove type-less CreateAlignedLoad() APIs (NFC)

2021-03-11 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-03-11T10:41:23+01:00 New Revision: 68e01339cc5bc3d8a885bc9413611fbc6ca151e4 URL: https://github.com/llvm/llvm-project/commit/68e01339cc5bc3d8a885bc9413611fbc6ca151e4 DIFF: https://github.com/llvm/llvm-project/commit/68e01339cc5bc3d8a885bc9413611fbc6ca151e4.diff

[clang] 46354ba - [OpaquePtrs] Remove some uses of type-less CreateLoad APIs (NFC)

2021-03-11 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-03-11T14:40:57+01:00 New Revision: 46354bac76f60e988537181b3609a8e3ac89f523 URL: https://github.com/llvm/llvm-project/commit/46354bac76f60e988537181b3609a8e3ac89f523 DIFF: https://github.com/llvm/llvm-project/commit/46354bac76f60e988537181b3609a8e3ac89f523.diff

[clang] 42eb658 - [OpaquePtrs] Remove some uses of type-less CreateGEP() (NFC)

2021-03-12 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-03-12T21:01:16+01:00 New Revision: 42eb658f656c43ee63e25222f32acb86ad7b URL: https://github.com/llvm/llvm-project/commit/42eb658f656c43ee63e25222f32acb86ad7b DIFF: https://github.com/llvm/llvm-project/commit/42eb658f656c43ee63e25222f32acb86ad7b.diff

[clang] e0f70a8 - Revert "[AST] Add generator for source location introspection"

2021-03-14 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-03-14T17:05:08+01:00 New Revision: e0f70a8a979f5b843e90a0a20442ca79e2507208 URL: https://github.com/llvm/llvm-project/commit/e0f70a8a979f5b843e90a0a20442ca79e2507208 DIFF: https://github.com/llvm/llvm-project/commit/e0f70a8a979f5b843e90a0a20442ca79e2507208.diff

[clang] 40d5eea - Revert "Use VersionTuple for parsing versions in Triple. This makes it possible to distinguish between "16" and "16.0" after parsing, which previously was not possible."

2021-11-30 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2021-11-30T18:36:32+01:00 New Revision: 40d5eeac6cd89a2360c3ba997cbaa816abca828c URL: https://github.com/llvm/llvm-project/commit/40d5eeac6cd89a2360c3ba997cbaa816abca828c DIFF: https://github.com/llvm/llvm-project/commit/40d5eeac6cd89a2360c3ba997cbaa816abca828c.diff

[clang] 0cbf003 - [PowerPC] Fix check for ieeelongdouble support

2022-10-27 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-10-27T10:36:37+02:00 New Revision: 0cbf003c78cdba5cc81b69ee4cd6cee53f2e2796 URL: https://github.com/llvm/llvm-project/commit/0cbf003c78cdba5cc81b69ee4cd6cee53f2e2796 DIFF: https://github.com/llvm/llvm-project/commit/0cbf003c78cdba5cc81b69ee4cd6cee53f2e2796.diff

[clang] d785a8e - [clang] Remove CLANG_ENABLE_OPAQUE_POINTERS cmake option

2022-10-06 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-10-06T09:46:04+02:00 New Revision: d785a8eaa25dd1110dc7b24b16d3b21c9c179837 URL: https://github.com/llvm/llvm-project/commit/d785a8eaa25dd1110dc7b24b16d3b21c9c179837 DIFF: https://github.com/llvm/llvm-project/commit/d785a8eaa25dd1110dc7b24b16d3b21c9c179837.diff

[clang] 89810ce - [RelativeVTablesABI] Convert tests to opaque pointers (NFC)

2022-10-06 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-10-06T12:37:42+02:00 New Revision: 89810cee544db09fbf7d578c6e93db7a9cb0d9e5 URL: https://github.com/llvm/llvm-project/commit/89810cee544db09fbf7d578c6e93db7a9cb0d9e5 DIFF: https://github.com/llvm/llvm-project/commit/89810cee544db09fbf7d578c6e93db7a9cb0d9e5.diff

[clang] 956f7f2 - [CodeGenCXX] Remove typed pointer check lines from test (NFC)

2022-10-06 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-10-06T13:06:02+02:00 New Revision: 956f7f2b4f785271f7fde2a6ff83472d9451968f URL: https://github.com/llvm/llvm-project/commit/956f7f2b4f785271f7fde2a6ff83472d9451968f DIFF: https://github.com/llvm/llvm-project/commit/956f7f2b4f785271f7fde2a6ff83472d9451968f.diff

[clang] 01bbe87 - [CGStmt] Use helper functions to set memory attributes (NFC)

2022-10-12 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-10-12T16:38:39+02:00 New Revision: 01bbe87fbb66cad9193c97843b0dd20aa2bd24ae URL: https://github.com/llvm/llvm-project/commit/01bbe87fbb66cad9193c97843b0dd20aa2bd24ae DIFF: https://github.com/llvm/llvm-project/commit/01bbe87fbb66cad9193c97843b0dd20aa2bd24ae.diff

[clang] 6ce8727 - [cmake] Remove LLVM_INCLUDE_GO_TESTS variable

2022-10-14 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-10-14T16:34:36+02:00 New Revision: 6ce87272487711c9f0ff408a037f5ca2e1ff5c5d URL: https://github.com/llvm/llvm-project/commit/6ce87272487711c9f0ff408a037f5ca2e1ff5c5d DIFF: https://github.com/llvm/llvm-project/commit/6ce87272487711c9f0ff408a037f5ca2e1ff5c5d.diff

[clang] ebd9753 - [CodeGenOpenCLCXX] Convert tests to opaque pointers (NFC)

2023-01-05 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-01-05T11:03:15+01:00 New Revision: ebd97534e71aafaa637e466d700f66bbfa63d56b URL: https://github.com/llvm/llvm-project/commit/ebd97534e71aafaa637e466d700f66bbfa63d56b DIFF: https://github.com/llvm/llvm-project/commit/ebd97534e71aafaa637e466d700f66bbfa63d56b.diff

[clang] 6ebca03 - [Clang] Update test after wasm intrinsics attribute change (NFC)

2022-11-07 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-11-07T17:42:35+01:00 New Revision: 6ebca0302126c43ec8614d26aa444060e7a6da76 URL: https://github.com/llvm/llvm-project/commit/6ebca0302126c43ec8614d26aa444060e7a6da76 DIFF: https://github.com/llvm/llvm-project/commit/6ebca0302126c43ec8614d26aa444060e7a6da76.diff

[clang] fb6c130 - [LTO] Remove -lto-opaque-pointers flag

2023-01-25 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-01-25T12:18:50+01:00 New Revision: fb6c1300f23f249aa29eb6c5325aebc7d61d7345 URL: https://github.com/llvm/llvm-project/commit/fb6c1300f23f249aa29eb6c5325aebc7d61d7345 DIFF: https://github.com/llvm/llvm-project/commit/fb6c1300f23f249aa29eb6c5325aebc7d61d7345.diff

[clang] 5375b63 - [UTC] Add --version argument

2023-01-30 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-01-30T09:57:26+01:00 New Revision: 5375b638be874b5438e98bd8a435e198af3ef2d0 URL: https://github.com/llvm/llvm-project/commit/5375b638be874b5438e98bd8a435e198af3ef2d0 DIFF: https://github.com/llvm/llvm-project/commit/5375b638be874b5438e98bd8a435e198af3ef2d0.diff

[clang] 5f01a62 - [ConstantFold] Fix inbounds inference on mismatching source element type

2023-01-31 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-01-31T11:33:00+01:00 New Revision: 5f01a626dd0615df49773d419c75aeb33666ee83 URL: https://github.com/llvm/llvm-project/commit/5f01a626dd0615df49773d419c75aeb33666ee83 DIFF: https://github.com/llvm/llvm-project/commit/5f01a626dd0615df49773d419c75aeb33666ee83.diff

[clang] 0285656 - [Clang] Emit noundef metadata next to range metadata

2023-01-12 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-01-12T10:03:05+01:00 New Revision: 02856565ac12e21f14f2af64ce1135ecc3c2021f URL: https://github.com/llvm/llvm-project/commit/02856565ac12e21f14f2af64ce1135ecc3c2021f DIFF: https://github.com/llvm/llvm-project/commit/02856565ac12e21f14f2af64ce1135ecc3c2021f.diff

[clang] b164b04 - [Clang] Convert test to opaque pointers (NFC)

2023-01-17 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-01-17T10:08:57+01:00 New Revision: b164b047f2b41ff0c0a3ede3baa29c230c78cd32 URL: https://github.com/llvm/llvm-project/commit/b164b047f2b41ff0c0a3ede3baa29c230c78cd32 DIFF: https://github.com/llvm/llvm-project/commit/b164b047f2b41ff0c0a3ede3baa29c230c78cd32.diff

[clang] 6f258c0 - [Clang] Don't test register allocation

2022-06-23 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-06-23T12:46:00+02:00 New Revision: 6f258c0fd34cf4001ffa08c61f6e4e0f1254c50f URL: https://github.com/llvm/llvm-project/commit/6f258c0fd34cf4001ffa08c61f6e4e0f1254c50f DIFF: https://github.com/llvm/llvm-project/commit/6f258c0fd34cf4001ffa08c61f6e4e0f1254c50f.diff

[clang] 858e627 - [Clang] Always set opaque pointers mode

2022-05-31 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-05-31T15:43:05+02:00 New Revision: 858e6273d938cc4d08ee053ddff3fe7b19eb302a URL: https://github.com/llvm/llvm-project/commit/858e6273d938cc4d08ee053ddff3fe7b19eb302a DIFF: https://github.com/llvm/llvm-project/commit/858e6273d938cc4d08ee053ddff3fe7b19eb302a.diff

[clang] 30ad481 - Revert "cmake: use llvm dir variables for clang/utils/hmaptool"

2022-06-02 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2022-06-02T14:55:58+02:00 New Revision: 30ad481e87ca7cd2250bd5771ab66ddfe623eb10 URL: https://github.com/llvm/llvm-project/commit/30ad481e87ca7cd2250bd5771ab66ddfe623eb10 DIFF: https://github.com/llvm/llvm-project/commit/30ad481e87ca7cd2250bd5771ab66ddfe623eb10.diff

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

2023-09-19 Thread Nikita Popov via cfe-commits
nikic wrote: I think this is the right canonicalization at the IR level, as select allows better analysis than zext(icmp). However, this seems to be universally worse for the backend: https://llvm.godbolt.org/z/Yh7brfc8b So I think we would need an SDAG undo transform. Interestingly, this alre

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

2023-09-19 Thread Nikita Popov via cfe-commits
@@ -6309,7 +6309,69 @@ Instruction *InstCombinerImpl::foldICmpUsingBoolRange(ICmpInst &I) { Y->getType()->isIntOrIntVectorTy(1) && Pred == ICmpInst::ICMP_ULE) return BinaryOperator::CreateOr(Builder.CreateIsNull(X), Y); + ICmpInst::Predicate Pred1, Pred2; const

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

2023-09-24 Thread Nikita Popov via cfe-commits
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value *Op0, Value *Op1, return Constant::getNullValue(ReturnType); break; } + case Intrinsic::ptrmask: { +// Fail loudly in case this is ever changed. +// TODO: If vector types are s

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

2023-09-24 Thread Nikita Popov via cfe-commits
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value *Op0, Value *Op1, return Constant::getNullValue(ReturnType); break; } + case Intrinsic::ptrmask: { +// Fail loudly in case this is ever changed. +// TODO: If vector types are s

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

2023-09-24 Thread Nikita Popov via cfe-commits
@@ -1984,10 +1984,30 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) { //-> (ptrmask p, (and A, B)) if (match(Op0, m_OneUse(m_Intrinsic( m_Value(InnerPtr), m_Value(InnerMask) { + // See if combining the two masks is fre

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

2023-09-24 Thread Nikita Popov via cfe-commits
@@ -1985,6 +1985,28 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) { {InnerPtr, NewMask})); } } +bool Changed = false; +KnownBits Known = computeKnownBits(II, /*Depth*/ 0, II); +// See if we can deduce no

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

2023-09-24 Thread Nikita Popov via cfe-commits
@@ -1985,6 +1985,28 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) { {InnerPtr, NewMask})); } } +bool Changed = false; +KnownBits Known = computeKnownBits(II, /*Depth*/ 0, II); +// See if we can deduce no

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

2023-09-24 Thread Nikita Popov via cfe-commits
@@ -1985,6 +1985,28 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) { {InnerPtr, NewMask})); } } +bool Changed = false; +KnownBits Known = computeKnownBits(II, /*Depth*/ 0, II); +// See if we can deduce no

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

2023-09-24 Thread Nikita Popov via cfe-commits
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value *Op0, Value *Op1, return Constant::getNullValue(ReturnType); break; } + case Intrinsic::ptrmask: { +// Fail loudly in case this is ever changed. +// TODO: If vector types are s

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

2023-09-24 Thread Nikita Popov via cfe-commits
@@ -898,6 +910,53 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, } break; } + case Intrinsic::ptrmask: { +// Fail loudly in case this is ever changed. +// Likely not much needs to be changed here to

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

2023-09-24 Thread Nikita Popov via cfe-commits
@@ -6380,7 +6380,69 @@ Instruction *InstCombinerImpl::foldICmpUsingBoolRange(ICmpInst &I) { 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] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-09-24 Thread Nikita Popov via cfe-commits
@@ -6380,7 +6380,69 @@ Instruction *InstCombinerImpl::foldICmpUsingBoolRange(ICmpInst &I) { 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] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)

2023-09-26 Thread Nikita Popov via cfe-commits
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value *Op0, Value *Op1, return Constant::getNullValue(ReturnType); break; } + case Intrinsic::ptrmask: { +// Fail loudly in case this is ever changed. +// TODO: If vector types are s

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

2023-09-26 Thread Nikita Popov via cfe-commits
https://github.com/nikic resolved 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] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)

2023-09-26 Thread Nikita Popov via cfe-commits
https://github.com/nikic resolved 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] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)

2023-09-26 Thread Nikita Popov via cfe-commits
@@ -898,6 +910,53 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, } break; } + case Intrinsic::ptrmask: { +// Fail loudly in case this is ever changed. +// Likely not much needs to be changed here to

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

2023-09-26 Thread Nikita Popov via cfe-commits
https://github.com/nikic resolved 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] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)

2023-09-26 Thread Nikita Popov via cfe-commits
https://github.com/nikic resolved 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] [InstCombine] Add combines/simplifications for `llvm.ptrmask` (PR #67166)

2023-09-26 Thread Nikita Popov via cfe-commits
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value *Op0, Value *Op1, return Constant::getNullValue(ReturnType); break; } + case Intrinsic::ptrmask: { +// Fail loudly in case this is ever changed. +// TODO: If vector types are s

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

2023-09-26 Thread Nikita Popov via cfe-commits
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value *Op0, Value *Op1, return Constant::getNullValue(ReturnType); break; } + case Intrinsic::ptrmask: { +// Fail loudly in case this is ever changed. +// TODO: If vector types are s

[clang] [CodeGenPrepare] Transform ldexp into target supported intrinsics (PR #67552)

2023-09-27 Thread Nikita Popov via cfe-commits
nikic wrote: Why does this need special handling in CGP instead of being a normal custom lowering for FLDEXP? https://github.com/llvm/llvm-project/pull/67552 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [SCCP] [Transform] Adding ICMP folding for zext and sext in SCCPSolver (PR #67594)

2023-09-27 Thread Nikita Popov via cfe-commits
https://github.com/nikic requested changes to this pull request. If I understood correctly, what you're trying to do here is to apply an icmp fold early before the sext -> zext information gets lost. I don't think this is the correct way to approach the problem. The correct way is to preserve t

[clang] fb2bdbb - [CodeGen] Avoid use of ConstantExpr::getZExt() (NFC)

2023-09-28 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-09-28T16:45:31+02:00 New Revision: fb2bdbb83d3913d9d32b28c1de3f3d8b4e6dfc8a URL: https://github.com/llvm/llvm-project/commit/fb2bdbb83d3913d9d32b28c1de3f3d8b4e6dfc8a DIFF: https://github.com/llvm/llvm-project/commit/fb2bdbb83d3913d9d32b28c1de3f3d8b4e6dfc8a.diff

[clang] [CodeGen] Respect pointer-overflow sanitizer for void pointers (PR #67772)

2023-09-29 Thread Nikita Popov via cfe-commits
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/67772 Pointer arithmetic on void pointers (a GNU extension) was going through a different code path and bypassed the pointer-overflow sanitizer. Fixes https://github.com/llvm/llvm-project/issues/66451. >From ef96c971b50

[clang] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-09-29 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: Looks fine to me. https://github.com/llvm/llvm-project/pull/67788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-09-29 Thread Nikita Popov via cfe-commits
@@ -3732,14 +3732,18 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts, assert(Op.getResNo() == 0 && "We only compute knownbits for the difference here."); -// TODO: Compute influence of the carry operand. -if (Opcode ==

[clang-tools-extra] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-09-29 Thread Nikita Popov via cfe-commits
@@ -3732,14 +3732,18 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts, assert(Op.getResNo() == 0 && "We only compute knownbits for the difference here."); -// TODO: Compute influence of the carry operand. -if (Opcode ==

[clang] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

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

[clang-tools-extra] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

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

[clang] -fsanitize=alignment: check memcpy/memmove arguments (PR #67766)

2023-09-29 Thread Nikita Popov via cfe-commits
nikic wrote: Uh, why are we allowed to assume that memcpy pointer arguments are aligned? This looks like a miscompile to me. A plain `int *` pointer is not required to be aligned, and memcpy works on `void *` pointers, so I'm not sure where an alignment requirement would appear from. https:/

[clang] Introduce paged vector (PR #66430)

2023-09-30 Thread Nikita Popov via cfe-commits
nikic wrote: Looks like this causes a compile-time regression: https://llvm-compile-time-tracker.com/compare.php?from=abcaebfe3aacb13d46be5e949fd6ed9b4321e2f6&to=4ae51570806ba5c5fcabe6d6dcbe52e3a5d5453b&stat=instructions%3Au About 0.5% at `O0`. https://github.com/llvm/llvm-project/pull/66430 _

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

2023-09-30 Thread Nikita Popov via cfe-commits
@@ -6380,7 +6380,71 @@ Instruction *InstCombinerImpl::foldICmpUsingBoolRange(ICmpInst &I) { 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-tools-extra] [InstCombine] Simplify the pattern `a ne/eq (zext/sext (a ne/eq c))` (PR #65852)

2023-09-30 Thread Nikita Popov via cfe-commits
@@ -6380,7 +6380,71 @@ Instruction *InstCombinerImpl::foldICmpUsingBoolRange(ICmpInst &I) { 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] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-10-01 Thread Nikita Popov via cfe-commits
@@ -3732,14 +3732,18 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts, assert(Op.getResNo() == 0 && "We only compute knownbits for the difference here."); -// TODO: Compute influence of the carry operand. -if (Opcode ==

[libunwind] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-10-01 Thread Nikita Popov via cfe-commits
@@ -3732,14 +3732,18 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts, assert(Op.getResNo() == 0 && "We only compute knownbits for the difference here."); -// TODO: Compute influence of the carry operand. -if (Opcode ==

[clang-tools-extra] [Support] Add KnownBits::computeForSubBorrow (PR #67788)

2023-10-01 Thread Nikita Popov via cfe-commits
@@ -3732,14 +3732,18 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts, assert(Op.getResNo() == 0 && "We only compute knownbits for the difference here."); -// TODO: Compute influence of the carry operand. -if (Opcode ==

[clang] 3b25407 - [IR] Mark zext/sext constant expressions as undesirable

2023-10-02 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-10-02T12:40:20+02:00 New Revision: 3b25407d977d9ed3dbcaccd4f8850b65e95d70fd URL: https://github.com/llvm/llvm-project/commit/3b25407d977d9ed3dbcaccd4f8850b65e95d70fd DIFF: https://github.com/llvm/llvm-project/commit/3b25407d977d9ed3dbcaccd4f8850b65e95d70fd.diff

[clang] [Inliner] Improve propagation of return attributes. (PR #67756)

2023-10-02 Thread Nikita Popov via cfe-commits
nikic wrote: For the clang tests you've split, the `.c` versions still have `defined(__cplusplus)` checks, which doesn't make much sense. Though I think we might be better off passing `-no-enable-noundef-analysis` to these tests, as noundef is really not what they want to test. https://github

[clang] [Inliner] Improve propagation of return attributes. (PR #67756)

2023-10-02 Thread Nikita Popov via cfe-commits
nikic wrote: Apart from that, the functional changes themselves look good to me. https://github.com/llvm/llvm-project/pull/67756 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Introduce paged vector (PR #66430)

2023-10-02 Thread Nikita Popov via cfe-commits
nikic wrote: > I also noticed that LoadedSLocEntryTable uses 42 elements tables, which > probably introduces some extra divisions to do the indexing. I can try > switching to 32 elements. I've tested the following change that forces power of two pages sizes, but it did not have any impact: h

[clang] -fsanitize=alignment: check memcpy/memmove arguments (PR #67766)

2023-10-02 Thread Nikita Popov via cfe-commits
nikic wrote: @zygoloid Thanks for the explanation! I wasn't aware this fell under unspecified behavior. It's weird that alignment information can survive a `void *` cast, but it does make some sense. What seems worrying here is that apparently GCC and Clang do not agree on semantics in this c

[clang] [Inliner] Improve propagation of return attributes. (PR #67756)

2023-10-03 Thread Nikita Popov via cfe-commits
nikic wrote: It looks like x86-bswap.c still has the C++ guarded code in it. Any thoughts on > Though I think we might be better off passing `-no-enable-noundef-analysis` > to these tests, as noundef is really not what they want to test. to avoid the test duplication? https://github.com/llvm

[clang] [Inliner] Improve propagation of return attributes. (PR #67756)

2023-10-03 Thread Nikita Popov via cfe-commits
nikic wrote: (Another alternative would be to use different check-prefixes for C/C++) https://github.com/llvm/llvm-project/pull/67756 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Inliner] Improve propagation of return attributes. (PR #67756)

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

[clang] [CodeGen] Respect pointer-overflow sanitizer for void pointers (PR #67772)

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

[clang] [Clang][Driver] Add new flags to control IR verification (PR #68172)

2023-10-04 Thread Nikita Popov via cfe-commits
@@ -146,6 +146,13 @@ Non-comprehensive list of changes in this release New Compiler Flags -- +* ``-fverify-intermediate-code`` and it's complement ``-fno-verify-intermediate-code``. + Enables or disables verification of the generated LLVM IR. + It's strongly

[clang] [Clang][Driver] Add new flags to control IR verification (PR #68172)

2023-10-04 Thread Nikita Popov via cfe-commits
@@ -146,6 +146,13 @@ Non-comprehensive list of changes in this release New Compiler Flags -- +* ``-fverify-intermediate-code`` and it's complement ``-fno-verify-intermediate-code``. + Enables or disables verification of the generated LLVM IR. + It's strongly

[clang] [Clang][Driver] Add new flags to control IR verification (PR #68172)

2023-10-04 Thread Nikita Popov via cfe-commits
@@ -146,6 +146,13 @@ Non-comprehensive list of changes in this release New Compiler Flags -- +* ``-fverify-intermediate-code`` and it's complement ``-fno-verify-intermediate-code``. + Enables or disables verification of the generated LLVM IR. + It's strongly

[clang] llvm-canon (PR #68176)

2023-10-05 Thread Nikita Popov via cfe-commits
nikic wrote: Please don't use the term canon/canonicalize for this pass or tool. LLVM has an existing notion of "canonicalization" which does coincide with what is being done here. https://github.com/llvm/llvm-project/pull/68176 ___ cfe-commits maili

[clang] [clang] Replace uses of CreatePointerBitCastOrAddrSpaceCast (NFC) (PR #68277)

2023-10-05 Thread Nikita Popov via cfe-commits
@@ -2138,6 +2138,8 @@ class IRBuilderBase { return Insert(CastInst::CreatePointerCast(V, DestTy), Name); } + // With opaque pointers enabled, this is same as CreateAddressSpaceCast. nikic wrote: All the IRBuilder cast methods are no-ops if old type ==

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

2023-10-05 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. Basically LGTM, but I think this is still missing negative tests for non-equality pred1/pred2? https://github.com/llvm/llvm-project/pull/65852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2023-10-05 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. Basically LGTM, but I think this is still missing negative tests for non-equality pred1/pred2? https://github.com/llvm/llvm-project/pull/65852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] f8a36d8 - [IR] Mark add constant expressions as undesirable

2023-07-20 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-07-20T15:24:19+02:00 New Revision: f8a36d8c3e264c4fccf8058e699201a452ea7bb7 URL: https://github.com/llvm/llvm-project/commit/f8a36d8c3e264c4fccf8058e699201a452ea7bb7 DIFF: https://github.com/llvm/llvm-project/commit/f8a36d8c3e264c4fccf8058e699201a452ea7bb7.diff

[clang] 9dc391e - Revert "[IR] Mark add constant expressions as undesirable"

2023-07-20 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-07-20T18:09:17+02:00 New Revision: 9dc391e89c7984394e352ea1cbf948b4bbdcd8a8 URL: https://github.com/llvm/llvm-project/commit/9dc391e89c7984394e352ea1cbf948b4bbdcd8a8 DIFF: https://github.com/llvm/llvm-project/commit/9dc391e89c7984394e352ea1cbf948b4bbdcd8a8.diff

[clang] 9dc391e - Revert "[IR] Mark add constant expressions as undesirable"

2023-07-20 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-07-20T18:09:17+02:00 New Revision: 9dc391e89c7984394e352ea1cbf948b4bbdcd8a8 URL: https://github.com/llvm/llvm-project/commit/9dc391e89c7984394e352ea1cbf948b4bbdcd8a8 DIFF: https://github.com/llvm/llvm-project/commit/9dc391e89c7984394e352ea1cbf948b4bbdcd8a8.diff

[clang] 086ee99 - Reapply [IR] Mark and constant expressions as undesirable

2023-07-21 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-07-21T10:10:50+02:00 New Revision: 086ee99564afbb11449c08ea2e094f7f49fadde5 URL: https://github.com/llvm/llvm-project/commit/086ee99564afbb11449c08ea2e094f7f49fadde5 DIFF: https://github.com/llvm/llvm-project/commit/086ee99564afbb11449c08ea2e094f7f49fadde5.diff

[clang] 0cab8d2 - Reapply [IR] Mark and/or constant expressions as undesirable

2023-07-25 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-07-25T15:31:45+02:00 New Revision: 0cab8d20417c0e2ccc1ffc5505e080126f5de8e6 URL: https://github.com/llvm/llvm-project/commit/0cab8d20417c0e2ccc1ffc5505e080126f5de8e6 DIFF: https://github.com/llvm/llvm-project/commit/0cab8d20417c0e2ccc1ffc5505e080126f5de8e6.diff

[clang] fa1b6e6 - [X86] Fix i128 argument passing under SysV ABI

2023-08-21 Thread Nikita Popov via cfe-commits
Author: Nikita Popov Date: 2023-08-21T11:44:35+02:00 New Revision: fa1b6e6b34eb6382c451f3a06a7c52d7ac6ada1d URL: https://github.com/llvm/llvm-project/commit/fa1b6e6b34eb6382c451f3a06a7c52d7ac6ada1d DIFF: https://github.com/llvm/llvm-project/commit/fa1b6e6b34eb6382c451f3a06a7c52d7ac6ada1d.diff

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

2023-10-06 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: Seems like some test coverage is missing here? * Commuted add * Commuted sub (negative test) * Commuted and * Multi-use add (negative test) https://github.com/llvm/llvm-project/pull/67915 ___ cfe-commits mailing

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

2023-10-06 Thread Nikita Popov via cfe-commits
nikic wrote: Can you please pre-commit the new tests as well (and double-check that there is no unexpected operand order canonicalization while doing that)? https://github.com/llvm/llvm-project/pull/67915 ___ cfe-commits mailing list cfe-commits@lists

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

2023-10-06 Thread Nikita Popov via cfe-commits
nikic wrote: Looks like incorrect conflict resolution in the last merge. 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-06 Thread Nikita Popov via cfe-commits
nikic wrote: Looks like incorrect conflict resolution in the last merge. 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-06 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. Yeah, it looks 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 Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. Yeah, it looks 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-tools-extra] llvm-canon (PR #68176)

2023-10-09 Thread Nikita Popov via cfe-commits
nikic wrote: Using the term for MIR is okay, because it does not have a pre-existing notion of canonical form. Doing the same for IR is not okay, because it already has a canonical form and this pass does not produce it. Calling this `ir-normalizer` instead of `ir-canonicalizer` should convey

[clang] llvm-canon (PR #68176)

2023-10-09 Thread Nikita Popov via cfe-commits
nikic wrote: Using the term for MIR is okay, because it does not have a pre-existing notion of canonical form. Doing the same for IR is not okay, because it already has a canonical form and this pass does not produce it. Calling this `ir-normalizer` instead of `ir-canonicalizer` should convey

[clang] Clean up strange uses of getAnalysisIfAvailable (PR #65729)

2023-10-11 Thread Nikita Popov via cfe-commits
nikic wrote: > GVN seems to have different behavior regarding LoopInfo in the LegacyPM and > NewPM, but that's an orthogonal issue. I'll check whether always requiring > LoopInfo in GVN has any compile-time impact, as I don't think this is > supposed to be an optional analysis there (otherwise

<    1   2   3   4   5   6   7   8   9   10   >