Page MenuHomePhabricator
Feed Advanced Search

Today

nikic committed rG5238e7b302ff: [InstCombine] Replace one-use select operand based on condition (authored by nikic).
[InstCombine] Replace one-use select operand based on condition
Sat, Jan 16, 2:25 PM
nikic closed D94862: [InstCombine] Replace one-use select operand based on condition.
Sat, Jan 16, 2:25 PM · Restricted Project
nikic added a comment to D94859: [ValueTracking] Make impliesPoison look into operands of V.

I posted an alternative patch at D94866. It's potentially more expensive, but I think it will cover more of the cases we need.

Sat, Jan 16, 8:27 AM · Restricted Project
nikic requested review of D94866: [ValueTracking] Strengthen impliesPoison reasoning.
Sat, Jan 16, 8:24 AM · Restricted Project
nikic added inline comments to D94861: [InstCombine,InstSimplify] Optimize select followed by and/or/xor.
Sat, Jan 16, 6:09 AM · Restricted Project
nikic requested review of D94862: [InstCombine] Replace one-use select operand based on condition.
Sat, Jan 16, 4:23 AM · Restricted Project
nikic committed rGf0a0ec2d085b: [InstCombine] Add more tests for select operand replacement (NFC) (authored by nikic).
[InstCombine] Add more tests for select operand replacement (NFC)
Sat, Jan 16, 4:12 AM
nikic added a comment to D94860: [InstCombine] Optimize select (X == C), (icmp X Y), false.

I think this is a case where being in select form favors us, and we can handle this through a more general transform, rather than the special case that is needed for and/or. The general transform is something along these lines: https://gist.github.com/nikic/4bad7e7e7ecda8d9c9e9633d86836b4d I've wanted to do this for a while, and this looks like a good excuse to make it happen :)

Sat, Jan 16, 3:42 AM · Restricted Project

Yesterday

nikic accepted D94800: ADT: Skip SmallVector::isReferenceToStorage when TakesParamByValue, NFC.

I tested the original three patches plus this one, and the results look good (or at least in line with expectations): https://llvm-compile-time-tracker.com/compare.php?from=33be50daa9ce1074c3b423a4ab27c70c0722113a&to=972a64b1331d1b3022154297593837234a958d0b&stat=instructions

Fri, Jan 15, 1:47 PM · Restricted Project
nikic added a comment to D90094: [BasicAA] Handle recursive queries more efficiently (NFCI).

@rnk Sorry, I got my binaries mixed up again... I can reproduce the crash now.

Fri, Jan 15, 1:26 PM · Restricted Project
nikic added a comment to D90094: [BasicAA] Handle recursive queries more efficiently (NFCI).

@rnk Thanks the the reproducer! Unfortunately I'm not seeing the crash. I'm at a1be47b4771467998d7549dcd1b9f9cebdaa9af9 directly before your revert using a Release+Asserts build.

Fri, Jan 15, 1:06 PM · Restricted Project
nikic added a comment to D94363: [AA] Pass AAResults through AAQueryInfo.

Do you have an idea if there is overhead of adding the AAR object to each query (each query info object)? (vs the setAAResults being done once for all the AAs available).

Fri, Jan 15, 12:46 PM · Restricted Project
nikic added inline comments to D94743: [Attributor][FIX] Do not delete non`-mustprogress` calls.
Fri, Jan 15, 12:16 PM · Restricted Project
nikic added a comment to D94180: [SimplifyCFG] Optimize CFG when null is passed to a function with nonnull argument.

Logic looks fine now, though the GEP handling can be made a bit more lax.

Fri, Jan 15, 12:09 PM · Restricted Project
nikic added a comment to D94106: [Local] Treat calls that may not return as being alive (WIP)..

The new direction of the patch looks good to me. And yes, I would prefer it if the intrinsic attribute updates were split off into a separate patch.

