diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2023-08-25 20:06:57 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2023-08-25 20:06:57 -0700 |
| commit | 84e305dd93cc83cdd9378d0f6f657d8caaabfad8 (patch) | |
| tree | e9d20ed79d1787400e9fd74f9843f61ce2c7e2b2 /compiler/rustc_codegen_llvm/src | |
| parent | ac89e1615d78a9a89bf35047ae4413fcc1c8e875 (diff) | |
| download | rust-84e305dd93cc83cdd9378d0f6f657d8caaabfad8.tar.gz rust-84e305dd93cc83cdd9378d0f6f657d8caaabfad8.zip | |
Stop emitting non-power-of-two vectors in basic LLVM codegen
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/type_of.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/type_of.rs b/compiler/rustc_codegen_llvm/src/type_of.rs index 2be7bce115d..831645579b9 100644 --- a/compiler/rustc_codegen_llvm/src/type_of.rs +++ b/compiler/rustc_codegen_llvm/src/type_of.rs @@ -405,7 +405,11 @@ impl<'tcx> LayoutLlvmExt<'tcx> for TyAndLayout<'tcx> { // Vectors, even for non-power-of-two sizes, have the same layout as // arrays but don't count as aggregate types + // While LLVM theoretically supports non-power-of-two sizes, and they + // often work fine, sometimes x86-isel deals with them horribly + // (see #115212) so for now only use power-of-two ones. if let FieldsShape::Array { count, .. } = self.layout.fields() + && count.is_power_of_two() && let element = self.field(cx, 0) && element.ty.is_integral() { |
