Bjorn Pettersson 4f73528403 [test][NewGVN] Use -passes=newgvn instead of -newgvn
Use the new PM syntax when specifying the pipeline in regression
tests previously running
  "opt -newgvn ..."

Instead we now do
  "opt -passes=newgvn ..."

Notice that this also changes the aa-pipeline to become the default
aa-pipeline instead of just basic-aa. Since these tests haven't been
explicitly requesting basic-aa in the past (compared to the test cases
updated in a separate patch involving "-basic-aa -newgvn") it is
assumed that the exact aa-pipeline isn't important for the validity
of the test cases. An alternative could have been to add
-aa-pipeline=basic-aa as well to the run lines, but that might just
add clutter in case the test cases do not care about the aa-pipeline.

This is another step to move away from the legacy PM syntax when
specifying passes in opt.

Differential Revision: https://reviews.llvm.org/D118341
2022-01-28 13:58:22 +01:00

37 lines
1.2 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
;; Ensure the store verifier is not overzealous
; RUN: opt -passes=newgvn -enable-phi-of-ops=true -S %s | FileCheck %s
@b = external global i16, align 2
define void @patatino() {
; CHECK-LABEL: @patatino(
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 false, label [[FOR_COND1:%.*]], label [[FOR_INC:%.*]]
; CHECK: for.cond1:
; CHECK-NEXT: [[PHIOFOPS:%.*]] = phi i16 [ poison, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[FOR_INC]] ]
; CHECK-NEXT: store i16 [[PHIOFOPS]], i16* @b, align 2
; CHECK-NEXT: br label [[FOR_INC]]
; CHECK: for.inc:
; CHECK-NEXT: [[TMP0:%.*]] = load i16, i16* @b, align 2
; CHECK-NEXT: [[INC]] = add i16 [[TMP0]], 1
; CHECK-NEXT: store i16 [[INC]], i16* @b, align 2
; CHECK-NEXT: br label [[FOR_COND1]]
;
entry:
br i1 false, label %for.cond1, label %for.inc
for.cond1:
%e.0 = phi i16* [ %e.1, %for.inc ], [ null, %entry ]
%0 = load i16, i16* %e.0, align 2
%add = add i16 %0, 0
store i16 %add, i16* %e.0, align 2
br label %for.inc
for.inc:
%e.1 = phi i16* [ %e.0, %for.cond1 ], [ @b, %entry ]
%1 = load i16, i16* @b, align 2
%inc = add i16 %1, 1
store i16 %inc, i16* @b, align 2
br label %for.cond1
}