Fri, Jan 15, 8:53 AM · Restricted Project
nikic accepted D94684: [InferAttrs] Mark some library functions as willreturn..

LGTM

Fri, Jan 15, 1:32 AM · Restricted Project
nikic added inline comments to D94743: [Attributor][FIX] Do not delete non`-mustprogress` calls.
Fri, Jan 15, 12:30 AM · Restricted Project
nikic added a reverting change for rG49142991a685: Reapply "ADT: Fix reference invalidation in SmallVector::push_back and single…: rG33be50daa9ce: Revert "Reapply "ADT: Fix reference invalidation in SmallVector::push_back and….
Fri, Jan 15, 12:29 AM
nikic added a reverting change for rG3043e5a5c33c: ADT: Fix reference invalidation in N-element SmallVector::append and insert: rG33be50daa9ce: Revert "Reapply "ADT: Fix reference invalidation in SmallVector::push_back and….
Fri, Jan 15, 12:29 AM
nikic added a reverting change for rG260a856c2abc: ADT: Fix reference invalidation in SmallVector::resize: rG33be50daa9ce: Revert "Reapply "ADT: Fix reference invalidation in SmallVector::push_back and….
Fri, Jan 15, 12:29 AM
nikic added a reverting change for D93781: ADT: Fix reference invalidation in SmallVector::resize: rG33be50daa9ce: Revert "Reapply "ADT: Fix reference invalidation in SmallVector::push_back and….
Fri, Jan 15, 12:29 AM · Restricted Project
nikic added a reverting change for D93780: ADT: Fix reference invalidation in N-element SmallVector::append and insert: rG33be50daa9ce: Revert "Reapply "ADT: Fix reference invalidation in SmallVector::push_back and….
Fri, Jan 15, 12:29 AM · Restricted Project
nikic added a reverting change for D93779: ADT: Fix reference invalidation in SmallVector::push_back and single-element insert: rG33be50daa9ce: Revert "Reapply "ADT: Fix reference invalidation in SmallVector::push_back and….
Fri, Jan 15, 12:29 AM · Restricted Project
nikic committed rG33be50daa9ce: Revert "Reapply "ADT: Fix reference invalidation in SmallVector::push_back and… (authored by nikic).
Revert "Reapply "ADT: Fix reference invalidation in SmallVector::push_back and…
Fri, Jan 15, 12:29 AM

Thu, Jan 14

nikic added a comment to D94633: [FunctionAttrs] Infer willreturn for functions without loops.

The logic seems sound, could be improved since this does initialize the fixpoint computation with a pessimistic starting value. One comment below, the rest is OK for merging.

I thought about this, but I don't think that we can use an optimistic fixpoint here without some much more sophisticated analysis. Just naively assuming "willreturn until proven otherwise" will incorrectly mark infinite recursion as willreturn:

; Not willreturn.
define void @willreturn_recursion() {
  tail call void @willreturn_recursion()
  ret void
}

So, I run this through the Attributor: https://opt.godbolt.org/z/TqsK86
Not what we were looking for, so here is the non-trivial version: https://opt.godbolt.org/z/rbeedM

Just to make sure we're on the same page, both of those would be bugs in attributor right? The first one shouldn't be unreachable, and the second one shouldn't be willreturn, at least not without more information than is contained in that IR.

I agree for the first one. Mustprogress is missing for unreachable to correct. The second one is correct, or am I missing something?

Thu, Jan 14, 2:57 PM · Restricted Project
nikic added a comment to D90328: Eliminates dead store of an exisiting value.

Compile-time: https://llvm-compile-time-tracker.com/compare.php?from=a3904cc77f181cff7355357688edfc392a236f5d&to=b5ccbbb5b1d8fc76e2291a860e4cf0a4787b77d4&stat=instructions Seems mostly fine, only outlier is kimwitu++ in NewPM-O3 configuration (k.cc has 1.25% regression).

