[llvm] [VPlan] Introduce CSE pass (PR #151872)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 4 04:37:15 PDT 2025


================
@@ -122,6 +122,49 @@ void VPDef::dump() const {
 }
 #endif
 
+bool VPValue::isIdenticalTo(const VPValue *Other) const {
+  if (getVPValueID() != Other->getVPValueID() ||
+      hasDefiningRecipe() != Other->hasDefiningRecipe() ||
+      !getUnderlyingValue() != !Other->getUnderlyingValue())
----------------
fhahn wrote:

why do we need to check the underlying values here?

For example, a VPWidenRecipe with w/o an underlying value produces exactly the same value as a VPWidenRecipe with an underlying value and the same opcode + operands.

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


More information about the llvm-commits mailing list