Skip to content

Conversation

@arsenm
Copy link
Contributor

@arsenm arsenm commented Nov 3, 2025

Match the IR type that clang uses here: https://godbolt.org/z/KzbodEcxh

This was manually selecting the IR legal type. Instead just set the
flag to ensure legal types.

Match the IR type that clang uses here: https://godbolt.org/z/KzbodEcxh

This was manually selecting the IR legal type. Instead just set the
flag to ensure legal types.
@arsenm arsenm added the backend:X86 label Nov 3, 2025 — with Graphite App
Copy link
Contributor Author

arsenm commented Nov 3, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@arsenm arsenm marked this pull request as ready for review November 3, 2025 21:38
@llvmbot
Copy link
Member

llvmbot commented Nov 3, 2025

@llvm/pr-subscribers-backend-x86

Author: Matt Arsenault (arsenm)

Changes

Match the IR type that clang uses here: https://godbolt.org/z/KzbodEcxh

This was manually selecting the IR legal type. Instead just set the
flag to ensure legal types.


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

1 Files Affected:

  • (modified) llvm/lib/Target/X86/X86ISelLowering.cpp (+3-2)
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 133406bd8e0d7..575290d100200 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -33034,12 +33034,13 @@ static SDValue LowerFSINCOS(SDValue Op, const X86Subtarget &Subtarget,
       DAG.getExternalSymbol(LibcallName, TLI.getPointerTy(DAG.getDataLayout()));
 
   Type *RetTy = isF64 ? (Type *)StructType::get(ArgTy, ArgTy)
-                      : (Type *)FixedVectorType::get(ArgTy, 4);
+                      : (Type *)FixedVectorType::get(ArgTy, 2);
 
   TargetLowering::CallLoweringInfo CLI(DAG);
   CLI.setDebugLoc(dl)
       .setChain(DAG.getEntryNode())
-      .setLibCallee(CallingConv::C, RetTy, Callee, std::move(Args));
+      .setLibCallee(CallingConv::C, RetTy, Callee, std::move(Args))
+      .setIsPostTypeLegalization();
 
   std::pair<SDValue, SDValue> CallResult = TLI.LowerCallTo(CLI);
 

Copy link
Collaborator

@RKSimon RKSimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arsenm arsenm merged commit ecaaebf into main Nov 3, 2025
14 checks passed
@arsenm arsenm deleted the users/arsenm/x86/sincos-stret-abi-ir-type-cleanup branch November 3, 2025 22:20
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.

4 participants