File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
include/mlir/Dialect/LLVMIR Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -418,7 +418,7 @@ def NVVM_PMEventOp : NVVM_PTXBuilder_Op<"pmevent">,
418418 immediate operand a, in the range 0..15.
419419
420420 With `mask` it triggers one or more of the performance monitor events. Each
421- bit in the 16-bit immediate operand a controls an event.
421+ bit in the 16-bit immediate operand controls an event.
422422
423423 [For more information, see PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#miscellaneous-instructions-pmevent)
424424 }];
@@ -431,7 +431,7 @@ def NVVM_PMEventOp : NVVM_PTXBuilder_Op<"pmevent">,
431431 let assemblyFormat = "attr-dict (`id` `=` $eventId^)? (`mask` `=` $maskedEventId^)?";
432432
433433 let extraClassDeclaration = [{
434- bool hasIntrinsic() { if( getEventId()) return false; return true ; }
434+ bool hasIntrinsic() { return ! getEventId(); }
435435 }];
436436 let extraClassDefinition = [{
437437 std::string $cppClass::getPtx() { return std::string("pmevent %0;"); }
Original file line number Diff line number Diff line change @@ -190,16 +190,18 @@ LogicalResult BulkStoreOp::verify() {
190190}
191191
192192LogicalResult PMEventOp::verify () {
193- if (!getMaskedEventId () && !getEventId ()) {
193+ auto eventId = getEventId ();
194+ auto maskedEventId = getMaskedEventId ();
195+ if (!maskedEventId && !eventId) {
194196 return emitOpError () << " either `id` or `mask` must be set" ;
195197 }
196198
197- if (getMaskedEventId () && getEventId () ) {
199+ if (maskedEventId && eventId ) {
198200 return emitOpError () << " `id` and `mask` cannot be set at the same time" ;
199201 }
200202
201- if (getEventId () ) {
202- if (getEventId () < 0 || getEventId () > 15 ) {
203+ if (eventId ) {
204+ if (eventId < 0 || eventId > 15 ) {
203205 return emitOpError () << " `id` must be between 0 and 15" ;
204206 }
205207 }
You can’t perform that action at this time.
0 commit comments