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

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 03:18:22 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});
----------------
dtcxzyw wrote:

Passing a constant BW / 2 should be fine.


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


More information about the llvm-commits mailing list