From edda29d423d4c6bd558c6c98af50be475e1384a1 Mon Sep 17 00:00:00 2001 From: Chen-Yu Yang Date: Sat, 9 May 2026 12:12:33 -0400 Subject: [PATCH] remove UOp.cast count 1 special case [pr] --- tinygrad/uop/ops.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tinygrad/uop/ops.py b/tinygrad/uop/ops.py index d62f9c9db2385..e6f835a8c05bb 100644 --- a/tinygrad/uop/ops.py +++ b/tinygrad/uop/ops.py @@ -448,8 +448,6 @@ def broadcast(self, count:int): if count == 1: return self return UOp(Ops.STACK, self.dtype.vec(count), (self,)*count) def cast(self, dtype:DType): - # TODO: we shouldn't have to check for dtype.count == 1 here, but CAST is misused in AMD LLVM - if dtype.count == 1 and dtype.count != self.dtype.count: dtype = dtype.vec(self.dtype.count) if self.dtype == dtype: return self return UOp(Ops.CAST, dtype, (self,)) def bitcast(self, dtype:DType): return self if self.dtype == dtype else UOp(Ops.BITCAST, dtype, (self,))