1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instcombine -S | FileCheck %s
5 define void @foo(i64 %X) {
6 ; Currently we cannot handle expressions of the form Offset - X * Scale.
8 ; CHECK-NEXT: [[TMP1:%.*]] = shl i64 [[X:%.*]], 2
9 ; CHECK-NEXT: [[TMP2:%.*]] = sub i64 24, [[TMP1]]
10 ; CHECK-NEXT: [[TMP3:%.*]] = alloca i8, i64 [[TMP2]], align 4
11 ; CHECK-NEXT: call void @use(ptr nonnull [[TMP3]])
12 ; CHECK-NEXT: ret void
14 %1 = mul nsw i64 %X, -4
15 %2 = add nsw i64 %1, 24
16 %3 = alloca i8, i64 %2, align 4
17 call void @use(ptr %3)