Page MenuHomePhabricator

StephenFan (luxufan)
User

Projects

User does not belong to any projects.

User Details

User Since
Jul 14 2020, 5:33 AM (141 w, 2 d)

Recent Activity

Yesterday

StephenFan requested review of D147122: [Local] Preserve !align if K dominates J and K has a !noundef.
Wed, Mar 29, 1:07 AM · Restricted Project, Restricted Project

Sun, Mar 26

StephenFan committed rG9630a9999b43: [Local] Preserve !nonnull only when K dominate J and K has a !noundef (authored by StephenFan).
[Local] Preserve !nonnull only when K dominate J and K has a !noundef
Sun, Mar 26, 7:37 AM · Restricted Project, Restricted Project
StephenFan closed D146799: [Local] Preserve !nonnull only when K dominate J and K has a !noundef.
Sun, Mar 26, 7:36 AM · Restricted Project, Restricted Project

Fri, Mar 24

StephenFan requested review of D146799: [Local] Preserve !nonnull only when K dominate J and K has a !noundef.
Fri, Mar 24, 3:38 AM · Restricted Project, Restricted Project
StephenFan committed rG6a7d04c6b44d: [NFC] Regenerate test of InstCombine/load-combine-metadata-dominance.ll (authored by StephenFan).
[NFC] Regenerate test of InstCombine/load-combine-metadata-dominance.ll
Fri, Mar 24, 1:48 AM · Restricted Project, Restricted Project
StephenFan committed rG558b33c5aa7e: [NFC] Regenerate test NewGVN/metadata-nonnull.ll (authored by StephenFan).
[NFC] Regenerate test NewGVN/metadata-nonnull.ll
Fri, Mar 24, 1:28 AM · Restricted Project, Restricted Project

Thu, Mar 23

StephenFan committed rGf44c7dec67fe: [Local] Use most generic range if K does not dominate J or K doesn't have a ! (authored by StephenFan).
[Local] Use most generic range if K does not dominate J or K doesn't have a !
Thu, Mar 23, 4:41 AM · Restricted Project, Restricted Project
StephenFan closed D142687: [Local] Use most generic range if K does not dominate J or K doesn't have a !noundef.
Thu, Mar 23, 4:41 AM · Restricted Project, Restricted Project
StephenFan updated the diff for D142687: [Local] Use most generic range if K does not dominate J or K doesn't have a !noundef.

Update title.

Thu, Mar 23, 4:25 AM · Restricted Project, Restricted Project
StephenFan updated the diff for D142687: [Local] Use most generic range if K does not dominate J or K doesn't have a !noundef.

Use most generic range if K don't have a !noundef

Thu, Mar 23, 4:20 AM · Restricted Project, Restricted Project
StephenFan added inline comments to D142687: [Local] Use most generic range if K does not dominate J or K doesn't have a !noundef.
Thu, Mar 23, 3:13 AM · Restricted Project, Restricted Project
StephenFan added a comment to D146629: [SimplifyCFG][LICM] Preserve nonnull, range and align metadata when speculating.

This is valid, I think.
That said, I went to try what could go wrong and it was easy.
At least early-cse is buggy so this will cause issues until those bugs are fixed:
https://godbolt.org/z/Tz98hYa9E

FWIW, instcombine gets it right regardless of the order. Might be luck or logic to properly merge the attributes.

Thu, Mar 23, 12:01 AM · Restricted Project, Restricted Project

Wed, Mar 22

StephenFan added inline comments to D142687: [Local] Use most generic range if K does not dominate J or K doesn't have a !noundef.
Wed, Mar 22, 11:58 PM · Restricted Project, Restricted Project
StephenFan added a comment to D142687: [Local] Use most generic range if K does not dominate J or K doesn't have a !noundef.
Wed, Mar 22, 11:44 PM · Restricted Project, Restricted Project
StephenFan updated the diff for D142687: [Local] Use most generic range if K does not dominate J or K doesn't have a !noundef.

Rebase and add test for load with !noundef

Wed, Mar 22, 10:24 PM · Restricted Project, Restricted Project
StephenFan updated the diff for D142687: [Local] Use most generic range if K does not dominate J or K doesn't have a !noundef.

Keep the metadata if J has !noundef

Wed, Mar 22, 3:12 AM · Restricted Project, Restricted Project

