-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[mlir][NFC] Use getDefiningOp<OpTy>()
instead of dyn_cast<OpTy>(getDefiningOp())
#150428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
BTW, we could do a similar cleanup for |
Great, I'm glad to do that in another PR. Thanks for your advice. |
…tDefiningOp())` This PR uses `val.getDefiningOp<OpTy>()` to replace `dyn_cast<OpTy>(val.getDefiningOp())` , `dyn_cast_or_null<OpTy>(val.getDefiningOp())` and `dyn_cast_if_present<OpTy>(val.getDefiningOp())`.
df7a99f
to
766bb8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice cleanup!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
It would be great to have a clang-tidy check for this.
…OpTy>(getDefiningOp())` (llvm#150428)" seems to break declare-target-and-explicit-map declare-target-and-implicit-and-explicit-map declare-target-link-1 declare-target-link-2 declare-target-link-3 This reverts commit f047b73.
…Op()) (NFC) This applies similar changes to llvm/llvm-project#150428
…tDefiningOp())` (llvm#150428) This PR uses `val.getDefiningOp<OpTy>()` to replace `dyn_cast<OpTy>(val.getDefiningOp())` , `dyn_cast_or_null<OpTy>(val.getDefiningOp())` and `dyn_cast_if_present<OpTy>(val.getDefiningOp())`.
…Op()) (NFC) This applies similar changes to llvm/llvm-project#150428
…Op()) (NFC) This applies similar changes to llvm/llvm-project#150428
…Op()) (NFC) (#1765) This applies similar changes to llvm/llvm-project#150428
…Op()) (NFC) This applies similar changes to #150428
…Op()) (NFC) This applies similar changes to #150428
…getDefiningOp()) (NFC) (#151217) This applies similar changes to llvm/llvm-project#150428
…Op()) (NFC) (llvm#1765) This applies similar changes to llvm#150428
This PR uses
val.getDefiningOp<OpTy>()
to replacedyn_cast<OpTy>(val.getDefiningOp())
,dyn_cast_or_null<OpTy>(val.getDefiningOp())
anddyn_cast_if_present<OpTy>(val.getDefiningOp())
.