Skip to content

Commit 774d9c9

Browse files
committed
Only reference _fltused for floating point, not vectors of floating point
1 parent 8cf3b98 commit 774d9c9

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

llvm/lib/Target/X86/X86AsmPrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,11 +1002,11 @@ static bool usesMSVCFloatingPoint(const Triple &TT, const Module &M) {
10021002

10031003
for (const Function &F : M) {
10041004
for (const Instruction &I : instructions(F)) {
1005-
if (I.getType()->isFPOrFPVectorTy())
1005+
if (I.getType()->isFloatingPointTy())
10061006
return true;
10071007

10081008
for (const auto &Op : I.operands()) {
1009-
if (Op->getType()->isFPOrFPVectorTy())
1009+
if (Op->getType()->isFloatingPointTy())
10101010
return true;
10111011
}
10121012
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
; The purpose of this test to verify that the fltused symbol is
2+
; not emitted when purely vector floating point operations are used on Windows.
3+
4+
; RUN: llc < %s -mtriple i686-pc-win32 | FileCheck %s --check-prefix WIN32
5+
; RUN: llc < %s -mtriple x86_64-pc-win32 | FileCheck %s --check-prefix WIN64
6+
; RUN: llc < %s -O0 -mtriple i686-pc-win32 | FileCheck %s --check-prefix WIN32
7+
; RUN: llc < %s -O0 -mtriple x86_64-pc-win32 | FileCheck %s --check-prefix WIN64
8+
9+
@foo = external dso_local global [4 x float], align 16
10+
11+
; Function Attrs: noinline nounwind optnone sspstrong uwtable
12+
define dso_local <4 x float> @func() #0 {
13+
entry:
14+
%__p.addr.i = alloca ptr, align 8
15+
%vector1 = alloca <4 x float>, align 16
16+
store ptr @foo, ptr %__p.addr.i, align 8
17+
%0 = load ptr, ptr %__p.addr.i, align 8
18+
%1 = load <4 x float>, ptr %0, align 16
19+
store <4 x float> %1, ptr %vector1, align 16
20+
%2 = load <4 x float>, ptr %vector1, align 16
21+
ret <4 x float> %2
22+
}
23+
24+
define <4 x float> @mul_vectors(<4 x float> %a, <4 x float> %b) {
25+
entry:
26+
%result = fmul <4 x float> %a, %b
27+
ret <4 x float> %result
28+
}
29+
30+
; _fltused is determined at a module level
31+
; WIN32-NOT: .globl __fltused
32+
; WIN64-NOT: .globl _fltused

0 commit comments

Comments
 (0)