[PATCH] D114499: [GlobalISel] Fold or of shifts to funnel shifts.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 24 07:39:15 PST 2021


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:3882
+  // TODO: Handle vector types.
+  // Match (or (shl x, amt), (lshr y, sub(bw, amt)).
+  if (mi_match(Dst, MRI,
----------------
Missing right paren after `sub(bw, amt)`.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:3890
+
+    // Match (or (shl x, sub(bw, amt), (lshr y, amt)).
+  } else if (mi_match(
----------------
Missing right paren after `sub(bw, amt)`.


================
Comment at: llvm/test/CodeGen/AMDGPU/GlobalISel/combine-fsh.mir:17
+    ; CHECK-NEXT: %bw:_(s32) = G_CONSTANT i32 32
+    ; CHECK-NEXT: %or:_(s32) = G_FSHL %a, %b, %bw(s32)
+    ; CHECK-NEXT: $vgpr3 = COPY %or(s32)
----------------
Huh? The funnel shift amount should surely be %amt not %bw.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114499



More information about the llvm-commits mailing list