diff options
author | River Riddle <riddleriver@gmail.com> | 2020-03-12 14:06:41 -0700 |
---|---|---|
committer | River Riddle <riddleriver@gmail.com> | 2020-03-12 14:26:15 -0700 |
commit | 0ddba0bd59c337f16b51a00cb205ecfda46f97fa (patch) | |
tree | be1aaf1254f0c625d48ba66270d69b0db8b38a2e /mlir/lib/TableGen/SideEffects.cpp | |
parent | 907403f342fe661b590f930a83f940c67b3ff855 (diff) | |
download | llvm-0ddba0bd59c337f16b51a00cb205ecfda46f97fa.zip llvm-0ddba0bd59c337f16b51a00cb205ecfda46f97fa.tar.gz llvm-0ddba0bd59c337f16b51a00cb205ecfda46f97fa.tar.bz2 |
[mlir][SideEffects] Replace HasNoSideEffect with the memory effect interfaces.
HasNoSideEffect can now be implemented using the MemoryEffectInterface, removing the need to check multiple things for the same information. This also removes an easy foot-gun for users as 'Operation::hasNoSideEffect' would ignore operations that dynamically, or recursively, have no side effects. This also leads to an immediate improvement in some of the existing users, such as DCE, now that they have access to more information.
Differential Revision: https://reviews.llvm.org/D76036
Diffstat (limited to 'mlir/lib/TableGen/SideEffects.cpp')
-rw-r--r-- | mlir/lib/TableGen/SideEffects.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mlir/lib/TableGen/SideEffects.cpp b/mlir/lib/TableGen/SideEffects.cpp index 0b334b8..7fbeffa 100644 --- a/mlir/lib/TableGen/SideEffects.cpp +++ b/mlir/lib/TableGen/SideEffects.cpp @@ -20,12 +20,8 @@ StringRef SideEffect::getName() const { return def->getValueAsString("effect"); } -StringRef SideEffect::getBaseName() const { - return def->getValueAsString("baseEffect"); -} - -StringRef SideEffect::getInterfaceTrait() const { - return def->getValueAsString("interfaceTrait"); +StringRef SideEffect::getBaseEffectName() const { + return def->getValueAsString("baseEffectName"); } StringRef SideEffect::getResource() const { @@ -46,6 +42,10 @@ Operator::var_decorator_range SideEffectTrait::getEffects() const { return {listInit->begin(), listInit->end()}; } +StringRef SideEffectTrait::getBaseEffectName() const { + return def->getValueAsString("baseEffectName"); +} + bool SideEffectTrait::classof(const OpTrait *t) { return t->getDef().isSubClassOf("SideEffectsTraitBase"); } |