[llvm] [AArch64] Improve urem by constant costs (PR #122236)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 07:09:44 PST 2025


================
@@ -893,7 +893,8 @@ TargetTransformInfo::getOperandInfo(const Value *V) {
 
   // Check for a splat of a constant or for a non uniform vector of constants
   // and check if the constant(s) are all powers of two.
-  if (isa<ConstantVector>(V) || isa<ConstantDataVector>(V)) {
+  if (isa<ConstantVector>(V) || isa<ConstantDataVector>(V) ||
+      isa<ConstantExpr>(V)) {
----------------
david-arm wrote:

I wonder if it's worth committing this separately, or is it only exposed with your code changes? I know with the work @paulwalker-arm has been doing on migrating LLVM to use `splat(i32 ...)` for constant splats we should be seeing `ConstantExpr` used a lot more in future.

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


More information about the llvm-commits mailing list