aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/PowerPC
diff options
context:
space:
mode:
authorPaul Walker <paul.walker@arm.com>2025-09-19 13:15:57 +0100
committerGitHub <noreply@github.com>2025-09-19 13:15:57 +0100
commitb7e4edca3d56ec87f719c202f5397b245595f7cc (patch)
tree15bd891c06922eb1f7e76125613a5921b31c471d /llvm/lib/Target/PowerPC
parenteed99d50086c730c6422b566d9f82d4babdfa5bd (diff)
downloadllvm-b7e4edca3d56ec87f719c202f5397b245595f7cc.zip
llvm-b7e4edca3d56ec87f719c202f5397b245595f7cc.tar.gz
llvm-b7e4edca3d56ec87f719c202f5397b245595f7cc.tar.bz2
[LLVM][CodeGen] Update PPCFastISel::SelectRet for ConstantInt based vectors. (#159331)
The current implementation assumes ConstantInt return values are scalar, which is not true when use-constant-int-for-fixed-length-splat is enabled.
Diffstat (limited to 'llvm/lib/Target/PowerPC')
-rw-r--r--llvm/lib/Target/PowerPC/PPCFastISel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCFastISel.cpp b/llvm/lib/Target/PowerPC/PPCFastISel.cpp
index 0b68ba1..ea4e597 100644
--- a/llvm/lib/Target/PowerPC/PPCFastISel.cpp
+++ b/llvm/lib/Target/PowerPC/PPCFastISel.cpp
@@ -1707,7 +1707,8 @@ bool PPCFastISel::SelectRet(const Instruction *I) {
// Special case for returning a constant integer of any size - materialize
// the constant as an i64 and copy it to the return register.
- if (const ConstantInt *CI = dyn_cast<ConstantInt>(RV)) {
+ if (isa<ConstantInt>(RV) && RV->getType()->isIntegerTy()) {
+ const ConstantInt *CI = cast<ConstantInt>(RV);
CCValAssign &VA = ValLocs[0];
Register RetReg = VA.getLocReg();