Skip to content

Conversation

@AZero13
Copy link
Contributor

@AZero13 AZero13 commented Jul 5, 2025

Unlike AArch64, here it seems types can be not MVT::i32

@AZero13
Copy link
Contributor Author

AZero13 commented Jul 5, 2025

@davemgreen

@llvmbot
Copy link
Member

llvmbot commented Jul 5, 2025

@llvm/pr-subscribers-backend-arm

Author: AZero13 (AZero13)

Changes

Unlike AArch64, here it seems types can be not MVT::i32


Full diff: https://github.com/llvm/llvm-project/pull/147159.diff

1 Files Affected:

  • (modified) llvm/lib/Target/ARM/ARMISelLowering.cpp (+1-1)
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 2d73725291d11..f556647ae1f20 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -5527,7 +5527,7 @@ SDValue ARMTargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const {
   ConstantSDNode *CFVal = dyn_cast<ConstantSDNode>(FalseVal);
   ConstantSDNode *CTVal = dyn_cast<ConstantSDNode>(TrueVal);
   ConstantSDNode *RHSC = dyn_cast<ConstantSDNode>(RHS);
-  if (Op.getValueType().isInteger()) {
+  if (LHS.getValueType() == MVT::i32 && RHS.getValueType() == MVT::i32) {
     // Check for sign pattern (SELECT_CC setgt, iN lhs, -1, 1, -1) and transform
     // into (OR (ASR lhs, N-1), 1), which requires less instructions for the
     // supported types.

@davemgreen
Copy link
Collaborator

Do you have a test case? i32 is the only legal type, AFAIU.

@AZero13
Copy link
Contributor Author

AZero13 commented Jul 6, 2025

Do you have a test case? i32 is the only legal type, AFAIU.

I don't know if that's the case given this

#146565

@AZero13 AZero13 closed this Jul 9, 2025
@AZero13 AZero13 deleted the i32 branch July 9, 2025 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants