[PATCH] D37592: [X86] Move matching of (and (srl/sra, C), (1<<C) - 1) to BEXTR/BEXTRI instruction to custom isel

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 09:17:49 PDT 2017


craig.topper added inline comments.


================
Comment at: lib/Target/X86/X86ISelDAGToDAG.cpp:2190
+  SDValue Tmp0, Tmp1, Tmp2, Tmp3, Tmp4;
+  if (tryFoldLoad(Node, Input, Tmp0, Tmp1, Tmp2, Tmp3, Tmp4)) {
+    SDValue Ops[] = { Tmp0, Tmp1, Tmp2, Tmp3, Tmp4, New, Input.getOperand(0) };
----------------
aymanmus wrote:
> Why do you manually handle the memory folding here instead of letting the regular mechanism take care of that?
The regular mechanism is tablegen patterns and the isel table. But we're bypassing all of that here.

We could be lazy here and let the peephole pass that can also fold memory using the fold folding tables take care of it. But we normally try to fold as much as possible at isel.


https://reviews.llvm.org/D37592





More information about the llvm-commits mailing list