[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-22 Thread Phoebe Wang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG37d1d02200b9: [X86][MS] Change the alignment of f80 to 16 
bytes on Windows 32bits to match… (authored by pengfei).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

Files:
  clang/lib/Basic/Targets/X86.h
  clang/test/CodeGen/target-data.c
  llvm/lib/IR/AutoUpgrade.cpp
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/test/Bitcode/upgrade-datalayout3.ll
  llvm/test/Bitcode/upgrade-datalayout4.ll
  llvm/test/CodeGen/X86/long-double-abi-align.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
  llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp

Index: llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
===
--- llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
+++ llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
@@ -24,7 +24,7 @@
   EXPECT_EQ(DL1, "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64"
  "-f80:128-n8:16:32:64-S128");
   EXPECT_EQ(DL2, "e-m:w-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64"
- "-f80:32-n8:16:32-S32");
+ "-f80:128-n8:16:32-S32");
   EXPECT_EQ(DL3, "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128"
  "-n32:64-S128");
 
Index: llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
===
--- llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
+++ llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
@@ -909,8 +909,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:flds __real@5f00
 ; X86-AVX512-WIN-NEXT:xorl %edx, %edx
@@ -985,8 +985,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:flds __real@5f00
 ; X86-SSE3-WIN-NEXT:xorl %edx, %edx
@@ -1061,8 +1061,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:flds __real@5f00
 ; X86-SSE2-WIN-NEXT:xorl %edx, %edx
@@ -1161,8 +1161,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:flds __real@5f00
 ; X87-WIN-NEXT:fucom %st(1)
@@ -1235,8 +1235,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:fisttpll (%esp)
 ; X86-AVX512-WIN-NEXT:movl (%esp), %eax
@@ -1275,8 +1275,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:fisttpll (%esp)
 ; X86-SSE3-WIN-NEXT:movl (%esp), %eax
@@ -1315,8 +1315,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X86-SSE2-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
@@ -1379,8 +1379,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X87-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
Index: 

[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-14 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 400231.
pengfei added a comment.

Fix AutoUpgrade bug catched by buildbot.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

Files:
  clang/lib/Basic/Targets/X86.h
  clang/test/CodeGen/target-data.c
  llvm/lib/IR/AutoUpgrade.cpp
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/test/Bitcode/upgrade-datalayout3.ll
  llvm/test/Bitcode/upgrade-datalayout4.ll
  llvm/test/CodeGen/X86/long-double-abi-align.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
  llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp

Index: llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
===
--- llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
+++ llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
@@ -24,7 +24,7 @@
   EXPECT_EQ(DL1, "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64"
  "-f80:128-n8:16:32:64-S128");
   EXPECT_EQ(DL2, "e-m:w-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64"
- "-f80:32-n8:16:32-S32");
+ "-f80:128-n8:16:32-S32");
   EXPECT_EQ(DL3, "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128"
  "-n32:64-S128");
 
Index: llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
===
--- llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
+++ llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
@@ -909,8 +909,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:flds __real@5f00
 ; X86-AVX512-WIN-NEXT:xorl %edx, %edx
@@ -985,8 +985,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:flds __real@5f00
 ; X86-SSE3-WIN-NEXT:xorl %edx, %edx
@@ -1061,8 +1061,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:flds __real@5f00
 ; X86-SSE2-WIN-NEXT:xorl %edx, %edx
@@ -1161,8 +1161,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:flds __real@5f00
 ; X87-WIN-NEXT:fucom %st(1)
@@ -1235,8 +1235,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:fisttpll (%esp)
 ; X86-AVX512-WIN-NEXT:movl (%esp), %eax
@@ -1275,8 +1275,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:fisttpll (%esp)
 ; X86-SSE3-WIN-NEXT:movl (%esp), %eax
@@ -1315,8 +1315,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X86-SSE2-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
@@ -1379,8 +1379,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X87-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
Index: llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
===
--- llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
+++ 

