diff options
| author | Craig Topper <craig.topper@gmail.com> | 2017-03-28 23:20:37 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2017-03-28 23:20:37 +0000 |
| commit | 331297c62e028190c8e7c4053d9a7d434875c3e6 (patch) | |
| tree | 8225f77b9fe903caaf2f51e40d1344d2fe58ef21 | |
| parent | fc6ffede655b55099550b96604add2d1eb7877b0 (diff) | |
| download | bcm5719-llvm-331297c62e028190c8e7c4053d9a7d434875c3e6.tar.gz bcm5719-llvm-331297c62e028190c8e7c4053d9a7d434875c3e6.zip | |
[AVX-512] Punt on fast-isel of truncates to i1 when AVX512 is enabled.
We should be masking the value and emitting a register copy like we do in non-fast isel. Instead we were just updating the value map and emitting nothing.
After r298928 we started seeing cases where we would create a copy from GR8 to GR32 because the source register in a VK1 to GR32 copy was replaced by the GR8 going into a truncate.
This fixes PR32451.
llvm-svn: 298957
| -rw-r--r-- | llvm/lib/Target/X86/X86FastISel.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp index 7d38abbc2ce..be1efa66f12 100644 --- a/llvm/lib/Target/X86/X86FastISel.cpp +++ b/llvm/lib/Target/X86/X86FastISel.cpp @@ -2512,7 +2512,8 @@ bool X86FastISel::X86SelectTrunc(const Instruction *I) { EVT DstVT = TLI.getValueType(DL, I->getType()); // This code only handles truncation to byte. - if (DstVT != MVT::i8 && DstVT != MVT::i1) + // TODO: Support truncate to i1 with AVX512. + if (DstVT != MVT::i8 && (DstVT != MVT::i1 || Subtarget->hasAVX512())) return false; if (!TLI.isTypeLegal(SrcVT)) return false; |