Tue, Mar 21

StephenFan updated the diff for D146609: [InstCombine] Fold xor of icmps of power of 2.

Rename some variables.

Tue, Mar 21, 11:50 PM · Restricted Project, Restricted Project
StephenFan requested review of D146609: [InstCombine] Fold xor of icmps of power of 2.
Tue, Mar 21, 11:45 PM · Restricted Project, Restricted Project
StephenFan updated the diff for D123515: [RISCV] Support '.option arch' directive.

Grammar fixing.

Tue, Mar 21, 1:00 AM · Restricted Project, Restricted Project
StephenFan updated the diff for D123515: [RISCV] Support '.option arch' directive.

Address comments and add back test file.

Tue, Mar 21, 12:48 AM · Restricted Project, Restricted Project
StephenFan committed rG6beb371e4c46: [InstCombine] Combine binary operator of two phi node (authored by StephenFan).
[InstCombine] Combine binary operator of two phi node
Tue, Mar 21, 12:25 AM · Restricted Project, Restricted Project
StephenFan closed D145223: [InstCombine] Combine binary operator of two phi node.
Tue, Mar 21, 12:24 AM · Restricted Project, Restricted Project

Mon, Mar 20

StephenFan committed rG772658a9d024: [InstCombine][NFC] Precommit test case of PR61137 (authored by StephenFan).
[InstCombine][NFC] Precommit test case of PR61137
Mon, Mar 20, 11:34 PM · Restricted Project, Restricted Project
StephenFan committed rGb0c854b016a7: [NFC] Regenerate test file InstCombine/bit-checks.ll (authored by StephenFan).
[NFC] Regenerate test file InstCombine/bit-checks.ll
Mon, Mar 20, 4:05 AM · Restricted Project, Restricted Project

Sun, Mar 19

StephenFan updated the diff for D145223: [InstCombine] Combine binary operator of two phi node.

Move function into a variable and add sub test.

Sun, Mar 19, 7:59 AM · Restricted Project, Restricted Project

Sat, Mar 18

StephenFan added a reviewer for D146364: [Driver] Fix naming conflicts of getStatsFileName when using LTO: MaskRay.
Sat, Mar 18, 9:46 PM · Restricted Project, Restricted Project

Mon, Mar 13

StephenFan added inline comments to D145854: [GlobalDCE] Don't add dependency via icmp against inbouds pointer.
Mon, Mar 13, 10:53 PM · Restricted Project, Restricted Project

Sun, Mar 12

StephenFan updated the diff for D145223: [InstCombine] Combine binary operator of two phi node.

Support BinOp Identity.

Sun, Mar 12, 6:47 PM · Restricted Project, Restricted Project
StephenFan added a comment to D145471: [RISCV] Set how many bytes load from or store to stack slot.

This patch caused a code size regression in our ci tests https://github.com/dtcxzyw/llvm-ci/issues/8. And part of the extra codes it generates is as follows:

Sun, Mar 12, 3:43 AM · Restricted Project, Restricted Project

Fri, Mar 10

StephenFan updated the diff for D123515: [RISCV] Support '.option arch' directive.

Address comments.

Fri, Mar 10, 11:33 PM · Restricted Project, Restricted Project

Wed, Mar 8

StephenFan added inline comments to D145510: [SCEV] Fix finite loop non-strict predicate simplification (PR60944).
Wed, Mar 8, 9:48 PM · Restricted Project, Restricted Project
StephenFan abandoned D144861: [SCEV][IndVars][WIP] Check outer loop invariant when cononicalize comparision.

I've posted https://reviews.llvm.org/D145510 as an alternative patch, which hopefully resolves all the issues with the current implementation.

Wed, Mar 8, 12:55 AM · Restricted Project, Restricted Project

Sat, Mar 4

StephenFan updated the diff for D123515: [RISCV] Support '.option arch' directive.

Match binutils and spec.

Sat, Mar 4, 7:39 PM · Restricted Project, Restricted Project

Fri, Mar 3

StephenFan updated the diff for D123515: [RISCV] Support '.option arch' directive.

Change base commit.

Fri, Mar 3, 11:05 PM · Restricted Project, Restricted Project
StephenFan updated the diff for D123515: [RISCV] Support '.option arch' directive.

