[PATCH] D64707: [x86] try harder to form LEA from ADD to avoid flag conflicts (PR40483)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 14 13:00:08 PDT 2019


spatel marked an inline comment as done.
spatel added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:2487
+    };
+    if (isMathWithFlags(N.getOperand(0)) && isMathWithFlags(N.getOperand(1)))
+      Complexity++;
----------------
grandinj wrote:
> Should this not be an || condition ?
It could be || (and I tried that initially), but I saw possible regressions (missed load folding) with that logic.

Given that this is a heuristic, it's hard to determine statically when it will be profitable. 

Ok if I add a TODO comment about extending this in a follow-up patch? If we can recover the load folding, I agree that using || would be better.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64707/new/

https://reviews.llvm.org/D64707





More information about the llvm-commits mailing list