Details
Diff Detail
Event Timeline
Thanks, I can confirm that this fixes my issue in a full rebuild and rerun of the tests!
I've seen some correctness problems caused by D154953 (running Vulkan CTS testing on the AMDGPU target) and I can confirm that this patch fixes them.
Is there any indication why this is necessary? The alive2 proof of the original transform seems to allow for INT_MIN: https://alive2.llvm.org/ce/z/yZ_I2a
Thanks, you are right, and we should prevent the case if the mask value is -1, https://alive2.llvm.org/ce/z/WU_j4a
Can someone follow up on this patch? I'd kinda like the breakage in git main to get fixed - or perhaps we'd need to revert if we can't settle on a fix soon.
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
2022 | What is this change for? Is this part of the bugfix? |
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
2022 | Yes. This is similar to the following logic in line 2045. // A shift left or a logical shift right of a power of two is a power of two // or zero. if (OrZero && (match(V, m_Shl(m_Value(X), m_Value())) || match(V, m_LShr(m_Value(X), m_Value())))) return isKnownToBeAPowerOfTwo(X, /*OrZero*/ true, Depth, Q); This is try to match following code, because we can assume the vscale always bigger than 1, and it is a power of 2 if it has the attribute of vscale_range %vscale = call i64 @llvm.vscale.i64() %shift = shl nuw nsw i64 %vscale, 11 |
hi @goldstein.w.n, because this patch it fixing some correctness problems which block many people, so would you help me to review this in high priority, thanks
sorry for blocking your work, I'll revert that code if I don't land on this fixing today.
LGTM.
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
2022 | But is it related to making the existing codes correct or just improving the coverage? I don't see how its related to the bug. If its not related to the bug, imo it should be split to a seperate patch. |
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
2022 | Thanks very much again. I'll seperate this patch before landing. This change is necessary to match the following code. %vscale = call i64 @llvm.vscale.i64() %shift = shl nuw nsw i64 %vscale, 11 |
What is this change for? Is this part of the bugfix?