10952cf5bSWael Yehia; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 20952cf5bSWael Yehia; RUN: opt < %s -passes=instcombine -S | FileCheck %s 3*4ab40ecaSBjorn Petterssondeclare void @use(ptr) 40952cf5bSWael Yehia 50952cf5bSWael Yehiadefine void @foo(i64 %X) { 60952cf5bSWael Yehia; Currently we cannot handle expressions of the form Offset - X * Scale. 70952cf5bSWael Yehia; CHECK-LABEL: @foo( 8ee0bf647SSanjay Patel; CHECK-NEXT: [[TMP1:%.*]] = shl i64 [[X:%.*]], 2 9ee0bf647SSanjay Patel; CHECK-NEXT: [[TMP2:%.*]] = sub i64 24, [[TMP1]] 100952cf5bSWael Yehia; CHECK-NEXT: [[TMP3:%.*]] = alloca i8, i64 [[TMP2]], align 4 11*4ab40ecaSBjorn Pettersson; CHECK-NEXT: call void @use(ptr nonnull [[TMP3]]) 120952cf5bSWael Yehia; CHECK-NEXT: ret void 130952cf5bSWael Yehia; 140952cf5bSWael Yehia %1 = mul nsw i64 %X, -4 150952cf5bSWael Yehia %2 = add nsw i64 %1, 24 160952cf5bSWael Yehia %3 = alloca i8, i64 %2, align 4 17*4ab40ecaSBjorn Pettersson call void @use(ptr %3) 180952cf5bSWael Yehia ret void 190952cf5bSWael Yehia} 20