37 lines · plain
1; RUN: opt -mtriple=x86_64-darwin-unknown -S -passes=consthoist < %s | FileCheck %s2 3define i128 @test1(i128 %a) nounwind {4; CHECK-LABEL: test15; CHECK: %const = bitcast i128 12297829382473034410122878 to i1286 %1 = add i128 %a, 122978293824730344101228787 %2 = add i128 %1, 122978293824730344101228788 ret i128 %29}10 11; Check that we don't hoist the shift value of a shift instruction.12define i512 @test2(i512 %a) nounwind {13; CHECK-LABEL: test214; CHECK-NOT: %const = bitcast i512 504 to i51215 %1 = shl i512 %a, 50416 %2 = ashr i512 %1, 50417 ret i512 %218}19 20; Check that we don't hoist constants with a type larger than i128.21define i196 @test3(i196 %a) nounwind {22; CHECK-LABEL: test323; CHECK-NOT: %const = bitcast i196 2 to i19624 %1 = mul i196 %a, 225 %2 = mul i196 %1, 226 ret i196 %227}28 29; Check that we don't hoist immediates with small values.30define i96 @test4(i96 %a) nounwind {31; CHECK-LABEL: test432; CHECK-NOT: %const = bitcast i96 2 to i9633 %1 = mul i96 %a, 234 %2 = add i96 %1, 235 ret i96 %236}37