Skip to content

Commit 361db73

Browse files
dtcxzywnikicantoniofrighetto
authored
Apply suggestions from code review
Co-authored-by: Nikita Popov <[email protected]> Co-authored-by: Antonio Frighetto <[email protected]>
1 parent 786495b commit 361db73

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/docs/InstCombineContributorGuide.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ already inherently target-dependent anyway.
406406

407407
If some canonicalization narrow/widen the integer width of expressions, please
408408
check `shouldChangeType()` first. Otherwise, we may evaluate the expression
409-
in illegal/inefficient types. For vector types, follow the instructions below.
409+
in illegal/inefficient types.
410410

411411
For vector-specific transforms that require cost-modelling, the VectorCombine
412412
pass can be used instead. In very rare circumstances, if there are no other
@@ -415,7 +415,7 @@ AggressiveInstCombine.
415415

416416
Generally, we prefer unsigned operations over signed operations in the middle-end, even
417417
if signed operations are more efficient on some targets. The following is an incomplete
418-
list of canonicalizations that implemented in InstCombine:
418+
list of canonicalizations that are implemented in InstCombine:
419419

420420
| Original Pattern | Canonical Form | Condition |
421421
|------------------------------|----------------------------|-------------------------------|
@@ -554,12 +554,12 @@ One-use checks can be performed using the `m_OneUse()` matcher, or the
554554

555555
### Flag handling
556556

557-
When possible, propagate poison-generating flags like `nuw` and `nsw` since they may be
558-
hard to salvage later. If it is not free (e.g. requires additional complexity like `willNotOverflow`
559-
or KnownBits queries), don't do that.
557+
When possible, favour propagation of poison-generating flags like `nuw` and `nsw` since they may be
558+
hard to salvage later. Avoid doing so if it introduces additional complexity (e.g. requires querying `willNotOverflow`
559+
or KnownBits).
560560

561561
Be careful with in-place operand/predicate changes, as poison-generating flags may not be valid for new
562-
operands. It is recommended to create a new instruction with carefully handling of flags. If not
562+
operands. It is recommended to create a new instruction with careful handling of flags. If not
563563
applicable, call `Instruction::dropPoisonGeneratingFlags()` to clear flags in a conservative manner.
564564

565565
Do not rely on fcmp's `nsz` flag to perform optimizations. It is meaningless for fcmp so it should not affect

0 commit comments

Comments
 (0)