[PATCH] D130339: [CodeGen] Generate efficient assembly for freeze(poison) version of `mm*_cast*` intel intrinsics

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 09:20:25 PDT 2022


aqjune marked 3 inline comments as done.
aqjune added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:11433
+                        : (NumFreezeUndef ? DAG.getFreeze(DAG.getUNDEF(ResVT))
+                                          : DAG.getUNDEF(ResVT));
 
----------------
RKSimon wrote:
> Is there any reason we couldn't just always use DAG.getFreeze(DAG.getUNDEF(ResVT)) ?
I tried using `DAG.getFreeze(DAG.getUNDEF(ResVT))`, and it needs updates in existing lowering functions to make the following tests pass:
```
  LLVM :: CodeGen/X86/haddsub-undef.ll
  LLVM :: CodeGen/X86/oddsubvector.ll
  LLVM :: CodeGen/X86/subvector-broadcast.ll
  LLVM :: CodeGen/X86/vector-interleaved-load-i16-stride-3.ll
...
```
It causes insertion of `vinsert*` instruction instead of efficient ops.
I think it is good to keep `DAG.getUNDEF(ResVT)` to avoid regression.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130339



More information about the llvm-commits mailing list