Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

bcl5980 (chenglin.bi)
User

Projects

User does not belong to any projects.

User Details

User Since
Mar 2 2022, 11:13 PM (82 w, 3 d)

Recent Activity

Jul 13 2023

bcl5980 abandoned D154470: [AMDGPU] Fix ISD perm compute known bits wrong..

I'm sorry I have no time to continue this work. So I will abandon this. Anyone who want to continue work on this is fine.

Jul 13 2023, 12:09 AM · Restricted Project, Restricted Project

Jul 4 2023

bcl5980 requested review of D154470: [AMDGPU] Fix ISD perm compute known bits wrong..
Jul 4 2023, 9:05 PM · Restricted Project, Restricted Project

Jun 25 2023

bcl5980 added inline comments to D153660: [ConstraintElim] Track and simplify conditions at use..
Jun 25 2023, 10:23 PM · Restricted Project, Restricted Project

Apr 23 2023

bcl5980 added inline comments to D148710: [DAGCombiner] Hoist add/sub binop w/ constant op only if it won't increase divergency node.
Apr 23 2023, 4:33 AM · Restricted Project, Restricted Project

Apr 21 2023

bcl5980 added inline comments to D148710: [DAGCombiner] Hoist add/sub binop w/ constant op only if it won't increase divergency node.
Apr 21 2023, 10:19 AM · Restricted Project, Restricted Project
bcl5980 updated the diff for D147118: [ValueTracking] Use dominate tree to get dominate predecessor condtion.

address comments.

Apr 21 2023, 1:25 AM · Restricted Project, Restricted Project

Apr 20 2023

bcl5980 updated the diff for D148710: [DAGCombiner] Hoist add/sub binop w/ constant op only if it won't increase divergency node.
Apr 20 2023, 3:43 PM · Restricted Project, Restricted Project
bcl5980 added inline comments to D148710: [DAGCombiner] Hoist add/sub binop w/ constant op only if it won't increase divergency node.
Apr 20 2023, 3:36 PM · Restricted Project, Restricted Project
bcl5980 added inline comments to D148710: [DAGCombiner] Hoist add/sub binop w/ constant op only if it won't increase divergency node.
Apr 20 2023, 5:26 AM · Restricted Project, Restricted Project
bcl5980 added inline comments to D148210: [InstCombine] Reassociate (C * X) * Y in foldICmpMulConstant.
Apr 20 2023, 5:18 AM · Restricted Project, Restricted Project
bcl5980 added inline comments to D148710: [DAGCombiner] Hoist add/sub binop w/ constant op only if it won't increase divergency node.
Apr 20 2023, 5:02 AM · Restricted Project, Restricted Project
bcl5980 added inline comments to D148710: [DAGCombiner] Hoist add/sub binop w/ constant op only if it won't increase divergency node.
Apr 20 2023, 4:32 AM · Restricted Project, Restricted Project
bcl5980 added inline comments to D148210: [InstCombine] Reassociate (C * X) * Y in foldICmpMulConstant.
Apr 20 2023, 1:18 AM · Restricted Project, Restricted Project

Apr 19 2023

bcl5980 added inline comments to D148210: [InstCombine] Reassociate (C * X) * Y in foldICmpMulConstant.
Apr 19 2023, 5:09 PM · Restricted Project, Restricted Project
bcl5980 added reviewers for D148710: [DAGCombiner] Hoist add/sub binop w/ constant op only if it won't increase divergency node: arsenm, rampitec.
Apr 19 2023, 4:08 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D148710: [DAGCombiner] Hoist add/sub binop w/ constant op only if it won't increase divergency node.

update test result.

Apr 19 2023, 4:07 PM · Restricted Project, Restricted Project
bcl5980 added a comment to D148463: [AMDGPU] Ressociate patterns with sub to use SALU.

Did you find what DAG transformation undoes this? It might be better to tweak that one instead.

Apr 19 2023, 4:04 PM · Restricted Project, Restricted Project
bcl5980 added a comment to D148710: [DAGCombiner] Hoist add/sub binop w/ constant op only if it won't increase divergency node.

This is a general solution for regression of D148463.