[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-13 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added a comment.

It caused by bug in AutoUpgrade.cpp, fixed on D117270 
.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-12 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added a comment.

I see, I will investigate the reason and do a follow up. Thanks @efriedma and 
@rnk !


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-12 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment.

Right, the auto-upgrade should upgrade and prevent the need to change the 
bitcode data layout. LTO is the main use case for auto-upgrading.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-12 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment.

Not sure I agree with the "fix" to the lld tests.  If the linker is crashing, 
clearly there's a bug, not just an incorrect test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-12 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added a comment.

Should be fixed by rG9b43237128da 
.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-12 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added a comment.

Thanks @fhahn ! I saw the failure. I think it just needs to update the 
datalayout in the lit tests. I am checking on this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-12 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment.

It looks like this may be causing the following bot to fail 
https://lab.llvm.org/buildbot/#/builders/16/builds/22138 with

   TEST 'lld :: COFF/lto-lazy-reference.ll' FAILED 

  Script:
  --
  : 'RUN: at line 2';   
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc 
-mtriple=i686-pc-windows-msvc -filetype=obj -o 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference-quadruple.obj
 
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/lld/test/COFF/Inputs/lto-lazy-reference-quadruple.ll
  : 'RUN: at line 3';   
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llvm-as -o 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference-dummy.bc
 
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/lld/test/COFF/Inputs/lto-lazy-reference-dummy.ll
  : 'RUN: at line 4';   rm -f 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.tmp.lib
  : 'RUN: at line 5';   llvm-ar cru 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.tmp.lib
 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference-quadruple.obj
 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference-dummy.bc
  : 'RUN: at line 6';   
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llvm-as -o 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.tmp.obj
 
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/lld/test/COFF/lto-lazy-reference.ll
  : 'RUN: at line 7';   
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/lld-link 
/out:/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.tmp.exe
 /entry:main /subsystem:console 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.tmp.obj
 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.tmp.lib
  --
  Exit Code: 134
  Command Output (stderr):
  --
  + : 'RUN: at line 2'
  + /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llc 
-mtriple=i686-pc-windows-msvc -filetype=obj -o 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference-quadruple.obj
 
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/lld/test/COFF/Inputs/lto-lazy-reference-quadruple.ll
  + : 'RUN: at line 3'
  + /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llvm-as -o 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference-dummy.bc
 
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/lld/test/COFF/Inputs/lto-lazy-reference-dummy.ll
  + : 'RUN: at line 4'
  + rm -f 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.tmp.lib
  + : 'RUN: at line 5'
  + llvm-ar cru 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.tmp.lib
 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference-quadruple.obj
 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference-dummy.bc
  + : 'RUN: at line 6'
  + /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llvm-as -o 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.tmp.obj
 
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/lld/test/COFF/lto-lazy-reference.ll
  + : 'RUN: at line 7'
  + /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/lld-link 
/out:/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.tmp.exe
 /entry:main /subsystem:console 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.tmp.obj
 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.tmp.lib
  lld-link: 
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/lib/CodeGen/MachineFunction.cpp:207:
 void llvm::MachineFunction::init(): Assertion 
`Target.isCompatibleDataLayout(getDataLayout()) && "Can't create a 
MachineFunction using a Module with a " "Target-incompatible DataLayout 
attached\n"' failed.
  
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.script:
 line 6: 2469401 Aborted 
/b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/lld-link 
/out:/b/1/llvm-clang-x86_64-expensive-checks-debian/build/tools/lld/test/COFF/Output/lto-lazy-reference.ll.tmp.exe
 /entry:main /subsystem:console 

[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-12 Thread Phoebe Wang via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1bb0caf56168: [X86][MS] Change the alignment of f80 to 16 
bytes on Windows 32bits to match… (authored by pengfei).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

Files:
  clang/lib/Basic/Targets/X86.h
  clang/test/CodeGen/target-data.c
  llvm/lib/IR/AutoUpgrade.cpp
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/test/Bitcode/upgrade-datalayout3.ll
  llvm/test/CodeGen/X86/long-double-abi-align.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
  llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp

Index: llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
===
--- llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
+++ llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
@@ -24,7 +24,7 @@
   EXPECT_EQ(DL1, "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64"
  "-f80:128-n8:16:32:64-S128");
   EXPECT_EQ(DL2, "e-m:w-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64"
- "-f80:32-n8:16:32-S32");
+ "-f80:128-n8:16:32-S32");
   EXPECT_EQ(DL3, "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128"
  "-n32:64-S128");
 
Index: llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
===
--- llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
+++ llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
@@ -909,8 +909,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:flds __real@5f00
 ; X86-AVX512-WIN-NEXT:xorl %edx, %edx
@@ -985,8 +985,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:flds __real@5f00
 ; X86-SSE3-WIN-NEXT:xorl %edx, %edx
@@ -1061,8 +1061,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:flds __real@5f00
 ; X86-SSE2-WIN-NEXT:xorl %edx, %edx
@@ -1161,8 +1161,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:flds __real@5f00
 ; X87-WIN-NEXT:fucom %st(1)
@@ -1235,8 +1235,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:fisttpll (%esp)
 ; X86-AVX512-WIN-NEXT:movl (%esp), %eax
@@ -1275,8 +1275,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:fisttpll (%esp)
 ; X86-SSE3-WIN-NEXT:movl (%esp), %eax
@@ -1315,8 +1315,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X86-SSE2-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
@@ -1379,8 +1379,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X87-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
Index: llvm/test/CodeGen/X86/scalar-fp-to-i32.ll

[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-12 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added a comment.

Thanks Craig!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-12 Thread Craig Topper via Phabricator via cfe-commits
craig.topper accepted this revision.
craig.topper added a comment.

LGTM


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-12 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added inline comments.



Comment at: llvm/lib/IR/AutoUpgrade.cpp:4583-4589
+  if (T.isArch64Bit() || !T.isWindowsMSVCEnvironment())
+return Res;
 
-  return (Groups[1] + AddrSpaces + Groups[3]).str();
+  StringRef Ref = Res;
+  auto I = Ref.find("-f80:32-");
+  if (I != StringRef::npos)
+Res = (Ref.take_front(I) + "-f80:128-" + Ref.drop_front(I + 8)).str();

rnk wrote:
> I think the early return here is not helping readability. Please add a 
> comment here about why this upgrade is being done, something like:
> ```
>   // For 32-bit MSVC targets, raise the alignment of f80 values to 16 bytes. 
> Raising the alignment is safe because Clang did not produce f80 values in the 
> MSVC environment before this upgrade was added.
>   if (T.isWindowsMSVCEnvironment() && T.isArch32Bit()) {
>
> ```
> 
That's better. Thanks for the suggestion.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-12 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 399235.
pengfei marked an inline comment as done.
pengfei added a comment.

Add comments in code. @rnk, thanks for your patient review!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

Files:
  clang/lib/Basic/Targets/X86.h
  clang/test/CodeGen/target-data.c
  llvm/lib/IR/AutoUpgrade.cpp
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/test/Bitcode/upgrade-datalayout3.ll
  llvm/test/CodeGen/X86/long-double-abi-align.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
  llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp

Index: llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
===
--- llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
+++ llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
@@ -24,7 +24,7 @@
   EXPECT_EQ(DL1, "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64"
  "-f80:128-n8:16:32:64-S128");
   EXPECT_EQ(DL2, "e-m:w-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64"
- "-f80:32-n8:16:32-S32");
+ "-f80:128-n8:16:32-S32");
   EXPECT_EQ(DL3, "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128"
  "-n32:64-S128");
 
Index: llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
===
--- llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
+++ llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
@@ -909,8 +909,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:flds __real@5f00
 ; X86-AVX512-WIN-NEXT:xorl %edx, %edx
@@ -985,8 +985,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:flds __real@5f00
 ; X86-SSE3-WIN-NEXT:xorl %edx, %edx
@@ -1061,8 +1061,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:flds __real@5f00
 ; X86-SSE2-WIN-NEXT:xorl %edx, %edx
@@ -1161,8 +1161,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:flds __real@5f00
 ; X87-WIN-NEXT:fucom %st(1)
@@ -1235,8 +1235,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:fisttpll (%esp)
 ; X86-AVX512-WIN-NEXT:movl (%esp), %eax
@@ -1275,8 +1275,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:fisttpll (%esp)
 ; X86-SSE3-WIN-NEXT:movl (%esp), %eax
@@ -1315,8 +1315,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X86-SSE2-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
@@ -1379,8 +1379,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X87-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
Index: llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
===
--- 

[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-11 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

I'm happy with this, but I'd like to get an ack from @craig.topper or @efriedma 
about the backwards compatibility concern. I think it's addresed.




Comment at: llvm/lib/IR/AutoUpgrade.cpp:4583-4589
+  if (T.isArch64Bit() || !T.isWindowsMSVCEnvironment())
+return Res;
 
-  return (Groups[1] + AddrSpaces + Groups[3]).str();
+  StringRef Ref = Res;
+  auto I = Ref.find("-f80:32-");
+  if (I != StringRef::npos)
+Res = (Ref.take_front(I) + "-f80:128-" + Ref.drop_front(I + 8)).str();

I think the early return here is not helping readability. Please add a comment 
here about why this upgrade is being done, something like:
```
  // For 32-bit MSVC targets, raise the alignment of f80 values to 16 bytes. 
Raising the alignment is safe because Clang did not produce f80 values in the 
MSVC environment before this upgrade was added.
  if (T.isWindowsMSVCEnvironment() && T.isArch32Bit()) {
   
```



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-08 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 398335.
pengfei added a comment.

Missed one unittest.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

Files:
  clang/lib/Basic/Targets/X86.h
  clang/test/CodeGen/target-data.c
  llvm/lib/IR/AutoUpgrade.cpp
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/test/Bitcode/upgrade-datalayout3.ll
  llvm/test/CodeGen/X86/long-double-abi-align.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
  llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp

Index: llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
===
--- llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
+++ llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
@@ -24,7 +24,7 @@
   EXPECT_EQ(DL1, "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64"
  "-f80:128-n8:16:32:64-S128");
   EXPECT_EQ(DL2, "e-m:w-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64"
- "-f80:32-n8:16:32-S32");
+ "-f80:128-n8:16:32-S32");
   EXPECT_EQ(DL3, "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128"
  "-n32:64-S128");
 
Index: llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
===
--- llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
+++ llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
@@ -909,8 +909,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:flds __real@5f00
 ; X86-AVX512-WIN-NEXT:xorl %edx, %edx
@@ -985,8 +985,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:flds __real@5f00
 ; X86-SSE3-WIN-NEXT:xorl %edx, %edx
@@ -1061,8 +1061,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:flds __real@5f00
 ; X86-SSE2-WIN-NEXT:xorl %edx, %edx
@@ -1161,8 +1161,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:flds __real@5f00
 ; X87-WIN-NEXT:fucom %st(1)
@@ -1235,8 +1235,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:fisttpll (%esp)
 ; X86-AVX512-WIN-NEXT:movl (%esp), %eax
@@ -1275,8 +1275,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:fisttpll (%esp)
 ; X86-SSE3-WIN-NEXT:movl (%esp), %eax
@@ -1315,8 +1315,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X86-SSE2-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
@@ -1379,8 +1379,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X87-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
Index: llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
===
--- llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
+++ llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
@@ -344,8 +344,8 @@
 ; 

[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-08 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 398334.
pengfei added a comment.
Herald added a subscriber: dexonsmith.

> However, do we need to make changes to `llvm::UpgradeDataLayoutString`? 
> Otherwise, I believe old bitcode for MSVC targets will no longer be able to 
> be loaded for LTO.

Makes sense. Done, thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

Files:
  clang/lib/Basic/Targets/X86.h
  clang/test/CodeGen/target-data.c
  llvm/lib/IR/AutoUpgrade.cpp
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/test/Bitcode/upgrade-datalayout3.ll
  llvm/test/CodeGen/X86/long-double-abi-align.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i64.ll

Index: llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
===
--- llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
+++ llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
@@ -909,8 +909,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:flds __real@5f00
 ; X86-AVX512-WIN-NEXT:xorl %edx, %edx
@@ -985,8 +985,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:flds __real@5f00
 ; X86-SSE3-WIN-NEXT:xorl %edx, %edx
@@ -1061,8 +1061,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:flds __real@5f00
 ; X86-SSE2-WIN-NEXT:xorl %edx, %edx
@@ -1161,8 +1161,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:flds __real@5f00
 ; X87-WIN-NEXT:fucom %st(1)
@@ -1235,8 +1235,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:fisttpll (%esp)
 ; X86-AVX512-WIN-NEXT:movl (%esp), %eax
@@ -1275,8 +1275,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:fisttpll (%esp)
 ; X86-SSE3-WIN-NEXT:movl (%esp), %eax
@@ -1315,8 +1315,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X86-SSE2-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
@@ -1379,8 +1379,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X87-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
Index: llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
===
--- llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
+++ llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
@@ -344,8 +344,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:fisttpll (%esp)
 ; X86-AVX512-WIN-NEXT:movl (%esp), %eax
@@ -382,8 +382,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; 

[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-07 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment.

However, do we need to make changes to `llvm::UpgradeDataLayoutString`? 
Otherwise, I believe old bitcode for MSVC targets will no longer be able to be 
loaded for LTO.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-07 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment.

In D115942#3227047 , @pengfei wrote:

> In D115942#3226146 , @rnk wrote:
>
>> Yeah, let's try to reach some resolution on that.
>
> The things are different. We don't support f80 type on Windows 32 bits 
> previously. It means we don't have the burden to upgrade, since there's no 
> global/load/store/GEP/etc for f80.

Good point, I buy that argument.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-07 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei updated this revision to Diff 398123.
pengfei added a comment.

Structure the layout spelling.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

Files:
  clang/lib/Basic/Targets/X86.h
  clang/test/CodeGen/target-data.c
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/test/CodeGen/X86/long-double-abi-align.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i64.ll

Index: llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
===
--- llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
+++ llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
@@ -909,8 +909,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:flds __real@5f00
 ; X86-AVX512-WIN-NEXT:xorl %edx, %edx
@@ -985,8 +985,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:flds __real@5f00
 ; X86-SSE3-WIN-NEXT:xorl %edx, %edx
@@ -1061,8 +1061,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:flds __real@5f00
 ; X86-SSE2-WIN-NEXT:xorl %edx, %edx
@@ -1161,8 +1161,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:flds __real@5f00
 ; X87-WIN-NEXT:fucom %st(1)
@@ -1235,8 +1235,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:fisttpll (%esp)
 ; X86-AVX512-WIN-NEXT:movl (%esp), %eax
@@ -1275,8 +1275,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:fisttpll (%esp)
 ; X86-SSE3-WIN-NEXT:movl (%esp), %eax
@@ -1315,8 +1315,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X86-SSE2-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
@@ -1379,8 +1379,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X87-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
Index: llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
===
--- llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
+++ llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
@@ -344,8 +344,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:fisttpll (%esp)
 ; X86-AVX512-WIN-NEXT:movl (%esp), %eax
@@ -382,8 +382,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:

[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-07 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added a comment.

In D115942#3226146 , @rnk wrote:

> Yeah, let's try to reach some resolution on that.

The things are different. We don't support f80 type on Windows 32 bits 
previously. It means we don't have the burden to upgrade, since there's no 
global/load/store/GEP/etc for f80.

> In the mean time, I discovered the `alignstack` parameter attribute:
> https://llvm.org/docs/LangRef.html#parameter-attributes
>
> Could that be used to solve this problem in the frontend instead?

It might be feasible, but I don't think it's a good idea. It looks to me more 
like a language specific alignment hint instead of medium that carrying target 
specific information.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-07 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added a comment.

In D115942#3226101 , @craig.topper 
wrote:

> Does this have the same autoupgrade issues as @efriedma raised in 
> https://reviews.llvm.org/D86310

No. The differences are that i128 can be generated by front end while f80 
cannot without D115441  in the given 
datalayout (i.e., MSVC).
I also did some experiments, e.g., generating a bc file (without f80 type) with 
existing compiler and compile it with the one with this patch. There's no error 
during compilation. So I think we don't bother to do autoupgrade at all.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-06 Thread Reid Kleckner via Phabricator via cfe-commits
rnk requested changes to this revision.
rnk added a comment.
This revision now requires changes to proceed.

Yeah, let's try to reach some resolution on that.

In the mean time, I discovered the `alignstack` parameter attribute:
https://llvm.org/docs/LangRef.html#parameter-attributes

Could that be used to solve this problem in the frontend instead?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-06 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added a subscriber: efriedma.
craig.topper added a comment.

Does this have the same autoupgrade issues as @efriedma raised in 
https://reviews.llvm.org/D86310


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2022-01-06 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision.
rnk added subscribers: jyknight, thakis.
rnk added a comment.
This revision is now accepted and ready to land.

Thanks, looks good. I have a minor code refactoring suggestion, but feel free 
to resolve it as you see fit and land it.




Comment at: clang/lib/Basic/Targets/X86.h:534-535
 DoubleAlign = LongLongAlign = 64;
 bool IsWinCOFF =
 getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
 resetDataLayout(IsWinCOFF ? "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:"

I think it would be simpler to make the MSVC mode data layout change here.

It is also my understanding that, prior to rGb214cbc7852fa1719c5d0b, only 
long-lived string constants could be passed to `resetDataLayout`. Since 2016, 
that is unneeded. `resetDataLayout` now copies its string argument. (@jyknight 
@thakis, who made the changes here).

I suggest structuring the code like this:

```
bool IsWinCOFF = getTriple()...
bool IsMSVC = getTriple()...
StringRef Mangling = IsWinCOFF ? "m:x" : "m:e";
StringRef F80 = IsMSVC ? "f80:128" : "f80:32";
std::string Layout = "e-" + Mangling + "-p:32..." + F80 + "-n8:...";
resetDataLayout(Layout, IsWinCOFF ? "_" : "");
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2021-12-17 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added a comment.

This is split from D115441 . Add a targeted 
LLVM test. Thanks @rnk for the advise.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115942/new/

https://reviews.llvm.org/D115942

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D115942: [X86][MS] Change the alignment of f80 to 16 bytes on Windows 32bits to match with ICC

2021-12-17 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei created this revision.
pengfei added reviewers: rnk, andrew.w.kaylor, erichkeane, craig.topper.
Herald added a subscriber: hiraditya.
pengfei requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

MSVC currently doesn't support 80 bits long double. ICC supports it when
the option `/Qlong-double` is specified. Changing the alignment of f80
to 16 bytes so that we can be compatible with ICC's option.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115942

Files:
  clang/lib/Basic/Targets/X86.h
  clang/test/CodeGen/target-data.c
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/test/CodeGen/X86/long-double-abi-align.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
  llvm/test/CodeGen/X86/scalar-fp-to-i64.ll

Index: llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
===
--- llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
+++ llvm/test/CodeGen/X86/scalar-fp-to-i64.ll
@@ -909,8 +909,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:flds __real@5f00
 ; X86-AVX512-WIN-NEXT:xorl %edx, %edx
@@ -985,8 +985,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:flds __real@5f00
 ; X86-SSE3-WIN-NEXT:xorl %edx, %edx
@@ -1061,8 +1061,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:flds __real@5f00
 ; X86-SSE2-WIN-NEXT:xorl %edx, %edx
@@ -1161,8 +1161,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:flds __real@5f00
 ; X87-WIN-NEXT:fucom %st(1)
@@ -1235,8 +1235,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:fisttpll (%esp)
 ; X86-AVX512-WIN-NEXT:movl (%esp), %eax
@@ -1275,8 +1275,8 @@
 ; X86-SSE3-WIN:   # %bb.0:
 ; X86-SSE3-WIN-NEXT:pushl %ebp
 ; X86-SSE3-WIN-NEXT:movl %esp, %ebp
-; X86-SSE3-WIN-NEXT:andl $-8, %esp
-; X86-SSE3-WIN-NEXT:subl $8, %esp
+; X86-SSE3-WIN-NEXT:andl $-16, %esp
+; X86-SSE3-WIN-NEXT:subl $16, %esp
 ; X86-SSE3-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE3-WIN-NEXT:fisttpll (%esp)
 ; X86-SSE3-WIN-NEXT:movl (%esp), %eax
@@ -1315,8 +1315,8 @@
 ; X86-SSE2-WIN:   # %bb.0:
 ; X86-SSE2-WIN-NEXT:pushl %ebp
 ; X86-SSE2-WIN-NEXT:movl %esp, %ebp
-; X86-SSE2-WIN-NEXT:andl $-8, %esp
-; X86-SSE2-WIN-NEXT:subl $16, %esp
+; X86-SSE2-WIN-NEXT:andl $-16, %esp
+; X86-SSE2-WIN-NEXT:subl $32, %esp
 ; X86-SSE2-WIN-NEXT:fldt 8(%ebp)
 ; X86-SSE2-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X86-SSE2-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
@@ -1379,8 +1379,8 @@
 ; X87-WIN:   # %bb.0:
 ; X87-WIN-NEXT:pushl %ebp
 ; X87-WIN-NEXT:movl %esp, %ebp
-; X87-WIN-NEXT:andl $-8, %esp
-; X87-WIN-NEXT:subl $16, %esp
+; X87-WIN-NEXT:andl $-16, %esp
+; X87-WIN-NEXT:subl $32, %esp
 ; X87-WIN-NEXT:fldt 8(%ebp)
 ; X87-WIN-NEXT:fnstcw {{[0-9]+}}(%esp)
 ; X87-WIN-NEXT:movzwl {{[0-9]+}}(%esp), %eax
Index: llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
===
--- llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
+++ llvm/test/CodeGen/X86/scalar-fp-to-i32.ll
@@ -344,8 +344,8 @@
 ; X86-AVX512-WIN:   # %bb.0:
 ; X86-AVX512-WIN-NEXT:pushl %ebp
 ; X86-AVX512-WIN-NEXT:movl %esp, %ebp
-; X86-AVX512-WIN-NEXT:andl $-8, %esp
-; X86-AVX512-WIN-NEXT:subl $8, %esp
+; X86-AVX512-WIN-NEXT:andl $-16, %esp
+; X86-AVX512-WIN-NEXT:subl $16, %esp
 ; X86-AVX512-WIN-NEXT:fldt 8(%ebp)
 ; X86-AVX512-WIN-NEXT:fisttpll (%esp)
 ; X86-AVX512-WIN-NEXT:movl (%esp), %eax
@@ -382,8 +382,8 @@
 ; X86-SSE3-WIN:   #