[llvm] [SimplifyCFG] Supporting hoisting/sinking callbases with differing attrs (PR #109472)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 12:16:39 PDT 2024


================
@@ -881,16 +881,19 @@ class Instruction : public User,
   /// This is like isIdenticalTo, except that it ignores the
   /// SubclassOptionalData flags, which may specify conditions under which the
   /// instruction's result is undefined.
-  bool isIdenticalToWhenDefined(const Instruction *I) const LLVM_READONLY;
+  bool isIdenticalToWhenDefined(const Instruction *I,
+                                bool IgnoreAttrs = false) const LLVM_READONLY;
----------------
nikic wrote:

I think it would be more useful if this flag controlled whether the comparison is done strictly or via intersection.

(I was initially going to suggest that isIdenticalToWhenDefined should unconditionally use intersection as part of its "when defined" semantics and andIRFlags should handle call attribute intersection. And while that may be the best end state, I do think phasing this in as a flag first is preferable.)

https://github.com/llvm/llvm-project/pull/109472


More information about the llvm-commits mailing list