Apr 19 2023, 5:50 AM · Restricted Project, Restricted Project
bcl5980 requested review of D148710: [DAGCombiner] Hoist add/sub binop w/ constant op only if it won't increase divergency node.
Apr 19 2023, 5:49 AM · Restricted Project, Restricted Project
bcl5980 reopened D148463: [AMDGPU] Ressociate patterns with sub to use SALU.
Apr 19 2023, 4:41 AM · Restricted Project, Restricted Project
bcl5980 added a comment to D147118: [ValueTracking] Use dominate tree to get dominate predecessor condtion.

Ping.

Apr 19 2023, 2:24 AM · Restricted Project, Restricted Project

Apr 18 2023

bcl5980 updated the diff for D148463: [AMDGPU] Ressociate patterns with sub to use SALU.

rebase the code

Apr 18 2023, 8:18 PM · Restricted Project, Restricted Project
bcl5980 added a comment to D148463: [AMDGPU] Ressociate patterns with sub to use SALU.

I have already revert it on rG9356097206a17
Can someone help to review the new patch?

Apr 18 2023, 8:16 PM · Restricted Project, Restricted Project
bcl5980 added a reverting change for rGb3529b5bf3ba: [AMDGPU] Ressociate patterns with sub to use SALU: rG9356097206a1: Revert "[AMDGPU] Ressociate patterns with sub to use SALU".
Apr 18 2023, 8:15 PM · Restricted Project, Restricted Project
bcl5980 committed rG9356097206a1: Revert "[AMDGPU] Ressociate patterns with sub to use SALU" (authored by bcl5980).
Revert "[AMDGPU] Ressociate patterns with sub to use SALU"
Apr 18 2023, 8:15 PM · Restricted Project, Restricted Project
bcl5980 added a reverting change for D148463: [AMDGPU] Ressociate patterns with sub to use SALU: rG9356097206a1: Revert "[AMDGPU] Ressociate patterns with sub to use SALU".
Apr 18 2023, 8:15 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D148463: [AMDGPU] Ressociate patterns with sub to use SALU.

limit the optimization to non-constant value to workaround dead loop.

Apr 18 2023, 8:12 PM · Restricted Project, Restricted Project

Apr 17 2023

bcl5980 added inline comments to D148210: [InstCombine] Reassociate (C * X) * Y in foldICmpMulConstant.
Apr 17 2023, 10:55 PM · Restricted Project, Restricted Project
bcl5980 added inline comments to D148210: [InstCombine] Reassociate (C * X) * Y in foldICmpMulConstant.
Apr 17 2023, 10:52 PM · Restricted Project, Restricted Project
bcl5980 committed rGb3529b5bf3ba: [AMDGPU] Ressociate patterns with sub to use SALU (authored by bcl5980).
[AMDGPU] Ressociate patterns with sub to use SALU
Apr 17 2023, 3:50 PM · Restricted Project, Restricted Project
bcl5980 closed D148463: [AMDGPU] Ressociate patterns with sub to use SALU.
Apr 17 2023, 3:49 PM · Restricted Project, Restricted Project

Apr 16 2023

bcl5980 retitled D148463: [AMDGPU] Ressociate patterns with sub to use SALU from [AMDGPU] Ressociate sub + add/ sub + sub to use SALU to [AMDGPU] Ressociate patterns with sub to use SALU.
Apr 16 2023, 4:43 AM · Restricted Project, Restricted Project
bcl5980 requested review of D148463: [AMDGPU] Ressociate patterns with sub to use SALU.
Apr 16 2023, 4:42 AM · Restricted Project, Restricted Project

Apr 15 2023

bcl5980 updated the diff for D147118: [ValueTracking] Use dominate tree to get dominate predecessor condtion.

rebase precommit tests.

Apr 15 2023, 1:16 AM · Restricted Project, Restricted Project
bcl5980 committed rG2a7e1a132dff: [InstSimplify] Precommit tests for dominate conditions are not single… (authored by bcl5980).
[InstSimplify] Precommit tests for dominate conditions are not single…
Apr 15 2023, 1:13 AM · Restricted Project, Restricted Project

Apr 14 2023

