[llvm-branch-commits] [llvm] [SelectionDAG] Drop unnecessary lower bound check in lowerRangeToAssertZExt (PR #196785)
Iris Shi via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun May 10 03:47:16 PDT 2026
================
@@ -16213,6 +16213,10 @@ SDValue DAGCombiner::visitAssertExt(SDNode *N) {
AssertVT == cast<VTSDNode>(N0.getOperand(1))->getVT())
return N0;
+ // fold (assert?ext c, vt) -> c
+ if (isa<ConstantSDNode>(N0))
+ return N0;
----------------
el-ev wrote:
It turns out to be not enough. In the failing case `llvm.amdgcn.wavefrontsize()` is legalized to a constant after creation, thereby escaping `getNode`.
```
Legalizing: t15: i32 = llvm.amdgcn.wavefrontsize TargetConstant:i64<3656>
... replacing: t15: i32 = llvm.amdgcn.wavefrontsize TargetConstant:i64<3656>
with: t24: i32 = Constant<32>
...
Combining: t17: i32 = AssertZext Constant:i32<32>, ValueType:ch:i7
... into: t18: i32 = Constant<32>
```
https://github.com/llvm/llvm-project/pull/196785
More information about the llvm-branch-commits
mailing list