Thu, Jan 14, 1:16 PM · Restricted Project
nikic added a comment to D93779: ADT: Fix reference invalidation in SmallVector::push_back and single-element insert.

Over in D91837 the reserveForAndGetAddress() implementation contained a check for TakesParamByValue that seems to be gone in this revision. My first guess is that this is the culprit, and we're now always performing the isReferenceToStorage() check.

Thu, Jan 14, 1:07 PM · Restricted Project
nikic added a comment to D93779: ADT: Fix reference invalidation in SmallVector::push_back and single-element insert.

The last time I tested this in https://reviews.llvm.org/D91837#2464554, the impact was much smaller. Some change between then and the landed version must have regressed things again. I think the numbers are now similar to what we saw before the "small value" optimization was added.

Thu, Jan 14, 12:59 PM · Restricted Project
nikic added inline comments to D94713: Do not traverse ConstantData use-list in SLPVectorizer.
Thu, Jan 14, 12:42 PM · Restricted Project
nikic added inline comments to D90328: Eliminates dead store of an exisiting value.
Thu, Jan 14, 12:22 PM · Restricted Project
nikic added a comment to D94633: [FunctionAttrs] Infer willreturn for functions without loops.

EDIT: I'm fine with this patch, FWIW.

I still think we should check to enable a light-attributor run in the beginning of the pipeline.

I was hoping to get the willreturn-related bugs fixed in time for LLVM 12, so sticking to the existing infrastructure seems like the safer bet :) It probably makes more sense to enable the attributor after branching rather than before.

Fair. As I said, we can enable it in a restricted, lightweight mode first. Could you remind me which bugs?

Thu, Jan 14, 12:02 PM · Restricted Project
nikic added inline comments to D94684: [InferAttrs] Mark some library functions as willreturn..
Thu, Jan 14, 11:42 AM · Restricted Project
nikic committed rGa3904cc77f18: [BasicAA] Handle recursive queries more efficiently (authored by nikic).
[BasicAA] Handle recursive queries more efficiently
Thu, Jan 14, 11:34 AM
nikic closed D90094: [BasicAA] Handle recursive queries more efficiently (NFCI).
Thu, Jan 14, 11:34 AM · Restricted Project
nikic added a comment to D90094: [BasicAA] Handle recursive queries more efficiently (NFCI).

Thank you @dmgreen and @asbirlea for testing!

Thu, Jan 14, 11:27 AM · Restricted Project
nikic added inline comments to D94633: [FunctionAttrs] Infer willreturn for functions without loops.
Thu, Jan 14, 10:01 AM · Restricted Project
nikic updated the diff for D94633: [FunctionAttrs] Infer willreturn for functions without loops.

Use all_of(instructions(F)).

Thu, Jan 14, 9:56 AM · Restricted Project
nikic added a comment to D94633: [FunctionAttrs] Infer willreturn for functions without loops.

I still think we should check to enable a light-attributor run in the beginning of the pipeline.

Thu, Jan 14, 9:42 AM · Restricted Project
nikic updated the diff for D94633: [FunctionAttrs] Infer willreturn for functions without loops.

Add test for infinite recursion and irreducible flow.

Thu, Jan 14, 9:29 AM · Restricted Project

Wed, Jan 13

nikic updated the diff for D94376: [MemCpyOpt] Enable MemorySSA by default.

Fix clang tests. Don't disable MemCpyOpt at O1 (previous version disabled it by accident).

Wed, Jan 13, 2:41 PM · Restricted Project
nikic requested review of D94633: [FunctionAttrs] Infer willreturn for functions without loops.
Wed, Jan 13, 1:48 PM · Restricted Project
nikic committed rGf711cb9a8ad9: [FuncAttrs] Add additional willreturn tests (NFC) (authored by nikic).
[FuncAttrs] Add additional willreturn tests (NFC)
Wed, Jan 13, 1:33 PM
nikic committed rG17863614da1e: [InstCombine] Fold select -> and/or using impliesPoison (authored by nikic).
[InstCombine] Fold select -> and/or using impliesPoison
Wed, Jan 13, 8:46 AM
nikic closed D94550: [InstCombine] Fold select -> and/or using impliesPoison.
Wed, Jan 13, 8:46 AM · Restricted Project

