[all-commits] [llvm/llvm-project] bba595: [MLIR] Fix an assert that contains a mistake in co...
Shivam Gupta via All-commits
all-commits at lists.llvm.org
Mon Jun 17 12:39:51 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: bba5951b6f9cd77047cafc554b20144b33602298
https://github.com/llvm/llvm-project/commit/bba5951b6f9cd77047cafc554b20144b33602298
Author: Shivam Gupta <shivam98.tkg at gmail.com>
Date: 2024-06-18 (Tue, 18 Jun 2024)
Changed paths:
M mlir/lib/Dialect/SparseTensor/Transforms/Utils/LoopEmitter.cpp
Log Message:
-----------
[MLIR] Fix an assert that contains a mistake in conditional operator (#95668)
This is described in (N2) https://pvs-studio.com/en/blog/posts/cpp/1126/
so caught by the PVS Studio analyzer.
Warning message -
V502 Perhaps the '?:' operator works in a different way than it was
expected. The '?:' operator has a lower priority than the '+' operator.
LoopEmitter.cpp 983
V502 Perhaps the '?:' operator works in a different way than it was
expected. The '?:' operator has a lower priority than the '+' operator.
LoopEmitter.cpp 1039
The assert should be
assert(bArgs.size() == reduc.size() + (needsUniv ? 1 : 0));
since + has higher precedence and ? has lower.
This further can be reduce to
assert(aArgs.size() == reduc.size() + needsUniv);
because needUniv is a bool value which is implicitly converted to 0 or
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list