Files
clang-p2996/llvm/test/Transforms/EarlyCSE/pr33406.ll
Nikita Popov 3c514d31d7 [EarlyCSE] Update tests to use opaque pointers (NFC)
Update the EarlyCSE tests to use opaque pointers.

Worth noting that this leaves some bitcast ptr to ptr instructions
in the input IR behind which are no longer necessary. This is
because these use numbered instructions, so it's hard to drop them
in an automated fashion (as it would require renumbering all other
instructions as well). I'm leaving that as a problem for another day.

The test updates have been performed using
https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34.

Differential Revision: https://reviews.llvm.org/D127278
2022-06-10 09:53:35 +02:00

27 lines
723 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -early-cse-memssa -earlycse-debug-hash -S %s | FileCheck %s
@b = external global i32
define void @patatino() {
; CHECK-LABEL: @patatino(
; CHECK-NEXT: for.cond:
; CHECK-NEXT: br i1 true, label [[IF_END:%.*]], label [[FOR_INC:%.*]]
; CHECK: if.end:
; CHECK-NEXT: [[TINKYWINKY:%.*]] = load i32, ptr @b, align 4
; CHECK-NEXT: br i1 true, label [[FOR_INC]], label [[FOR_INC]]
; CHECK: for.inc:
; CHECK-NEXT: ret void
;
for.cond:
br i1 true, label %if.end, label %for.inc
if.end:
%tinkywinky = load i32, ptr @b
store i32 %tinkywinky, ptr @b
br i1 true, label %for.inc, label %for.inc
for.inc:
ret void
}