Tue, Jan 12

nikic added a comment to D94448: [NewPM] Run non-trivial loop unswitching under -O2/3/s/z.

FYI this change had some pretty significant impact on compile-time (https://llvm-compile-time-tracker.com/compare.php?from=4718ec01669b01373180f4cd1256c6e2dd6f3999&to=f748e92295515ea7b39cd687a718915b559de6ec&stat=instructions) and code size (https://llvm-compile-time-tracker.com/compare.php?from=4718ec01669b01373180f4cd1256c6e2dd6f3999&to=f748e92295515ea7b39cd687a718915b559de6ec&stat=size-text). Is that expected?

Tue, Jan 12, 1:58 PM · Restricted Project
nikic added a comment to D94550: [InstCombine] Fold select -> and/or using impliesPoison.

With this patch applied, this is the impact on InstCombine after flipping the flag: https://gist.github.com/nikic/052815150762859dddaefde10f25374d We can see that there are still quite a few cases where we regress. However, many can be fixed by stronger impliesPoison handling. E.g. we're currently missing icmp X, Y && icmp X, Y and icmp (X & C), C2 && icmp (X, C'), C2'.

Tue, Jan 12, 1:47 PM · Restricted Project
nikic committed rG23390e7a131a: [InstCombine] Handle logical and/or in assume optimization (authored by nikic).
[InstCombine] Handle logical and/or in assume optimization
Tue, Jan 12, 1:37 PM
nikic requested review of D94550: [InstCombine] Fold select -> and/or using impliesPoison.
Tue, Jan 12, 1:25 PM · Restricted Project
nikic committed rGe15f3ddcae65: [InstCombine] Add tests for logical and/or poison implication (NFC) (authored by nikic).
[InstCombine] Add tests for logical and/or poison implication (NFC)
Tue, Jan 12, 1:19 PM
nikic committed rGfb063c933f00: [InstCombine] Duplicate tests for logical and/or (NFC) (authored by nikic).
[InstCombine] Duplicate tests for logical and/or (NFC)
Tue, Jan 12, 12:51 PM
nikic committed rGd49974f9c98e: [InstCombine] Regenerate test checks (NFC) (authored by nikic).
[InstCombine] Regenerate test checks (NFC)
Tue, Jan 12, 12:27 PM
nikic committed rG7ecad2e4ced1: [InstSimplify] Don't fold gep p, -p to null (authored by nikic).
[InstSimplify] Don't fold gep p, -p to null
Tue, Jan 12, 11:25 AM
nikic closed D93820: [InstSimplify] Don't fold gep p, -p to null.
Tue, Jan 12, 11:25 AM · Restricted Project
nikic added a reviewer for D93789: Add accessors for MCSubtargetInfo CPU and Feature tables: craig.topper.
Tue, Jan 12, 9:34 AM · Restricted Project
nikic added inline comments to D94180: [SimplifyCFG] Optimize CFG when null is passed to a function with nonnull argument.
Tue, Jan 12, 9:32 AM · Restricted Project
nikic accepted D94502: [FunctionAttrs] Derive willreturn for fns with readonly` & `mustprogress`..

LGTM as well.

Tue, Jan 12, 9:29 AM · Restricted Project
nikic added a comment to D92015: [DAGCombiner] Fold BRCOND(FREEZE(COND)) to BRCOND(COND).

Yes, I think this is fine to land as-is. Note that SDAG always works on a single basic block, so I don't think there is any value in having "branch on undef is UB" semantics, as we can't infer information from branch conditions anyway.

Tue, Jan 12, 9:26 AM · Restricted Project
nikic added a comment to D94447: [PredicateInfo] Generalize processing of conditions.

The thought that the current limitations are compile-time related crossed my mind, but that doesn't seem to be a concern: https://llvm-compile-time-tracker.com/compare.php?from=00f773cf424699d8eb31591fdc95e0ca18b2682c&to=10ec7c7960ea47e899003fcd7d1ba5c389ba1cae&stat=instructions

Tue, Jan 12, 9:22 AM · Restricted Project
nikic added inline comments to D94502: [FunctionAttrs] Derive willreturn for fns with readonly` & `mustprogress`..
Tue, Jan 12, 8:58 AM · Restricted Project

Mon, Jan 11

nikic added a comment to D93039: Introduce llvm.noalias.decl intrinsic.

@jdoerfert It would be great if you could look over this as well.

Mon, Jan 11, 2:40 PM · Restricted Project
nikic requested review of D94447: [PredicateInfo] Generalize processing of conditions.
Mon, Jan 11, 1:44 PM · Restricted Project
nikic committed rG00f773cf4246: [SCCP] Fix misclassified conditions in test (NFC) (authored by nikic).
[SCCP] Fix misclassified conditions in test (NFC)
Mon, Jan 11, 1:34 PM
nikic committed rGa808d89d355c: [PredicateInfo] Add test for one unknown condition in and/or (NFC) (authored by nikic).
[PredicateInfo] Add test for one unknown condition in and/or (NFC)
Mon, Jan 11, 1:34 PM

Sun, Jan 10

nikic requested review of D94376: [MemCpyOpt] Enable MemorySSA by default.
Sun, Jan 10, 12:11 PM · Restricted Project
nikic committed rG1ecae1e62ad0: [ConstantFold] Fold fptoi.sat intrinsics (authored by nikic).
[ConstantFold] Fold fptoi.sat intrinsics
Sun, Jan 10, 8:48 AM
nikic committed rGbdb748a0ab24: [ConstantFold] Add tests for fptoi.sat (NFC) (authored by nikic).
[ConstantFold] Add tests for fptoi.sat (NFC)
Sun, Jan 10, 8:36 AM
nikic updated subscribers of D93820: [InstSimplify] Don't fold gep p, -p to null.

Based on what @RalfJung mentioned on zulip, the question of whether the transform is legal for inbounds comes down to the particular choice of inbounds semantics. I was using the semantics specified in LangRef, which make the optimization illegal, while @nlopes used the semantics from https://people.mpi-sws.org/~jung/twinsem/twinsem.pdf (or something similar), which makes it legal. The relevant difference to the LangRef semantics (if we stick to the gep-inbounds-logical case) would be:

Sun, Jan 10, 7:02 AM · Restricted Project
nikic added a comment to D54749: Saturating float to int casts..

@bjope There are two more revisions based on this one, D86079 implements improved X86 lowerings and is already accepted, and D86078 implements improved AArch64 lowerings. Do you plan to land these as well?

Sun, Jan 10, 4:44 AM · Restricted Project
nikic accepted D94138: Require chained analyses in BasicAA and AAResults to be transitive.

LGTM. I'm not an expert on the pass manager, but after looking into it a bit this seems like the right direction. I don't think not preserving AAResults in HexagonLoopIdiomRecognition/GVNHoist is much of a problem. Preserving AAResults is generally not important (this "analysis" is essentially free) and these are non-default passes anyway.

Sun, Jan 10, 2:21 AM · Restricted Project
nikic added inline comments to D94138: Require chained analyses in BasicAA and AAResults to be transitive.
Sun, Jan 10, 2:14 AM · Restricted Project

Sat, Jan 9

nikic accepted D93039: Introduce llvm.noalias.decl intrinsic.

LGTM, but please wait for @jdoerfert to check this as well.

Sat, Jan 9, 1:22 PM · Restricted Project
nikic added inline comments to D94363: [AA] Pass AAResults through AAQueryInfo.
Sat, Jan 9, 1:15 PM · Restricted Project
nikic requested review of D94363: [AA] Pass AAResults through AAQueryInfo.
Sat, Jan 9, 1:14 PM · Restricted Project

Fri, Jan 8

nikic added a comment to D94306: [LoopRotate] Use llvm.experimental.noalias.scope.decl for duplicating noalias metadata as needed.

This is tricker than the unroll case, but also looks sound to me.

Fri, Jan 8, 1:12 PM · Restricted Project
nikic added a comment to D92887: [LoopUnroll] Use llvm.experimental.noalias.scope.decl for duplicating noalias metadata as needed.

The logic here looks sounds to me.

Fri, Jan 8, 12:12 PM · Restricted Project
nikic accepted D94328: [SLP] put verifyFunction call behind EXPENSIVE_CHECKS.

LGTM

Fri, Jan 8, 11:52 AM · Restricted Project
nikic added inline comments to D93040: [InlineFunction] Use llvm.experimental.noalias.scope.decl for noalias arguments..
Fri, Jan 8, 11:48 AM · Restricted Project
nikic added a comment to D93042: [noalias.decl] Look through llvm.experimental.noalias.scope.decl.

The changes here all look reasonable to me. Ideally we would add test cases for the individual passes and land this before changing inlining, such that the inlining change by itself does not cause undue regressions.

Fri, Jan 8, 9:42 AM · Restricted Project
nikic added a comment to D93039: Introduce llvm.noalias.decl intrinsic.

Another observation/question I have is about possible optimizations for omitting the @llvm.experimental.noalias.scope.decl: In the full restrict patches, the declarations are thrown away when there are no users any more. The equivalent with the implementation here, is that we can throw away the declaration if the scope it declares is not used in any !alias.scope metadata. Would this be something that is easy (and fast) to check ?

Fri, Jan 8, 9:23 AM · Restricted Project
nikic added a comment to D93065: [InstCombine] Disable optimizations of select instructions that causes propagation of poison values.

@aqjune Do you have any automated way of duplicating the InstCombine tests with logical and/or, similar to what you did for insertelement? Or does this have to be done by hand?

Fri, Jan 8, 12:51 AM · Restricted Project, Restricted Project

Thu, Jan 7

nikic added a comment to D93039: Introduce llvm.noalias.decl intrinsic.

Just some minor notes.

Thu, Jan 7, 1:23 PM · Restricted Project
nikic added a comment to D93888: [GVN] If zext X == N or sext X == N, then X == trunc N..

@nikic Would you mind explaining why? If there is a good reason we cannot do this in NewGVN then D93850 might be the best we could do.

Thu, Jan 7, 9:59 AM · Restricted Project
nikic added inline comments to D94180: [SimplifyCFG] Optimize CFG when null is passed to a function with nonnull argument.
Thu, Jan 7, 9:31 AM · Restricted Project

Wed, Jan 6

nikic updated the diff for D90094: [BasicAA] Handle recursive queries more efficiently (NFCI).

Rebase

Wed, Jan 6, 2:54 PM · Restricted Project
nikic committed rGf6f6f6375d1a: [BasicAA] Fix BatchAA results for phi-phi assumptions (authored by nikic).
[BasicAA] Fix BatchAA results for phi-phi assumptions
Wed, Jan 6, 1:16 PM
nikic closed D91936: [BasicAA] Fix BatchAA results for phi-phi assumptions.
Wed, Jan 6, 1:15 PM · Restricted Project
nikic committed rG221c3b174b15: [InstSimplify] Canonicalize non-demanded shuffle op to poison (NFCI) (authored by nikic).
[InstSimplify] Canonicalize non-demanded shuffle op to poison (NFCI)
Wed, Jan 6, 12:29 PM
nikic committed rGd042f2db5bf0: [InstSimplify] Fold call null/undef to poison (authored by nikic).
[InstSimplify] Fold call null/undef to poison
Wed, Jan 6, 12:15 PM
nikic committed rG7d48eff8ba17: [PowerPC] Avoid call to undef in test (NFC) (authored by nikic).
[PowerPC] Avoid call to undef in test (NFC)
Wed, Jan 6, 12:09 PM
nikic committed rGa6df39236fdc: [InstSimplify] Fold out-of-bounds shift to poison (authored by nikic).
[InstSimplify] Fold out-of-bounds shift to poison
Wed, Jan 6, 11:42 AM
nikic committed rG8f9da24fa7ff: [GVN] Regenerate test checks (NFC) (authored by nikic).
[GVN] Regenerate test checks (NFC)
Wed, Jan 6, 11:42 AM
nikic closed D93998: [InstSimplify] Fold out-of-bounds shift to poison.
Wed, Jan 6, 11:41 AM · Restricted Project
nikic added a reviewer for D94180: [SimplifyCFG] Optimize CFG when null is passed to a function with nonnull argument: aqjune.
Wed, Jan 6, 11:28 AM · Restricted Project
nikic accepted D93994: [InstSimplify] Fold insertelement vec, poison, idx into vec.

LGTM. Nice catch on the ConstantVector issue.

Wed, Jan 6, 9:58 AM · Restricted Project

Tue, Jan 5

nikic added inline comments to D93617: [LoopVectorize] Take non-instruction's size into consideration when computing leader's demanded bits.
Tue, Jan 5, 1:50 PM · Restricted Project
nikic added a comment to D94106: [Local] Treat calls that may not return as being alive (WIP)..

Happy to see this issue finally fixed :)

