Skip to content

Commit bcd08f4

Browse files
authored
[mlir][llvmir] Add SameOperandsAndResultType trait to LLVM_CountZerosIntrOp (llvm#131133)
According to https://llvm.org/docs/LangRef.html#llvm-ctlz-intrinsic and https://llvm.org/docs/LangRef.html#llvm-cttz-intrinsic, The return type of `llvm.intr.ctlz` and `llvm.intr.cttz` must match the first argument type.
1 parent c482b8f commit bcd08f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class LLVM_TernarySameArgsIntrOpF<string func, list<Trait> traits = []> :
8686

8787
class LLVM_CountZerosIntrOp<string func, list<Trait> traits = []> :
8888
LLVM_OneResultIntrOp<func, [], [0],
89-
!listconcat([Pure], traits),
89+
!listconcat([Pure, SameOperandsAndResultType], traits),
9090
/*requiresFastmath=*/0,
9191
/*immArgPositions=*/[1], /*immArgAttrNames=*/["is_zero_poison"]> {
9292
let arguments = (ins LLVM_ScalarOrVectorOf<AnySignlessInteger>:$in,

0 commit comments

Comments
 (0)