Rebase and address comments

Fri, Mar 3, 11:03 PM · Restricted Project, Restricted Project
StephenFan committed rG05ef449600be: [SimplifyCFG] Handle MD_noundef when hoisting common codes (authored by StephenFan).
[SimplifyCFG] Handle MD_noundef when hoisting common codes
Fri, Mar 3, 3:04 AM · Restricted Project, Restricted Project
StephenFan closed D144939: [SimplifyCFG] Handle MD_noundef when hoisting common codes.
Fri, Mar 3, 3:04 AM · Restricted Project, Restricted Project
StephenFan added a comment to D145223: [InstCombine] Combine binary operator of two phi node.

This optimization can be more general, why only add?

Right. This can be generalized at least to ConstantExpr::getBinOpIdentity(), but more generally to performing a simplification on all operands -- the latter might be expensive in terms of compile-time though.

Fri, Mar 3, 1:46 AM · Restricted Project, Restricted Project
StephenFan added a comment to D145223: [InstCombine] Combine binary operator of two phi node.

This optimization can be more general, why only add?

Fri, Mar 3, 1:44 AM · Restricted Project, Restricted Project
StephenFan requested review of D145223: [InstCombine] Combine binary operator of two phi node.
Fri, Mar 3, 12:57 AM · Restricted Project, Restricted Project

Thu, Mar 2

StephenFan updated the diff for D144939: [SimplifyCFG] Handle MD_noundef when hoisting common codes.

Rerun with --check-globals

Thu, Mar 2, 12:11 AM · Restricted Project, Restricted Project
StephenFan updated the diff for D144939: [SimplifyCFG] Handle MD_noundef when hoisting common codes.

Add back !range metadata

Thu, Mar 2, 12:03 AM · Restricted Project, Restricted Project

Wed, Mar 1

StephenFan updated the diff for D144939: [SimplifyCFG] Handle MD_noundef when hoisting common codes.

Replace with combinemetadataForCSE and make test more robust.

Wed, Mar 1, 6:40 PM · Restricted Project, Restricted Project
StephenFan added a comment to D123515: [RISCV] Support '.option arch' directive.

@StephenFan Can you please rebase this?

Wed, Mar 1, 5:21 PM · Restricted Project, Restricted Project
StephenFan added a comment to D144861: [SCEV][IndVars][WIP] Check outer loop invariant when cononicalize comparision.

! In D144861#4160179, @efriedma wrote:
From my analysis of the testcase, we called "getAddExpr(SCEV::FlagNUW)" while analyzing the first loop, and that broke the analysis of the second loop. The actual simplification isn't relevant.

Sorry, I don't know what you mean by "The actual simplification isn't relevant". Would you mind explaining a little more?

The getAddExpr() with NUW flag sets this flag globally, for all uses of this add. The icmp simplification itself doesn't make a difference, just the side effect that the (not globally correct) nuw flag is set.

Wed, Mar 1, 5:04 AM · Restricted Project, Restricted Project

Tue, Feb 28

StephenFan added a comment to D144861: [SCEV][IndVars][WIP] Check outer loop invariant when cononicalize comparision.

From my analysis of the testcase, we called "getAddExpr(SCEV::FlagNUW)" while analyzing the first loop, and that broke the analysis of the second loop. The actual simplification isn't relevant.

Tue, Feb 28, 9:15 PM · Restricted Project, Restricted Project

Feb 28 2023

StephenFan committed rG207854b07dd9: [Local][InstCombine] Handle MD_noundef in combineMetadataCSE (authored by StephenFan).
[Local][InstCombine] Handle MD_noundef in combineMetadataCSE
Feb 28 2023, 2:10 AM · Restricted Project, Restricted Project
StephenFan closed D144942: [Local][InstCombine] Handle MD_noundef in combineMetadataCSE.
Feb 28 2023, 2:09 AM · Restricted Project, Restricted Project
StephenFan added inline comments to D144933: [instcombine] Simplify separate_storage hints..
Feb 28 2023, 1:37 AM · Restricted Project, Restricted Project

Feb 27 2023

StephenFan requested review of D144942: [Local][InstCombine] Handle MD_noundef in combineMetadataCSE.
Feb 27 2023, 9:30 PM · Restricted Project, Restricted Project
StephenFan updated the diff for D144939: [SimplifyCFG] Handle MD_noundef when hoisting common codes.

