[PATCH] D59535: [SelectionDAG] Compute known bits of CopyFromReg

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 05:28:42 PDT 2019


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:3181
+  case ISD::CopyFromReg: {
+    const RegisterSDNode *R = cast<RegisterSDNode>(Op.getOperand(1));
+    const unsigned Reg = R->getReg();
----------------
auto R = cast<RegisterSDNode>(Op.getOperand(1));


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:19513
 
-  // If the operand types disagree, extend the shift amount to match.  Since
-  // BT ignores high bits (like shifts) we can use anyextend.
-  if (Src.getValueType() != BitNo.getValueType())
+  // If the operand types disagree, extend or truncate the shift amount to match.
+  // Since BT ignores high bits (like shifts) we can use anyextend for the extension.
----------------
piotr wrote:
> lebedev.ri wrote:
> > Does it trigger any tests without the rest of the diff?
> > Does this *have* to be in the same diff as the other part of the diff?
> The change in X86ISelLowering.cpp, when applied on its own, does not trigger on any of the existing tests. However, when applying the rest of the diff, without the change in X86ISelLowering.cpp, there are two assertions thrown in CodeGen/X86/early-ifcvt.ll and CodeGen/X86/switch.ll. 
> 
> Therefore I think the rest of the diff is necessary to trigger the new condition that is handled here.
DAG.getAnyExtOrTrunc ?


================
Comment at: test/CodeGen/AMDGPU/llvm.amdgcn.s.buffer.load.ll:146
+  ret void
+}
+
----------------
Please commit this with trunk's current codegen and then rebase the patch to show the diff.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59535





More information about the llvm-commits mailing list