[llvm] 0d022e7 - [X86] Convert tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 5 05:16:12 PDT 2023
Author: Nikita Popov
Date: 2023-04-05T14:09:00+02:00
New Revision: 0d022e7d1ff94aaf51e8ac1cea9ce0b827c92814
URL: https://github.com/llvm/llvm-project/commit/0d022e7d1ff94aaf51e8ac1cea9ce0b827c92814
DIFF: https://github.com/llvm/llvm-project/commit/0d022e7d1ff94aaf51e8ac1cea9ce0b827c92814.diff
LOG: [X86] Convert tests to opaque pointers (NFC)
Added:
Modified:
llvm/test/CodeGen/X86/fold-call-3.ll
llvm/test/CodeGen/X86/pr38217.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/fold-call-3.ll b/llvm/test/CodeGen/X86/fold-call-3.ll
index c70b8c8f7198..9c9a50d3e9ce 100644
--- a/llvm/test/CodeGen/X86/fold-call-3.ll
+++ b/llvm/test/CodeGen/X86/fold-call-3.ll
@@ -1,16 +1,16 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -opaque-pointers=0 < %s -mtriple=x86_64-apple-darwin | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
; rdar://6522427
; This command line used to crash due to dangling nodes left after PreprocessISelDAG
-; RUN: llc -opaque-pointers=0 < %s -mtriple=x86_64-apple-darwin -pre-RA-sched=linearize | FileCheck %s --check-prefix=pre-RA
+; RUN: llc < %s -mtriple=x86_64-apple-darwin -pre-RA-sched=linearize | FileCheck %s --check-prefix=pre-RA
%"struct.clang::Action" = type { %"struct.clang::ActionBase" }
- %"struct.clang::ActionBase" = type { i32 (...)** }
- %"struct.clang::ActionBase::ActionResult<0u>" = type { i8*, i8 }
- at NumTrials = internal global i32 10000000 ; <i32*> [#uses=2]
- at llvm.used = appending global [1 x i8*] [ i8* bitcast (void (i8*, %"struct.clang::Action"*)* @_Z25RawPointerPerformanceTestPvRN5clang6ActionE to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
+ %"struct.clang::ActionBase" = type { ptr }
+ %"struct.clang::ActionBase::ActionResult<0u>" = type { ptr, i8 }
+ at NumTrials = internal global i32 10000000 ; <ptr> [#uses=2]
+ at llvm.used = appending global [1 x ptr] [ ptr @_Z25RawPointerPerformanceTestPvRN5clang6ActionE ], section "llvm.metadata" ; <ptr> [#uses=0]
-define void @_Z25RawPointerPerformanceTestPvRN5clang6ActionE(i8* %Val, %"struct.clang::Action"* %Actions) nounwind {
+define void @_Z25RawPointerPerformanceTestPvRN5clang6ActionE(ptr %Val, ptr %Actions) nounwind {
; CHECK-LABEL: _Z25RawPointerPerformanceTestPvRN5clang6ActionE:
; CHECK: ## %bb.0: ## %entry
; CHECK-NEXT: pushq %rbp
@@ -70,33 +70,28 @@ define void @_Z25RawPointerPerformanceTestPvRN5clang6ActionE(i8* %Val, %"struct.
; pre-RA-NEXT: retq
entry:
%i = alloca %"struct.clang::ActionBase::ActionResult<0u>", align 8
- %i1 = load i32, i32* @NumTrials, align 4
+ %i1 = load i32, ptr @NumTrials, align 4
%i2 = icmp eq i32 %i1, 0
br i1 %i2, label %return, label %bb.nph
bb.nph: ; preds = %entry
- %i3 = getelementptr %"struct.clang::Action", %"struct.clang::Action"* %Actions, i64 0, i32 0, i32 0
- %mrv_gep = bitcast %"struct.clang::ActionBase::ActionResult<0u>"* %i to i64*
- %mrv_gep1 = getelementptr %"struct.clang::ActionBase::ActionResult<0u>", %"struct.clang::ActionBase::ActionResult<0u>"* %i, i64 0, i32 1
- %i4 = bitcast i8* %mrv_gep1 to i64*
- %i5 = getelementptr %"struct.clang::ActionBase::ActionResult<0u>", %"struct.clang::ActionBase::ActionResult<0u>"* %i, i64 0, i32 0
+ %mrv_gep1 = getelementptr %"struct.clang::ActionBase::ActionResult<0u>", ptr %i, i64 0, i32 1
br label %bb
bb: ; preds = %bb, %bb.nph
%Trial.01 = phi i32 [ 0, %bb.nph ], [ %i12, %bb ]
- %Val_addr.02 = phi i8* [ %Val, %bb.nph ], [ %i11, %bb ]
- %i6 = load i32 (...)**, i32 (...)*** %i3, align 8
- %i7 = getelementptr i32 (...)*, i32 (...)** %i6, i64 70
- %i8 = load i32 (...)*, i32 (...)** %i7, align 8
- %i9 = bitcast i32 (...)* %i8 to { i64, i64 } (%"struct.clang::Action"*, i8*)*
- %i10 = call { i64, i64 } %i9(%"struct.clang::Action"* %Actions, i8* %Val_addr.02) #0
+ %Val_addr.02 = phi ptr [ %Val, %bb.nph ], [ %i11, %bb ]
+ %i6 = load ptr, ptr %Actions, align 8
+ %i7 = getelementptr ptr, ptr %i6, i64 70
+ %i8 = load ptr, ptr %i7, align 8
+ %i10 = call { i64, i64 } %i8(ptr %Actions, ptr %Val_addr.02) #0
%mrv_gr = extractvalue { i64, i64 } %i10, 0
- store i64 %mrv_gr, i64* %mrv_gep, align 4
+ store i64 %mrv_gr, ptr %i, align 4
%mrv_gr2 = extractvalue { i64, i64 } %i10, 1
- store i64 %mrv_gr2, i64* %i4, align 4
- %i11 = load i8*, i8** %i5, align 8
+ store i64 %mrv_gr2, ptr %mrv_gep1, align 4
+ %i11 = load ptr, ptr %i, align 8
%i12 = add i32 %Trial.01, 1
- %i13 = load i32, i32* @NumTrials, align 4
+ %i13 = load i32, ptr @NumTrials, align 4
%i14 = icmp ult i32 %i12, %i13
br i1 %i14, label %bb, label %return
diff --git a/llvm/test/CodeGen/X86/pr38217.ll b/llvm/test/CodeGen/X86/pr38217.ll
index 604a123ba5ca..f1538f3598ae 100644
--- a/llvm/test/CodeGen/X86/pr38217.ll
+++ b/llvm/test/CodeGen/X86/pr38217.ll
@@ -1,9 +1,9 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -opaque-pointers=0 < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
@_ZL11DIGIT_TABLE = dso_local constant [201 x i8] c"00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899\00", align 16
-define dso_local void @_Z12d2s_bufferedmPc(i64 %arg, i8* nocapture %arg1) {
+define dso_local void @_Z12d2s_bufferedmPc(i64 %arg, ptr nocapture %arg1) {
; CHECK-LABEL: _Z12d2s_bufferedmPc:
; CHECK: # %bb.0: # %bb
; CHECK-NEXT: cmpq $10000, %rdi # imm = 0x2710
@@ -53,21 +53,17 @@ bb2: ; preds = %bb2, %bb
%i11 = shl nuw nsw i32 %i10, 1
%i12 = zext i32 %i4 to i64
%i13 = sub nsw i64 0, %i12
- %i14 = getelementptr inbounds i8, i8* %arg1, i64 %i13
- %i15 = getelementptr inbounds i8, i8* %i14, i64 -1
+ %i14 = getelementptr inbounds i8, ptr %arg1, i64 %i13
+ %i15 = getelementptr inbounds i8, ptr %i14, i64 -1
%i16 = zext i32 %i9 to i64
- %i17 = getelementptr inbounds [201 x i8], [201 x i8]* @_ZL11DIGIT_TABLE, i64 0, i64 %i16
- %i18 = bitcast i8* %i17 to i16*
- %i19 = bitcast i8* %i15 to i16*
- %i20 = load i16, i16* %i18, align 2
- store i16 %i20, i16* %i19, align 1
- %i21 = getelementptr inbounds i8, i8* %i14, i64 -3
+ %i17 = getelementptr inbounds [201 x i8], ptr @_ZL11DIGIT_TABLE, i64 0, i64 %i16
+ %i20 = load i16, ptr %i17, align 2
+ store i16 %i20, ptr %i15, align 1
+ %i21 = getelementptr inbounds i8, ptr %i14, i64 -3
%i22 = zext i32 %i11 to i64
- %i23 = getelementptr inbounds [201 x i8], [201 x i8]* @_ZL11DIGIT_TABLE, i64 0, i64 %i22
- %i24 = bitcast i8* %i23 to i16*
- %i25 = bitcast i8* %i21 to i16*
- %i26 = load i16, i16* %i24, align 2
- store i16 %i26, i16* %i25, align 1
+ %i23 = getelementptr inbounds [201 x i8], ptr @_ZL11DIGIT_TABLE, i64 0, i64 %i22
+ %i26 = load i16, ptr %i23, align 2
+ store i16 %i26, ptr %i21, align 1
%i27 = add i32 %i4, 4
%i28 = icmp ugt i64 %i3, 99999999
br i1 %i28, label %bb2, label %bb29
More information about the llvm-commits
mailing list