Fix

Feb 27 2023, 9:12 PM · Restricted Project, Restricted Project
StephenFan added inline comments to D144939: [SimplifyCFG] Handle MD_noundef when hoisting common codes.
Feb 27 2023, 8:57 PM · Restricted Project, Restricted Project
StephenFan updated the diff for D144939: [SimplifyCFG] Handle MD_noundef when hoisting common codes.

Add test files.

Feb 27 2023, 8:55 PM · Restricted Project, Restricted Project
StephenFan added a reviewer for D144861: [SCEV][IndVars][WIP] Check outer loop invariant when cononicalize comparision: efriedma.
Feb 27 2023, 8:52 PM · Restricted Project, Restricted Project
StephenFan requested review of D144939: [SimplifyCFG] Handle MD_noundef when hoisting common codes.
Feb 27 2023, 8:51 PM · Restricted Project, Restricted Project
StephenFan requested review of D144861: [SCEV][IndVars][WIP] Check outer loop invariant when cononicalize comparision.
Feb 27 2023, 4:20 AM · Restricted Project, Restricted Project

Feb 25 2023

StephenFan added a comment to D142801: [Local][InstCombine][GVN] Handle !noundef metadata in combineMetadata.

Yes. Do I need to do it all at once? My original thought was to do it step by step.

Do you plan to work on the other combineMetadata() users?

Feb 25 2023, 8:09 PM · Restricted Project, Restricted Project

Feb 24 2023

StephenFan added inline comments to D144563: [SimplifyCFG] Improve the precision of `PtrValueMayBeModified`.
Feb 24 2023, 8:39 PM · Restricted Project, Restricted Project

Feb 23 2023

StephenFan added inline comments to D144618: [ConstantFold][InstSimplify] Pre-commit tests for D144445 (NFC).
Feb 23 2023, 6:12 AM · Restricted Project, Restricted Project

Feb 20 2023

StephenFan added a comment to D144445: [AggressiveInstCombine] folding load for constant global patterened arrays and structs by alignment.

Is it correct if we load with the same type as the const array but the load's pointer operand is with the i8* type?

define i32 @load_gep_const_alleq_array(i64 %idx) {
  %gep = getelementptr inbounds i8, ptr @constalleqarray, i64 %idx
  %load = load i32, ptr %gep
  ret i32 %load
}
Feb 20 2023, 11:27 PM · Restricted Project, Restricted Project

Feb 17 2023

StephenFan added a comment to D144298: [Local][SimplifyCFG][GVN] Handle !nontemporal in combineMetadata.

It seems the change in patchReplacementInstruction is not tested. I think it's better to make it tested.

Feb 17 2023, 8:37 PM · Restricted Project, Restricted Project

Feb 16 2023

StephenFan added a comment to D144053: [LICM] Ensure LICM can hoist invariant.group.

I have a question what behavior the compiler raises if !invariant.group 's semantic is violated? For this case:

define i32 @foo(ptr nocapture %p, ptr nocapture %q) {
entry:
  %0 = load i32, ptr %p, align 4, !invariant.load !0
  store i8 2, ptr %p, align 1
  %1 = load i32, ptr %p, align 4, !invariant.load !0
  %add = add nsw i32 %1, %0
  ret i32 %add
}
Feb 16 2023, 7:37 AM · Restricted Project, Restricted Project

Feb 15 2023

StephenFan added a comment to D143641: [MemorySSA] Iteratively check if gep's pointer operand is a guaranteed loop invariant.

https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp#L1283 may also be a potential user if a new PointerStripKind added.

Feb 15 2023, 6:51 PM · Restricted Project, Restricted Project
StephenFan added a comment to D143641: [MemorySSA] Iteratively check if gep's pointer operand is a guaranteed loop invariant.

I'm curious where this came up in practice. Constant GEP based on constant GEP gets merged by InstCombine.

TBH, The test was constructed by hand. So it may not make sense in practice since as you said it always gets merged by InstCombine. But that reminds me if it makes sense to also check whether the index operands are invariant?

Feb 15 2023, 6:19 PM · Restricted Project, Restricted Project

Feb 12 2023

StephenFan updated the diff for D143641: [MemorySSA] Iteratively check if gep's pointer operand is a guaranteed loop invariant.