I think the general approach here should be more along the lines of infering WillReturn inside FuncAttrs, and then just checking the WillReturn attribute here. Especially for languages which have no forward-progress guarantee it is important that WillReturn actually gets inferred somewhere, otherwise intrinsics will be the only thing that set the attribute.

Maybe if we turn on the attributor for a few selected attributes only?

I think it would be good to approach this incrementally. So start with gradually making the behavior 'more' correct than it is at the moment, while not regressing on performance. Treating functions without side effects without mustprogress as 'alive' seems like a relatively safe thing to do as a start.

We should also improve the inference, but to make progress it might be be desirable to not predicate one on the other to start with. I realize that having good-enough inference to start with is the more principled approach and I am not sure if the desire to make progress outweighs that in the case at hand.

Tue, Jan 5, 12:59 PM · Restricted Project
nikic added a comment to D93974: [ValueTracking] Safe assumption context for args.

Sorry for the delay @nikic.

Am I understanding correctly that this tries to use the last instruction in the entry block rather than the first one to avoid triggering the ephemeral value check, in case the first instruction is part of an assumption?

Yes, the first instruction is fine except for an assume which appears (along with its ephemeral values) as the first thing in the function, which in case of an argument seems quite likely.

In any case, I don't think it's appropriate to perform a full block scan to determine the context instruction. safeCxtI() should be cheap (as in O(1)).

An unbounded scan of the entry block might indeed be too much even if applied only to arguments. The scan can perhaps be limited to some small number of instructions (5 seems like the minimum to cover most patterns in computeKnownBits()) which gets reset if an assume is encountered.

Tue, Jan 5, 12:05 PM · Restricted Project
nikic added a comment to D93994: [InstSimplify] Fold insertelement vec, poison, idx into vec.

It looks like there are some test failures.

Tue, Jan 5, 11:59 AM · Restricted Project
nikic updated the diff for D93998: [InstSimplify] Fold out-of-bounds shift to poison.

Rebase over new gep poison fold.

Tue, Jan 5, 11:53 AM · Restricted Project
nikic added a reviewer for D94106: [Local] Treat calls that may not return as being alive (WIP).: nikic.

Happy to see this issue finally fixed :)

Tue, Jan 5, 11:49 AM · Restricted Project