- // Finds the properties implied by an equivalence and adds them too.
- // Example: ("seteq %a, %b", true, EQ) --> (%a, %b, EQ)
- // ("seteq %a, %b", false, EQ) --> (%a, %b, NE)
+ void add(Ops Opcode, Value *V1, Value *V2, bool invert) {
+ switch (Opcode) {
+ case EQ:
+ if (invert) addNotEqual(V1, V2);
+ else addEqual(V1, V2);
+ break;
+ case NE:
+ if (invert) addEqual(V1, V2);
+ else addNotEqual(V1, V2);
+ break;
+ default:
+ assert(0 && "Unknown property opcode.");
+ }
+ }
+
+ /// Finds the properties implied by an equivalence and adds them too.
+ /// Example: ("seteq %a, %b", true, EQ) --> (%a, %b, EQ)
+ /// ("seteq %a, %b", false, EQ) --> (%a, %b, NE)