Remove TODO.

Feb 12 2023, 11:38 PM · Restricted Project, Restricted Project
StephenFan updated the diff for D143641: [MemorySSA] Iteratively check if gep's pointer operand is a guaranteed loop invariant.

Replace recursion as bounded iteration.

Feb 12 2023, 10:19 PM · Restricted Project, Restricted Project

Feb 9 2023

StephenFan requested review of D143641: [MemorySSA] Iteratively check if gep's pointer operand is a guaranteed loop invariant.
Feb 9 2023, 5:19 AM · Restricted Project, Restricted Project
StephenFan committed rGe50a508b5c3d: [MemorySSA] Add test for gep with loop invariant pointer operand and (authored by StephenFan).
[MemorySSA] Add test for gep with loop invariant pointer operand and
Feb 9 2023, 5:02 AM · Restricted Project, Restricted Project

Feb 8 2023

StephenFan added inline comments to D143363: [ValueTracking] Search dominate condition to check if a value is pow2 or not.
Feb 8 2023, 7:47 PM · Restricted Project, Restricted Project
StephenFan added inline comments to D143363: [ValueTracking] Search dominate condition to check if a value is pow2 or not.
Feb 8 2023, 6:25 AM · Restricted Project, Restricted Project

Feb 2 2023

StephenFan added inline comments to D142234: [ConstantRange] Handle `Intrinsic::ctlz`.
Feb 2 2023, 11:27 PM · Restricted Project, Restricted Project

Feb 1 2023

StephenFan committed rG232698dc171e: [Local][InstCombine][GVN] Handle !noundef metadata in combineMetadata (authored by StephenFan).
[Local][InstCombine][GVN] Handle !noundef metadata in combineMetadata
Feb 1 2023, 10:27 PM · Restricted Project, Restricted Project
StephenFan closed D142801: [Local][InstCombine][GVN] Handle !noundef metadata in combineMetadata.
Feb 1 2023, 10:27 PM · Restricted Project, Restricted Project

Jan 30 2023

StephenFan updated the diff for D142801: [Local][InstCombine][GVN] Handle !noundef metadata in combineMetadata.

Add test of K dominates J.

Jan 30 2023, 12:08 AM · Restricted Project, Restricted Project

Jan 29 2023

StephenFan added inline comments to D142830: [ValueTracking] Improve non-zero tracking of `X` by also searching through `Use(X)` that imply non-zero.
Jan 29 2023, 12:28 AM · Restricted Project, Restricted Project

Jan 28 2023

StephenFan added a comment to D142801: [Local][InstCombine][GVN] Handle !noundef metadata in combineMetadata.

Shouldn't MD_noundef be added to some more known metadata lists, and in particular also combineMetadataForCSE?

Jan 28 2023, 3:07 AM · Restricted Project, Restricted Project

Jan 27 2023

StephenFan updated the diff for D142801: [Local][InstCombine][GVN] Handle !noundef metadata in combineMetadata.

Fix typo.

Jan 27 2023, 11:07 PM · Restricted Project, Restricted Project
StephenFan requested review of D142801: [Local][InstCombine][GVN] Handle !noundef metadata in combineMetadata.
Jan 27 2023, 11:06 PM · Restricted Project, Restricted Project

Jan 26 2023

StephenFan requested review of D142687: [Local] Use most generic range if K does not dominate J or K doesn't have a !noundef.
Jan 26 2023, 9:59 PM · Restricted Project, Restricted Project

Jan 17 2023

StephenFan committed rG0ad590995815: [InstCombine] Don't combine smul of i1 type constant one (authored by StephenFan).
[InstCombine] Don't combine smul of i1 type constant one
Jan 17 2023, 6:05 AM · Restricted Project, Restricted Project
StephenFan closed D141214: [InstCombine] Don't combine smul of i1 type constant one.
Jan 17 2023, 6:05 AM · Restricted Project, Restricted Project

Jan 13 2023

StephenFan updated the diff for D141214: [InstCombine] Don't combine smul of i1 type constant one.

Rebase and handle i1 vectors.

Jan 13 2023, 10:34 PM · Restricted Project, Restricted Project

Jan 12 2023