bcl5980 updated the summary of D147118: [ValueTracking] Use dominate tree to get dominate predecessor condtion.
Apr 14 2023, 7:32 PM · Restricted Project, Restricted Project
bcl5980 added inline comments to D147118: [ValueTracking] Use dominate tree to get dominate predecessor condtion.
Apr 14 2023, 7:25 PM · Restricted Project, Restricted Project
bcl5980 updated the summary of D147118: [ValueTracking] Use dominate tree to get dominate predecessor condtion.
Apr 14 2023, 2:36 AM · Restricted Project, Restricted Project
bcl5980 updated the diff for D147118: [ValueTracking] Use dominate tree to get dominate predecessor condtion.

rebase code

Apr 14 2023, 1:47 AM · Restricted Project, Restricted Project
bcl5980 updated the diff for D147118: [ValueTracking] Use dominate tree to get dominate predecessor condtion.
Apr 14 2023, 1:42 AM · Restricted Project, Restricted Project

Apr 13 2023

bcl5980 added a comment to D148275: [InstCombine] support fold select(X|Y,X|Y,X) to X|Y.

We can extend it to and also:

Apr 13 2023, 7:55 PM · Restricted Project, Restricted Project
bcl5980 added a comment to D145846: [InstCombine] enhance icmp with sub folds.

How about this pattern ?
https://alive2.llvm.org/ce/z/Y-Po8g
Also reduce one usage but it works for any minuend.

Apr 13 2023, 6:59 PM · Restricted Project, Restricted Project

Apr 12 2023

bcl5980 added inline comments to D147597: [InstCombine] icmp(X | OrC, C) --> icmp(X, 0).
Apr 12 2023, 9:45 PM · Restricted Project, Restricted Project

Apr 11 2023

bcl5980 added a comment to D147597: [InstCombine] icmp(X | OrC, C) --> icmp(X, 0).

Maybe we need two more tests here:

  1. Not one-use test .
  2. Vector test with poison constant.
Apr 11 2023, 11:15 PM · Restricted Project, Restricted Project

Mar 30 2023

bcl5980 updated the diff for D147118: [ValueTracking] Use dominate tree to get dominate predecessor condtion.
Mar 30 2023, 7:44 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D147118: [ValueTracking] Use dominate tree to get dominate predecessor condtion.
Mar 30 2023, 6:07 AM · Restricted Project, Restricted Project

Mar 29 2023

bcl5980 requested review of D147118: [ValueTracking] Use dominate tree to get dominate predecessor condtion.
Mar 29 2023, 12:22 AM · Restricted Project, Restricted Project

Mar 15 2023

bcl5980 added a comment to D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

If no one have any further comments I will abandon this serial patches. It looks it can't improve too much.

Mar 15 2023, 2:02 AM · Restricted Project, Restricted Project
bcl5980 committed rGd99d765fc07e: [InstCombine] Remove one-use limit when it can simplify to a const in the… (authored by bcl5980).
[InstCombine] Remove one-use limit when it can simplify to a const in the…
Mar 15 2023, 1:58 AM · Restricted Project, Restricted Project
bcl5980 committed rG06afee248973: [InstCombine] Precommit tests for one-use check in icmp-range; NFC (authored by bcl5980).
[InstCombine] Precommit tests for one-use check in icmp-range; NFC
Mar 15 2023, 1:58 AM · Restricted Project, Restricted Project
bcl5980 added a comment to D145772: [Instcombine] Canonicalize all <=> patterns to (a>b)-(a<b).

I think it's long overdue to canonicalize three-way comparisons in some way. Looking at asm for different backends, it does look like this representation is pretty much universally better than the select form. I'm less sure whether this is ideal for middle-end optimization.

Something I'm wondering is whether it might make sense to recognize this as a first-class pattern and actually introduce an iN @llvm.compare.iN.iM(iM %a, iM %b) intrinsic for this purpose.

Mar 15 2023, 12:50 AM · Restricted Project, Restricted Project

Mar 14 2023

bcl5980 abandoned D143363: [ValueTracking] Search dominate condition to check if a value is pow2 or not.
Mar 14 2023, 10:47 PM · Restricted Project, Restricted Project
bcl5980 abandoned D144373: [LogicCombine 5/?] Fold constant in logical expression.
Mar 14 2023, 10:47 PM · Restricted Project, Restricted Project
bcl5980 abandoned D144077: [LogicCombine 4/?] Support combine xor chain with 2 elements.
Mar 14 2023, 10:47 PM · Restricted Project, Restricted Project
bcl5980 abandoned D143155: [LogicCombine 3/?] Add i1 select instruction support.
Mar 14 2023, 10:47 PM · Restricted Project, Restricted Project
bcl5980 abandoned D143046: [LogicCombine 2/?] Add weight into node then use it to determine if we can combine the case need to create new value..
Mar 14 2023, 10:46 PM · Restricted Project, Restricted Project
bcl5980 added a comment to D145772: [Instcombine] Canonicalize all <=> patterns to (a>b)-(a<b).

