[llvm] [VectorCombine] Fold bitcast(bitreverse(bitcast(x))) to fshl+bitreverse (PR #214362)

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 05:02:20 PDT 2026


================
@@ -6146,9 +6159,12 @@ bool VectorCombine::foldBitOrderReverseAndSwap(Instruction &I) {
                                 TTI.getInstructionCost(InnerCall, CostKind) +
                                 TTI.getInstructionCost(&I, CostKind);
       IntrinsicCostAttributes ICABSwap(Intrinsic::bswap, Ty, {Ty});
+      IntrinsicCostAttributes ICABFshl(Intrinsic::fshl, Ty, {Ty, Ty, Ty});
----------------
bjope wrote:

Nice idea. I've made sure the argument values are provided to the cost analysis now.

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


More information about the llvm-commits mailing list