[PATCH] D61457: [X86] Use extended vector register classes in getRegForInlineAsmConstraint to support x/y/zmm16-31 when the type is mismatched.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 2 12:29:20 PDT 2019
craig.topper updated this revision to Diff 197845.
craig.topper added a comment.
Herald added a subscriber: hiraditya.
Add the whole patch not just the test.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61457/new/
https://reviews.llvm.org/D61457
Files:
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/asm-reg-type-mismatch-avx512.ll
Index: llvm/test/CodeGen/X86/asm-reg-type-mismatch-avx512.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/X86/asm-reg-type-mismatch-avx512.ll
@@ -0,0 +1,15 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=avx512f | FileCheck %s
+
+define i64 @test1() nounwind {
+; CHECK-LABEL: test1:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: #APP
+; CHECK-NEXT: vmovq {{.*#+}} xmm16 = mem[0],zero
+; CHECK-NEXT: #NO_APP
+; CHECK-NEXT: vmovq %xmm16, %rax
+; CHECK-NEXT: retq
+entry:
+ %0 = tail call i64 asm sideeffect "vmovq $1, $0", "={xmm16},*m,~{dirflag},~{fpsr},~{flags}"(i64* null) nounwind
+ ret i64 %0
+}
Index: llvm/lib/Target/X86/X86ISelLowering.cpp
===================================================================
--- llvm/lib/Target/X86/X86ISelLowering.cpp
+++ llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -44190,13 +44190,13 @@
// TODO: Handle f128 and i128 in FR128RegClass after it is tested well.
if (VT == MVT::f32 || VT == MVT::i32)
- Res.second = &X86::FR32RegClass;
+ Res.second = &X86::FR32XRegClass;
else if (VT == MVT::f64 || VT == MVT::i64)
- Res.second = &X86::FR64RegClass;
- else if (TRI->isTypeLegalForClass(X86::VR128RegClass, VT))
- Res.second = &X86::VR128RegClass;
- else if (TRI->isTypeLegalForClass(X86::VR256RegClass, VT))
- Res.second = &X86::VR256RegClass;
+ Res.second = &X86::FR64XRegClass;
+ else if (TRI->isTypeLegalForClass(X86::VR128XRegClass, VT))
+ Res.second = &X86::VR128XRegClass;
+ else if (TRI->isTypeLegalForClass(X86::VR256XRegClass, VT))
+ Res.second = &X86::VR256XRegClass;
else if (TRI->isTypeLegalForClass(X86::VR512RegClass, VT))
Res.second = &X86::VR512RegClass;
else {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61457.197845.patch
Type: text/x-patch
Size: 1873 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190502/eb9baa7a/attachment.bin>
More information about the llvm-commits
mailing list