Was this abandoned because it breaks some of the existing optimizations? For the record, this is how the compare-3way.ll test diff looks like: https://gist.github.com/nikic/056516a0d621f9ca69059d05eef7e7b2

Mar 14 2023, 6:09 PM · Restricted Project, Restricted Project

Mar 13 2023

bcl5980 abandoned D145772: [Instcombine] Canonicalize all <=> patterns to (a>b)-(a<b).
Mar 13 2023, 11:45 PM · Restricted Project, Restricted Project
bcl5980 added a comment to D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

And my question was not answered before commit.

This leads me to the question how ofter this fires in llvm test suite / SPEC / clang bootstrap? Is it worth it?

Mar 13 2023, 6:12 PM · Restricted Project, Restricted Project
bcl5980 added a reverting change for rG97dcbea63e11: [LogicCombine 1/?] Implement a general way to simplify logical operations.: rG76df706bca14: Revert "[LogicCombine 1/?] Implement a general way to simplify logical….
Mar 13 2023, 6:00 PM · Restricted Project, Restricted Project
bcl5980 added a comment to D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

any other coments for the initial patch? @nikic

I think it would be better to have approvals for all patches and commit this all at once. Otherwise we might end up with nontrivial unfinished code.

Mar 13 2023, 6:00 PM · Restricted Project, Restricted Project
bcl5980 committed rG76df706bca14: Revert "[LogicCombine 1/?] Implement a general way to simplify logical… (authored by bcl5980).
Revert "[LogicCombine 1/?] Implement a general way to simplify logical…
Mar 13 2023, 6:00 PM · Restricted Project, Restricted Project
bcl5980 added a reverting change for D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations.: rG76df706bca14: Revert "[LogicCombine 1/?] Implement a general way to simplify logical….
Mar 13 2023, 6:00 PM · Restricted Project, Restricted Project

Mar 10 2023

bcl5980 requested review of D145772: [Instcombine] Canonicalize all <=> patterns to (a>b)-(a<b).
Mar 10 2023, 1:19 AM · Restricted Project, Restricted Project
bcl5980 committed rGbf00eda69f4b: [InstCombine] Add precommit tests for strong order compare patterns; NFC (authored by bcl5980).
[InstCombine] Add precommit tests for strong order compare patterns; NFC
Mar 10 2023, 12:59 AM · Restricted Project, Restricted Project

Mar 6 2023

bcl5980 updated the diff for D143155: [LogicCombine 3/?] Add i1 select instruction support.

rebase

Mar 6 2023, 5:32 PM · Restricted Project, Restricted Project

Mar 5 2023

bcl5980 added a comment to D143046: [LogicCombine 2/?] Add weight into node then use it to determine if we can combine the case need to create new value..

Ping.

Mar 5 2023, 11:23 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D143046: [LogicCombine 2/?] Add weight into node then use it to determine if we can combine the case need to create new value..
Mar 5 2023, 11:23 PM · Restricted Project, Restricted Project

Mar 3 2023

bcl5980 added inline comments to D145208: [COFF] Add MC support for emitting IMAGE_WEAK_EXTERN_ANTI_DEPENDENCY symbols.
Mar 3 2023, 12:06 AM · Restricted Project, Restricted Project

Mar 2 2023

bcl5980 committed rG97dcbea63e11: [LogicCombine 1/?] Implement a general way to simplify logical operations. (authored by bcl5980).
[LogicCombine 1/?] Implement a general way to simplify logical operations.
Mar 2 2023, 4:46 AM · Restricted Project, Restricted Project
bcl5980 closed D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..
Mar 2 2023, 4:46 AM · Restricted Project, Restricted Project

Feb 28 2023

