Age | Commit message (Collapse) | Author | Files | Lines |
|
Add cases for the following ops:
- 0-X -- https://alive2.llvm.org/ce/z/6C75Li
- bitreverse(X) -- https://alive2.llvm.org/ce/z/SGG1q9
- bswap(X) -- https://alive2.llvm.org/ce/z/p7pzwh
- ctpop(X) -- https://alive2.llvm.org/ce/z/c5y3BC
- abs(X) -- https://alive2.llvm.org/ce/z/yxXGz_
https://alive2.llvm.org/ce/z/rSRg4K
- uadd_sat(X, Y) -- https://alive2.llvm.org/ce/z/Zw-y4W
https://alive2.llvm.org/ce/z/2NRqRz
https://alive2.llvm.org/ce/z/M1OpF8
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D142828
|
|
knowing upper bits to be zero
These two BMI pattern will clear the upper bits of result past the
first set bit. So if we know a single bit in `x` is set, we know that
`results[bitwidth - 1, log2(x) + 1] = 0`.
Alive2:
blsmsk: https://alive2.llvm.org/ce/z/a397BS
blsi: https://alive2.llvm.org/ce/z/tsbQhC
Differential Revision: https://reviews.llvm.org/D142271
|
|
The one caller of this function already checked that V isn't a
Constant.
Alternatively, we could remove the check from the caller if reviewers
prefer.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D143677
|
|
Delete the opt intrinsics since they are now identical.
I left the side effects due to user expectations about how these
interact with things like inline assembly or function calls. Or
that they wouldn't be hoisted. I think we should look at other
ways to address thoughs.
If I could, I'd rename them these somehow to distance them from
the vsetvli instruction. In some sense they only query the VL for
a particular SEW and LMUL. They don't guarantee a vsetvli
instruction will be emitted.
Fixes https://github.com/llvm/llvm-project/issues/59359
Reviewed By: rogfer01, kito-cheng
Differential Revision: https://reviews.llvm.org/D143220
|
|
|
|
Resolves a FIXME. We could do even better taking into account SEW/LMUL.
|
|
riscv.vsetvlimax.opt intrinsics.
These are like the intrinsic without opt, but don't have side effects.
Add missing test cases for riscv.vsetvlimax.
|
|
Computing EH-related information was only relevant for analysis passes so far. Lifting it to IR will allow the IR Verifier to calculate EH funclet coloring and validate funclet operand bundles in a follow-up step.
Reviewed By: rnk, compnerd
Differential Revision: https://reviews.llvm.org/D138122
|
|
As discussed in https://github.com/llvm/llvm-project/issues/59901
This change is not NFC. There is one SCEV and EarlyCSE test that have an
improved analysis/optimization case. Rest of the tests are not failing.
I've mostly only added cleanup to SCEV since that is where this issue
started. As a follow up, I believe there is more cleanup opportunity in
SCEV and other affected passes.
There could be cases where there are missed registerAssumption of
guards, but this case is not so bad because there will be no
miscompilation. AssumptionCacheTracker should take care of deleted
guards.
Differential Revision: https://reviews.llvm.org/D142330
|
|
|
|
|
|
In canCreateUndefOrPoison(), take not only poison-generating flags,
but also poison-generating metadata into account. The helpers are
written generically, but I believe the only case that can actually
matter is !range on calls -- !nonnull and !align are only valid on
loads, and those can create undef/poison anyway.
Unfortunately, this negatively impacts logical to bitwise and/or
conversion: For ctpop/ctlz/cttz we always attach !range metadata,
which will now block the transform, because it might introduce
poison. It would be possible to recover this regression by supporting
a ConsiderFlagsAndMetadata=false mode in impliesPoison() and clearing
flags/metadata on visited instructions.
Fixes https://github.com/llvm/llvm-project/issues/59888.
Differential Revision: https://reviews.llvm.org/D142115
|
|
These should obviously preserve the sign although the variety of these
always confuses me.
|
|
This change is one of a series to implement the discussion from
https://reviews.llvm.org/D141134.
|
|
This change is one of a series to implement the discussion from
https://reviews.llvm.org/D141134.
|
|
If we know that X & Pow2 != 0, then the bit at that position is
known one.
Differential Revision: https://reviews.llvm.org/D140851
|
|
Use deduction guides instead of helper functions.
The only non-automatic changes have been:
1. ArrayRef(some_uint8_pointer, 0) needs to be changed into ArrayRef(some_uint8_pointer, (size_t)0) to avoid an ambiguous call with ArrayRef((uint8_t*), (uint8_t*))
2. CVSymbol sym(makeArrayRef(symStorage)); needed to be rewritten as CVSymbol sym{ArrayRef(symStorage)}; otherwise the compiler is confused and thinks we have a (bad) function prototype. There was a few similar situation across the codebase.
3. ADL doesn't seem to work the same for deduction-guides and functions, so at some point the llvm namespace must be explicitly stated.
4. The "reference mode" of makeArrayRef(ArrayRef<T> &) that acts as no-op is not supported (a constructor cannot achieve that).
Per reviewers' comment, some useless makeArrayRef have been removed in the process.
This is a follow-up to https://reviews.llvm.org/D140896 that introduced
the deduction guides.
Differential Revision: https://reviews.llvm.org/D140955
|
|
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D140796
|
|
The way these APIs are used, there isn't really a benefit to
deduplicating the ops as part of the API. The only place that
benefits from this is PoisonChecking, and for that particular
use the assertion emission was potentially non-deterministic.
We should populate a vector for deterministic order and then
deduplicate via a separate set.
|
|
We were already treating branch on poison as UB, but branch on
undef is also UB. Move the checks into the correct function.
From LangRef for br:
> If ‘cond’ is poison or undef, this instruction has undefined behavior.
From LangRef for switch:
> If ‘value’ is poison or undef, this instruction has undefined behavior.
There is a minor regression in dont-distribute-phi.ll, apparently
we handle that pattern in logical but not bitwise form.
|
|
This has been enabled by default without issue for a while now,
remove the flag.
|
|
These need to consider the shift amount.
|
|
|
|
|
|
Add a comment and some negative tests. I'd like to have test coverage
and explicit handling of all the math operations for clarity.
|
|
|
|
|
|
|
|
|
|
This patch updates propgatesPoison to take a Use as argument and
propagatesPoison now returns true if the passed in operand causes the
user to yield poison if the operand is poison
This allows propagating poison if the condition of a select is poison.
This helps improve results for programUndefinedIfUndefOrPoison.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D111643
|
|
These files no longer use llvm::Optional.
|
|
|
|
The 1st try was not clean because a portion of the code diff
made it into the pre-commit patch to add tests. This should
be the same end result without the muddied code diff.
Original commit message:
In cases with matching extends, this allows changing an 'add'
into an 'or' and narrowing the 'or' which then simplifies to
a constant.
In cases with opposite extends, we just convert to an 'or'
currently, but that could be reduced too.
https://alive2.llvm.org/ce/z/fTHzdb
|
|
This reverts commit c8cba0bc4a8c9f4f3f10e17f601ed924dfb82bef.
An unintended code change snuck into this (was supposed to just add tests).
|
|
This reverts commit 7520d187cf0dedcf5085f71bc1a5472c75cc8dbb.
The pre-commit patch that was supposed to NFC add tests for this
patch picked up some code that should not be here. I'll clean up
and re-commit.
|
|
In cases with matching extends, this allows changing an 'add'
into an 'or' and narrowing the 'or' which then simplifies to
a constant.
In cases with opposite extends, we just convert to an 'or'
currently, but that could be reduced too.
https://alive2.llvm.org/ce/z/fTHzdb
|
|
|
|
Probably could replace the switch by marking the intrinsic definitions
with NoUndef<RetIndex>.
|
|
Differential Revision: https://reviews.llvm.org/D139789
|
|
These source files no longer use None, so they do not need to include
None.h.
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
|
|
|
|
I tried to test the fallthrough to noundef callsite return attribute
case, but it seems that folds out as-is.
|
|
Handle canonicalize and arithmetic.fence
|
|
|
|
|
|
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
|
|
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
|
|
|
|
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
|
|
The last uses of getInverseMinMaxPred were removed on February 24,
2022 in commit 5423b0a52567b2fba8cbae3afee760f53c3f14d2.
|