Skip to content

Commit 34672da

Browse files
committed
address comments
1 parent 197b283 commit 34672da

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,10 @@ static bool foldLibCalls(Instruction &I, TargetTransformInfo &TTI,
14581458
}
14591459

14601460
/// Match low part of 128-bit multiplication.
1461+
///
1462+
/// Use counts are checked to prevent total instruction count increase as per
1463+
/// contributors guide:
1464+
/// https://llvm.org/docs/InstCombineContributorGuide.html#multi-use-handling
14611465
static bool foldMul128Low(Instruction &I) {
14621466
auto *Ty = I.getType();
14631467
if (!Ty->isIntegerTy(64))
@@ -1529,6 +1533,10 @@ static bool foldMul128Low(Instruction &I) {
15291533
}
15301534

15311535
/// Match high part of 128-bit multiplication.
1536+
///
1537+
/// Use counts are checked to prevent total instruction count increase as per
1538+
/// contributors guide:
1539+
/// https://llvm.org/docs/InstCombineContributorGuide.html#multi-use-handling
15321540
static bool foldMul128High(Instruction &I) {
15331541
auto *Ty = I.getType();
15341542
if (!Ty->isIntegerTy(64))
@@ -1647,6 +1655,10 @@ static bool foldMul128High(Instruction &I) {
16471655
/// %u1_hi = lshr i64 %u1, 32
16481656
/// %u2 = add nuw i64 %u0_hi, %t3
16491657
/// %hw64 = add nuw i64 %u2, %u1_hi
1658+
///
1659+
/// Use counts are checked to prevent total instruction count increase as per
1660+
/// contributors guide:
1661+
/// https://llvm.org/docs/InstCombineContributorGuide.html#multi-use-handling
16501662
static bool foldMul128HighVariant(Instruction &I) {
16511663
auto *Ty = I.getType();
16521664
if (!Ty->isIntegerTy(64))

llvm/test/Transforms/AggressiveInstCombine/umulh.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ define i64 @umulh_variant(i64 %x, i64 %y) {
8484

8585
; Commutative ops should match in any order. Ops where operand order has been
8686
; reversed from above are marked 'commuted'. As per instcombine contributors
87-
; guide, constants are always canonicalized to RHS, so don't both commuting
87+
; guide, constants are always canonicalized to RHS, so don't bother commuting
8888
; constants.
8989
define i64 @umulh__commuted(i64 %x, i64 %y) {
9090
; CHECK-LABEL: define i64 @umulh__commuted(

0 commit comments

Comments
 (0)