bcl5980 added inline comments to D144838: [SCCP] Correct the made changes behavior.
Feb 28 2023, 3:04 AM · Restricted Project, Restricted Project
bcl5980 added a comment to D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

any other coments for the initial patch? @nikic

Feb 28 2023, 2:26 AM · Restricted Project, Restricted Project
bcl5980 abandoned D144838: [SCCP] Correct the made changes behavior.
Feb 28 2023, 2:25 AM · Restricted Project, Restricted Project

Feb 27 2023

bcl5980 added a comment to D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

with this patch, would it possible to remove some similar optimizations from instcombine, those being subsumed by this?

Feb 27 2023, 10:28 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D144838: [SCCP] Correct the made changes behavior.
Feb 27 2023, 5:17 PM · Restricted Project, Restricted Project

Feb 26 2023

bcl5980 updated the diff for D143155: [LogicCombine 3/?] Add i1 select instruction support.
Feb 26 2023, 10:16 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D143046: [LogicCombine 2/?] Add weight into node then use it to determine if we can combine the case need to create new value..
Feb 26 2023, 10:15 PM · Restricted Project, Restricted Project
bcl5980 added a comment to D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

I'm concerned about the caching here. It looks like you reuse one LogicCombiner instance for a basic block. However, isn't it possible for some of the instructions that have been inserted into LogicalOpNodes to be deleted, in which case the map may contain dangling pointers. If the pointer is reused by a newly allocated instruction, the cached information will be incorrect.

The main reason for caching is saving compile time. The new patch will remove all the instructions already inserted into the caches and I think functional it works now.
@nikic @spatel if possible can we use the llvm-compile-time-track to test how much compile time increase if we enable the LogicCombiner for every single instruction?

If this -- https://github.com/llvm/llvm-project/commit/efcf6c2b1f8490a9258d40abb90b21da60a15919 -- is the experiment that you wanted to try, it seems to have no significant difference:
https://llvm-compile-time-tracker.com/compare.php?from=3592d05438acc1034905feff7ff555f4fd4c5774&to=efcf6c2b1f8490a9258d40abb90b21da60a15919&stat=instructions:u

Feb 26 2023, 8:56 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

remove leafmask

Feb 26 2023, 8:50 PM · Restricted Project, Restricted Project
bcl5980 requested review of D144838: [SCCP] Correct the made changes behavior.
Feb 26 2023, 8:20 PM · Restricted Project, Restricted Project

Feb 23 2023

bcl5980 abandoned D144071: [ComplexLogicCombine] test result for all tests on the transform.
Feb 23 2023, 7:50 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D144373: [LogicCombine 5/?] Fold constant in logical expression.

rebase

Feb 23 2023, 7:43 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D144077: [LogicCombine 4/?] Support combine xor chain with 2 elements.
Feb 23 2023, 7:42 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D143155: [LogicCombine 3/?] Add i1 select instruction support.

rebase

Feb 23 2023, 7:41 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D143046: [LogicCombine 2/?] Add weight into node then use it to determine if we can combine the case need to create new value..

rebase

Feb 23 2023, 7:41 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

code clean

Feb 23 2023, 7:05 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

minor bug fix.

Feb 23 2023, 7:00 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

use SpecificBumpPtrAllocator

Feb 23 2023, 6:30 PM · Restricted Project, Restricted Project
bcl5980 added a comment to D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

I'm concerned about the caching here. It looks like you reuse one LogicCombiner instance for a basic block. However, isn't it possible for some of the instructions that have been inserted into LogicalOpNodes to be deleted, in which case the map may contain dangling pointers. If the pointer is reused by a newly allocated instruction, the cached information will be incorrect.

Feb 23 2023, 5:58 PM · Restricted Project, Restricted Project
bcl5980 added inline comments to D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..
Feb 23 2023, 5:50 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

Address comments.

Feb 23 2023, 5:50 PM · Restricted Project, Restricted Project
bcl5980 added a comment to D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

I need LeafValues to access value by index. It looks SmallSetVector can't do that.

SmallSetVector allows indexing. This is the patch I tried after applying this patch (I had to fix line endings first), and no tests fail:

