20 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -passes=instcombine -S | FileCheck %s3declare void @use(ptr)4 5define void @foo(i64 %X) {6; Currently we cannot handle expressions of the form Offset - X * Scale.7; CHECK-LABEL: @foo(8; CHECK-NEXT: [[TMP1:%.*]] = shl i64 [[X:%.*]], 29; CHECK-NEXT: [[TMP2:%.*]] = sub i64 24, [[TMP1]]10; CHECK-NEXT: [[TMP3:%.*]] = alloca i8, i64 [[TMP2]], align 411; CHECK-NEXT: call void @use(ptr nonnull [[TMP3]])12; CHECK-NEXT: ret void13;14 %1 = mul nsw i64 %X, -415 %2 = add nsw i64 %1, 2416 %3 = alloca i8, i64 %2, align 417 call void @use(ptr %3)18 ret void19}20