Commit adc2824fa4

William Sengir <william@sengir.com>
2022-03-26 23:30:13
stage2: simplify `scalar_ty` for `mul_add` in LLVM backend
1 parent 6a48345
Changed files (1)
src
codegen
src/codegen/llvm.zig
@@ -5218,6 +5218,7 @@ pub const FuncGen = struct {
 
         const ty = self.air.typeOfIndex(inst);
         const llvm_ty = try self.dg.llvmType(ty);
+        const scalar_ty = ty.scalarType();
         const target = self.dg.module.getTarget();
 
         const Strat = union(enum) {
@@ -5225,11 +5226,6 @@ pub const FuncGen = struct {
             libc: [*:0]const u8,
         };
 
-        const scalar_ty = if (ty.zigTypeTag() == .Vector)
-            ty.elemType()
-        else
-            ty;
-
         const strat: Strat = switch (scalar_ty.floatBits(target)) {
             16, 32, 64 => Strat.intrinsic,
             80 => if (CType.longdouble.sizeInBits(target) == 80) Strat{ .intrinsic = {} } else Strat{ .libc = "__fmax" },