diff --git a/llvm/include/llvm/Analysis/LogicCombine.h b/llvm/include/llvm/Analysis/LogicCombine.h
index 3fdcf7998321..56a3d8f36b16 100644
--- a/llvm/include/llvm/Analysis/LogicCombine.h
+++ b/llvm/include/llvm/Analysis/LogicCombine.h
@@ -8,8 +8,7 @@

 #include "LogicalExpr.h"
 #include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/IR/Instruction.h"
@@ -50,8 +49,7 @@ private:
   friend class LogicalOpNode;

   SmallDenseMap<Value *, LogicalOpNode *, 16> LogicalOpNodes;
-  SmallPtrSet<Value *, 8> LeafSet;
-  SmallVector<Value *, 8> LeafValues;
+  SmallSetVector<Value *, 8> LeafValues;

   void clear();

diff --git a/llvm/lib/Analysis/LogicCombine.cpp b/llvm/lib/Analysis/LogicCombine.cpp
index 28d9488cab96..3b410cdacd32 100644
--- a/llvm/lib/Analysis/LogicCombine.cpp
+++ b/llvm/lib/Analysis/LogicCombine.cpp
@@ -101,17 +101,16 @@ void LogicCombiner::clear() {
   for (auto node : LogicalOpNodes)
     delete node.second;
   LogicalOpNodes.clear();
-  LeafSet.clear();
   LeafValues.clear();
 }

 LogicalOpNode *LogicCombiner::visitLeafNode(Value *Val, unsigned Depth) {
   // Depth is 0 means the root is not logical operation. We can't
   // do anything for that.
-  if (Depth == 0 || LeafSet.size() >= MaxLogicOpLeafsToScan)
+  if (Depth == 0 || LeafValues.size() >= MaxLogicOpLeafsToScan)
     return nullptr;

-  uint64_t ExprVal = 1ULL << LeafSet.size();
+  uint64_t ExprVal = 1ULL << LeafValues.size();
   // Constant Zero,AllOne are special leaf nodes. They involve
   // LogicalExpr's calculation so we must detect them at first.
   if (auto ConstVal = dyn_cast<ConstantInt>(Val)) {
@@ -120,9 +119,8 @@ LogicalOpNode *LogicCombiner::visitLeafNode(Value *Val, unsigned Depth) {
     else if (ConstVal->isAllOnesValue())
       ExprVal = LogicalExpr::ExprAllOne;
   }
-  if (ExprVal != LogicalExpr::ExprAllOne && ExprVal != 0 &&
-      LeafSet.insert(Val).second)
-    LeafValues.push_back(Val);
+  if (ExprVal != LogicalExpr::ExprAllOne && ExprVal != 0)
+    LeafValues.insert(Val);
   LogicalOpNode *Node = new LogicalOpNode(this, Val, LogicalExpr(ExprVal));
   LogicalOpNodes[Val] = Node;
   return Node;
Feb 23 2023, 6:32 AM · Restricted Project, Restricted Project
bcl5980 updated the diff for D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

Remove leafset.

Feb 23 2023, 6:31 AM · Restricted Project, Restricted Project

Feb 22 2023

bcl5980 updated the diff for D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..

Address comments.

Feb 22 2023, 6:16 PM · Restricted Project, Restricted Project
bcl5980 added inline comments to D142803: [LogicCombine 1/?] Implement a general way to simplify logical operations..
Feb 22 2023, 5:09 PM · Restricted Project, Restricted Project
bcl5980 committed rGc7531a1be985: [LogicCombine] Restore the logic-combine.ll to before optimzed; NFC (authored by bcl5980).
[LogicCombine] Restore the logic-combine.ll to before optimzed; NFC
Feb 22 2023, 5:01 PM · Restricted Project, Restricted Project
bcl5980 committed rG0c3411bbc589: [LogicCombine] Rename test file complex-logic.ll to logic-combine.ll; NFC (authored by bcl5980).
[LogicCombine] Rename test file complex-logic.ll to logic-combine.ll; NFC
Feb 22 2023, 4:57 PM · Restricted Project, Restricted Project
bcl5980 updated the diff for D143155: [LogicCombine 3/?] Add i1 select instruction support.
Feb 22 2023, 2:25 AM · Restricted Project, Restricted Project
bcl5980 updated the diff for D143046: [LogicCombine 2/?] Add weight into node then use it to determine if we can combine the case need to create new value..
Feb 22 2023, 2:24 AM · Restricted Project, Restricted Project