aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorLuke Lau <luke@igalia.com>2025-05-21 09:24:11 +0100
committerGitHub <noreply@github.com>2025-05-21 09:24:11 +0100
commitd827588c36131c342fe3602a2876b40efc39638a (patch)
tree1ed6932d22e5632316ae1236531e432ef3386ff9 /flang/lib/Frontend/CompilerInvocation.cpp
parentf4cebe5d73c24ab53917bd58aedc9db892a164ae (diff)
downloadllvm-d827588c36131c342fe3602a2876b40efc39638a.zip
llvm-d827588c36131c342fe3602a2876b40efc39638a.tar.gz
llvm-d827588c36131c342fe3602a2876b40efc39638a.tar.bz2
[VectorCombine] Scalarize binop-like intrinsics (#138095)
Currently VectorCombine can scalarize vector compares and binary ops. This extends it to also scalarize binary-op like intrinsics like umax, minnum etc. The motivation behind this is to scalarize more intrinsics in VectorCombine rather than in DAGCombine, so we can sink splats across basic blocks: see #137786 This currently has very little effect on generated code because InstCombine doesn't yet canonicalize binary intrinsics where one operand is a constant into the form that VectorCombine expects, i.e. `binop (shuffle insert) const --> shuffle (binop insert const)`. The plan is to land this first and then in a subsequent patch teach InstCombine to do the canonicalization to avoid regressions in the meantime. This uses `isTriviallyVectorizable` to determine whether or not an intrinsic is safe to scalarize. There's also `isTriviallyScalarizable`, but this seems more geared towards the Scalarizer pass and includes intrinsics with multiple return values. It also only handles intrinsics with two operands with the same type as the return type. In the future we would generalize this to handle arbitrary numbers of operands, including unary operators too, e.g. fneg or fma, as well as different operand types, e.g. powi or scmp
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions