[llvm] 82e2575 - [InstCombine] fix power of two examples (#230814)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 10 11:11:36 PDT 2026
Author: Andreas Jonson
Date: 2026-10-10T20:11:31+02:00
New Revision: 82e2575e82838b5874df8e6a163eef1c704514af
URL: https://github.com/llvm/llvm-project/commit/82e2575e82838b5874df8e6a163eef1c704514af
DIFF: https://github.com/llvm/llvm-project/commit/82e2575e82838b5874df8e6a163eef1c704514af.diff
LOG: [InstCombine] fix power of two examples (#230814)
Added:
Modified:
llvm/docs/InstCombineContributorGuide.md
Removed:
################################################################################
diff --git a/llvm/docs/InstCombineContributorGuide.md b/llvm/docs/InstCombineContributorGuide.md
index e0f6f19c93190..a6362175a9179 100644
--- a/llvm/docs/InstCombineContributorGuide.md
+++ b/llvm/docs/InstCombineContributorGuide.md
@@ -269,12 +269,12 @@ call void @llvm.assume(i1 %nonneg)
; %x is a power of two:
%ctpop = call i8 @llvm.ctpop.i8(i8 %x)
-%pow2 = icmp eq i8 %x, 1
+%pow2 = icmp eq i8 %ctpop, 1
call void @llvm.assume(i1 %pow2)
; %x is a power of two or zero:
%ctpop = call i8 @llvm.ctpop.i8(i8 %x)
-%pow2orzero = icmp ult i8 %x, 2
+%pow2orzero = icmp ult i8 %ctpop, 2
call void @llvm.assume(i1 %pow2orzero)
; Adding %x and %y does not overflow in a signed sense:
More information about the llvm-commits
mailing list