[PATCH] D74165: [x86] [DAGCombine] Prefer shifts of constant widths.

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 1 12:43:17 PST 2020


jlebar added a comment.

@RKSimon and others, thank you for the review and comments.  Sorry for my delay here; this has changed from being my day job to my weekend hobby, and that made a bigger difference in my responsiveness than I'd like or than I expected.

I believe I've addressed all of the comments.  I haven't pushed the tests sans this change just on the principle that I don't want to add tests that might end up being useless (if this patch doesn't land for some reason), but I've rebased this patch atop a commit which adds those tests.  So when I commit this it will be as two patches, one to add the tests as-is, and then another to update the test with this patch.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7446
+  if (SDValue V = visitShiftOrRotate(N))
+    return V;
+
----------------
RKSimon wrote:
> Move these lower down to after SimplifyDemandedBits, we tend to have the constant folding / cleanup combines first.
Done.  This also allowed me to remove the `Level >= AfterLegalizeTypes`, which I never liked.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74165





More information about the llvm-commits mailing list