Matt Arsenault 997d7d1931 InstCombine: Convert some tests to opaque pointers
Needed manual fixes:
  2008-01-06-VoidCast.ll
  alias.ll @0 type lost
  pr27703.ll totally confused
  pr44242.ll phi and update_test_checks
  pr44245.ll phi and update_test_checks

Needed re-running update_test_checks:
  2009-01-08-AlignAlloca.ll
  2009-02-20-InstCombine-SROA.ll
  addrspacecast.ll
  alloca-cast-debuginfo.ll
  alloca-in-non-alloca-as.ll
  alloca.ll
  icmp-gep.ll
  icmp-custom-dl.ll
  lifetime-no-null-opt.ll
  non-integral-pointers.ll
  pr33689_same_bitwidth.ll
  pr39908.ll
  scalable-cast-of-alloc.ll
  select-cmp-br.ll
  unpack-fca.ll

Converted to generated checks:
  2012-6-7-vselect-bitcast.ll
2022-12-01 23:08:57 -05:00

24 lines
842 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
define ptr @f1(ptr %arg, i64 %arg1) {
; CHECK-LABEL: @f1(
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr [6 x i32], ptr [[ARG:%.*]], i64 3, i64 [[ARG1:%.*]]
; CHECK-NEXT: ret ptr [[TMP1]]
;
%1 = getelementptr [6 x i32], ptr %arg, i64 3
%2 = getelementptr [6 x i32], ptr %1, i64 0, i64 %arg1
ret ptr %2
}
define ptr @f2(ptr %arg, i64 %arg1) {
; CHECK-LABEL: @f2(
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr [6 x i32], ptr [[ARG:%.*]], i64 3
; CHECK-NEXT: [[TMP2:%.*]] = getelementptr [6 x i32], ptr [[TMP1]], i64 [[ARG1:%.*]], i64 [[ARG1]]
; CHECK-NEXT: ret ptr [[TMP2]]
;
%1 = getelementptr [6 x i32], ptr %arg, i64 3
%2 = getelementptr [6 x i32], ptr %1, i64 %arg1, i64 %arg1
ret ptr %2
}