StephenFan committed rG98ffc7b1a88e: [MemorySSA] Don't check def set when cloning memoryaccesses (authored by StephenFan).
[MemorySSA] Don't check def set when cloning memoryaccesses
Jan 12 2023, 5:55 AM · Restricted Project, Restricted Project
StephenFan closed D141185: [MemorySSA] Don't check def set when cloning memoryaccesses.
Jan 12 2023, 5:54 AM · Restricted Project, Restricted Project
StephenFan added inline comments to D141482: [LVI][CVP] Make use of condition known at use.
Jan 12 2023, 5:32 AM · Restricted Project, Restricted Project

Jan 9 2023

StephenFan updated the diff for D141185: [MemorySSA] Don't check def set when cloning memoryaccesses.

Replace attribute to noinline.

Jan 9 2023, 8:07 PM · Restricted Project, Restricted Project
StephenFan updated the diff for D141185: [MemorySSA] Don't check def set when cloning memoryaccesses.

Add an assertion.

Jan 9 2023, 7:55 PM · Restricted Project, Restricted Project

Jan 7 2023

StephenFan requested review of D141214: [InstCombine] Don't combine smul of i1 type constant one.
Jan 7 2023, 10:45 PM · Restricted Project, Restricted Project
StephenFan committed rGeda8e999dd01: [InstCombine] Combine (zext a) mul (zext b) to llvm.umul.with.overflow only if… (authored by StephenFan).
[InstCombine] Combine (zext a) mul (zext b) to llvm.umul.with.overflow only if…
Jan 7 2023, 10:42 PM · Restricted Project, Restricted Project
StephenFan closed D141031: [InstCombine] Combine (zext a) mul (zext b) to llvm.umul.with.overflow only if mul has NUW flag.
Jan 7 2023, 10:42 PM · Restricted Project, Restricted Project
StephenFan requested review of D141185: [MemorySSA] Don't check def set when cloning memoryaccesses.
Jan 7 2023, 12:17 AM · Restricted Project, Restricted Project

Jan 4 2023

StephenFan requested review of D141031: [InstCombine] Combine (zext a) mul (zext b) to llvm.umul.with.overflow only if mul has NUW flag.
Jan 4 2023, 10:47 PM · Restricted Project, Restricted Project
StephenFan committed rG5006d82329c2: [InstCombine][NFC] Regenerate test cases by update_test_checks.py (authored by StephenFan).
[InstCombine][NFC] Regenerate test cases by update_test_checks.py
Jan 4 2023, 10:39 PM · Restricted Project, Restricted Project
StephenFan committed rG90cf22b91b30: [InstCombine][NFC] Regenerate test cases by update_test_checks.py (authored by StephenFan).
[InstCombine][NFC] Regenerate test cases by update_test_checks.py
Jan 4 2023, 10:28 PM · Restricted Project, Restricted Project
StephenFan added a comment to D140974: [LICM][WIP] Transform and hoist select instructions if possible.

Shouldn't this be handled by adding this fold to InstCombine? https://alive2.llvm.org/ce/z/EXY5JH

Jan 4 2023, 6:51 AM · Restricted Project, Restricted Project
StephenFan requested review of D140974: [LICM][WIP] Transform and hoist select instructions if possible.
Jan 4 2023, 6:06 AM · Restricted Project, Restricted Project

Jan 3 2023

StephenFan committed rGaca7441c7ae2: [LoopFusion] Exit early if one of fusion candidate has guarded branch but the… (authored by StephenFan).
[LoopFusion] Exit early if one of fusion candidate has guarded branch but the…
Jan 3 2023, 7:31 AM · Restricted Project, Restricted Project
StephenFan closed D138269: [LoopFusion] Exit early if one of fusion candidate has guarded branch but the another has not.
Jan 3 2023, 7:31 AM · Restricted Project, Restricted Project
StephenFan committed rG5b25a0bcb14b: [CVP] Simplify SRem when constantrange abs(lhs) < abs(rhs) (authored by StephenFan).
[CVP] Simplify SRem when constantrange abs(lhs) < abs(rhs)
Jan 3 2023, 6:53 AM · Restricted Project, Restricted Project
StephenFan closed D140405: [CVP] Simplify SRem when constantrange abs(lhs) < abs(rhs).
Jan 3 2023, 6:53 AM · Restricted Project, Restricted Project