[llvm] [X86][GlobalISel] Enable G_BUILD_VECTOR and G_CONSTANT_POOL (PR #92844)

Evgenii Kudriashov via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 13:21:52 PDT 2024


================
@@ -484,6 +498,19 @@ X86LegalizerInfo::X86LegalizerInfo(const X86Subtarget &STI,
       .widenScalarToNextPow2(1);
 
   // vector ops
+  getActionDefinitionsBuilder(G_BUILD_VECTOR)
----------------
e-kud wrote:

Yes. To be honest this is unclear. Lowering `G_BUILD_VECTOR` earlier should allow to combine loads from constant pool. That is too late for instruction selection. However there may be some scenarios when we want to keep `G_BUILD_VECTOR` to combine into something more optimal. I think we should address to this issue later, when we have more complete picture how we want to optimize various shuffles and insertions. Current approach allows to reuse `G_LOAD` C++ implementation for `G_BUILD_VECTOR` instead of writing its own. 


https://github.com/llvm/llvm-project/pull/92844


More information about the llvm-commits mailing list