[PATCH] D56052: X86DAGToDAGISel::matchBitExtract() with truncation (PR36419)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 15 11:38:08 PST 2019


lebedev.ri added inline comments.


================
Comment at: lib/Target/X86/X86ISelDAGToDAG.cpp:2954
+  if (!Subtarget->hasBMI2() && X.getOpcode() == ISD::TRUNCATE &&
+      checkOneUse(X) && X.getOperand(0).getOpcode() == ISD::SRL) {
+    assert(NVT == MVT::i32 && "Expected target valuetype to be i32");
----------------
craig.topper wrote:
> Just use X.hasOneUse()? There's a special case in checkOneUse for hasBMI2, but that doesnt' apply here. So let's just write the most direct thing
Right.
I was going for consistency so one would not wonder why this would be using `hasOneUse()`,
while others would be using those helper lambdas.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D56052





More information about the llvm-commits mailing list