[all-commits] [llvm/llvm-project] f43aaf: [NFC][LLVM] Refactor IRBuilder::Create{VScale, Elem...

Paul Walker via All-commits all-commits at lists.llvm.org
Tue Jun 10 04:36:21 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f43aaf90df6153f39c6cfd3471fec5dea1a0b650
      https://github.com/llvm/llvm-project/commit/f43aaf90df6153f39c6cfd3471fec5dea1a0b650
  Author: Paul Walker <paul.walker at arm.com>
  Date:   2025-06-10 (Tue, 10 Jun 2025)

  Changed paths:
    M clang/lib/CodeGen/TargetBuiltins/ARM.cpp
    M llvm/include/llvm/IR/IRBuilder.h
    M llvm/lib/CodeGen/ExpandVectorPredication.cpp
    M llvm/lib/IR/IRBuilder.cpp
    M llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
    M llvm/lib/Transforms/Utils/LowerVectorIntrinsics.cpp
    M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
    M llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp
    M llvm/unittests/IR/IRBuilderTest.cpp

  Log Message:
  -----------
  [NFC][LLVM] Refactor IRBuilder::Create{VScale,ElementCount,TypeSize}. (#142803)

CreateVScale took a scaling parameter that had a single use outside of
IRBuilder with all other callers having to create a redundant
ConstantInt. To work round this some code perferred to use
CreateIntrinsic directly.

This patch simplifies CreateVScale to return a call to the llvm.vscale()
intrinsic and nothing more. As well as simplifying the existing call
sites I've also migrated the uses of CreateIntrinsic.

Whilst IRBuilder used CreateVScale's scaling parameter as part of the
implementations of CreateElementCount and CreateTypeSize, I have
follow-on work to switch them to the NUW varaiety and thus they would
stop using CreateVScale's scaling as well. To prepare for this I have
moved the multiplication and constant folding into the implementations
of CreateElementCount and CreateTypeSize.

As a final step I have replaced some callers of CreateVScale with
CreateElementCount where it's clear from the code they wanted the
latter.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list