[PATCH] D141782: [X86] Don't fold select for vXi1 on X86 target.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 15 06:05:06 PST 2023


lebedev.ri requested changes to this revision.
lebedev.ri added inline comments.
This revision now requires changes to proceed.
Herald added a subscriber: StephenFan.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:34856
     return false;
+  if (!VT.isSimple())
+    return false;
----------------
pengfei wrote:
> lebedev.ri wrote:
> > pengfei wrote:
> > > Should be better to use `isTypeLegal(VT)`?
> > If the problematic case is `vXi1`, then can we just check for the element type?
> > Why is this here?
> I guess it is used to prevent crash in line 34861. Check element type should be fine since we have checked `isVector`.
This part LG.


================
Comment at: llvm/test/CodeGen/X86/fold-select.ll:4
 
 define <8 x float> @select_and_v8i1(<8 x i1> %a, <8 x i1> %b, <8 x i1> %c, <8 x float> %d) {
 ; CHECK-LABEL: select_and_v8i1:
----------------
pengfei wrote:
> I think passing vXi1 from arguments is not a common scenario. vXi1 will be promoted vXi16 during lowering arguments. You should add new test cases that generating vXi1 in the IR, e.g.:
> ```
> %a = icmp eq <8 x i16> %0, %1
> ...
> ```
+1


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141782



More information about the llvm-commits mailing list