Skip to content

Commit 02fd227

Browse files
SC llvm teamSC llvm team
SC llvm team
authored and
SC llvm team
committed
Merged main:4f873730d6ac1a8496cdef939cc451f178a864ee into amd-gfx:f078619cd03f
Local branch amd-gfx f078619 Merged main:6479218932117ab36cba578bb458ee7c0fb4bf0a into amd-gfx:0667a16be0e8 Remote branch main 4f87373 precommit test
2 parents f078619 + 4f87373 commit 02fd227

File tree

52 files changed

+1661
-125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1661
-125
lines changed

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
13871387
void createIndirectBranch(MCInst &Inst, MCPhysReg MemBaseReg,
13881388
int64_t Disp) const {
13891389
Inst.setOpcode(AArch64::BR);
1390+
Inst.clear();
13901391
Inst.addOperand(MCOperand::createReg(MemBaseReg));
13911392
}
13921393

bolt/lib/Target/X86/X86MCPlusBuilder.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2367,11 +2367,13 @@ class X86MCPlusBuilder : public MCPlusBuilder {
23672367

23682368
bool createNoop(MCInst &Inst) const override {
23692369
Inst.setOpcode(X86::NOOP);
2370+
Inst.clear();
23702371
return true;
23712372
}
23722373

23732374
bool createReturn(MCInst &Inst) const override {
23742375
Inst.setOpcode(X86::RET64);
2376+
Inst.clear();
23752377
return true;
23762378
}
23772379

@@ -2732,6 +2734,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
27322734
bool createUncondBranch(MCInst &Inst, const MCSymbol *TBB,
27332735
MCContext *Ctx) const override {
27342736
Inst.setOpcode(X86::JMP_1);
2737+
Inst.clear();
27352738
Inst.addOperand(MCOperand::createExpr(
27362739
MCSymbolRefExpr::create(TBB, MCSymbolRefExpr::VK_None, *Ctx)));
27372740
return true;
@@ -2740,6 +2743,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
27402743
bool createCall(MCInst &Inst, const MCSymbol *Target,
27412744
MCContext *Ctx) override {
27422745
Inst.setOpcode(X86::CALL64pcrel32);
2746+
Inst.clear();
27432747
Inst.addOperand(MCOperand::createExpr(
27442748
MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx)));
27452749
return true;
@@ -3066,6 +3070,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
30663070
void createSwap(MCInst &Inst, MCPhysReg Source, MCPhysReg MemBaseReg,
30673071
int64_t Disp) const {
30683072
Inst.setOpcode(X86::XCHG64rm);
3073+
Inst.clear();
30693074
Inst.addOperand(MCOperand::createReg(Source));
30703075
Inst.addOperand(MCOperand::createReg(Source));
30713076
Inst.addOperand(MCOperand::createReg(MemBaseReg)); // BaseReg
@@ -3078,6 +3083,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
30783083
void createIndirectBranch(MCInst &Inst, MCPhysReg MemBaseReg,
30793084
int64_t Disp) const {
30803085
Inst.setOpcode(X86::JMP64m);
3086+
Inst.clear();
30813087
Inst.addOperand(MCOperand::createReg(MemBaseReg)); // BaseReg
30823088
Inst.addOperand(MCOperand::createImm(1)); // ScaleAmt
30833089
Inst.addOperand(MCOperand::createReg(X86::NoRegister)); // IndexReg
@@ -3543,6 +3549,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
35433549
bool createMove(MCInst &Inst, const MCSymbol *Src, unsigned Reg,
35443550
MCContext *Ctx) const {
35453551
Inst.setOpcode(X86::MOV64rm);
3552+
Inst.clear();
35463553
Inst.addOperand(MCOperand::createReg(Reg));
35473554
Inst.addOperand(MCOperand::createReg(X86::RIP)); // BaseReg
35483555
Inst.addOperand(MCOperand::createImm(1)); // ScaleAmt
@@ -3558,6 +3565,7 @@ class X86MCPlusBuilder : public MCPlusBuilder {
35583565
bool createLea(MCInst &Inst, const MCSymbol *Src, unsigned Reg,
35593566
MCContext *Ctx) const {
35603567
Inst.setOpcode(X86::LEA64r);
3568+
Inst.clear();
35613569
Inst.addOperand(MCOperand::createReg(Reg));
35623570
Inst.addOperand(MCOperand::createReg(X86::RIP)); // BaseReg
35633571
Inst.addOperand(MCOperand::createImm(1)); // ScaleAmt

clang/include/clang/Driver/ToolChain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ class ToolChain {
580580

581581
// Return the DWARF version to emit, in the absence of arguments
582582
// to the contrary.
583-
virtual unsigned GetDefaultDwarfVersion() const;
583+
virtual unsigned GetDefaultDwarfVersion() const { return 5; }
584584

585585
// Some toolchains may have different restrictions on the DWARF version and
586586
// may need to adjust it. E.g. NVPTX may need to enforce DWARF2 even when host

clang/lib/Driver/ToolChain.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,6 @@ ToolChain::getDefaultUnwindTableLevel(const ArgList &Args) const {
453453
return UnwindTableLevel::None;
454454
}
455455

456-
unsigned ToolChain::GetDefaultDwarfVersion() const {
457-
// TODO: Remove the RISC-V special case when R_RISCV_SET_ULEB128 linker
458-
// support becomes more widely available.
459-
return getTriple().isRISCV() ? 4 : 5;
460-
}
461-
462456
Tool *ToolChain::getClang() const {
463457
if (!Clang)
464458
Clang.reset(new tools::Clang(*this, useIntegratedBackend()));

clang/lib/Sema/SemaOpenMP.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14366,7 +14366,8 @@ StmtResult Sema::ActOnOpenMPTargetParallelForSimdDirective(
1436614366
// The point of exit cannot be a branch out of the structured block.
1436714367
// longjmp() and throw() must not violate the entry/exit criteria.
1436814368
CS->getCapturedDecl()->setNothrow();
14369-
for (int ThisCaptureLevel = getOpenMPCaptureLevels(OMPD_target_parallel_for);
14369+
for (int ThisCaptureLevel =
14370+
getOpenMPCaptureLevels(OMPD_target_parallel_for_simd);
1437014371
ThisCaptureLevel > 1; --ThisCaptureLevel) {
1437114372
CS = cast<CapturedStmt>(CS->getCapturedStmt());
1437214373
// 1.2.2 OpenMP Language Terminology

clang/test/Driver/clang-g-opts.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,3 @@
4242

4343
// CHECK-WITH-G-STANDALONE: "-debug-info-kind=standalone"
4444
// CHECK-WITH-G-STANDALONE: "-dwarf-version=2"
45-
46-
/// TODO: Special case before R_RISCV_SET_ULEB128 linker support becomes more widely available.
47-
// RUN: %clang -### -S %s -g --target=riscv64-linux-gnu 2>&1 | FileCheck --check-prefix=VERSION4 %s
48-
// RUN: %clang -### -S %s -g --target=riscv64-unknown-elf 2>&1 | FileCheck --check-prefix=VERSION4 %s
49-
// VERSION4: "-dwarf-version=4"

cross-project-tests/debuginfo-tests/dexter/dex/debugger/Debuggers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from dex.debugger.visualstudio.VisualStudio2015 import VisualStudio2015
2929
from dex.debugger.visualstudio.VisualStudio2017 import VisualStudio2017
3030
from dex.debugger.visualstudio.VisualStudio2019 import VisualStudio2019
31+
from dex.debugger.visualstudio.VisualStudio2022 import VisualStudio2022
3132

3233

3334
def _get_potential_debuggers(): # noqa
@@ -41,6 +42,7 @@ def _get_potential_debuggers(): # noqa
4142
VisualStudio2015.get_option_name(): VisualStudio2015,
4243
VisualStudio2017.get_option_name(): VisualStudio2017,
4344
VisualStudio2019.get_option_name(): VisualStudio2019,
45+
VisualStudio2022.get_option_name(): VisualStudio2022,
4446
}
4547

4648

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# DExTer : Debugging Experience Tester
2+
# ~~~~~~ ~ ~~ ~ ~~
3+
#
4+
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5+
# See https://llvm.org/LICENSE.txt for license information.
6+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
"""Specializations for the Visual Studio 2022 interface."""
8+
9+
from dex.debugger.visualstudio.VisualStudio import VisualStudio
10+
11+
12+
class VisualStudio2022(VisualStudio):
13+
@classmethod
14+
def get_name(cls):
15+
return "Visual Studio 2022"
16+
17+
@classmethod
18+
def get_option_name(cls):
19+
return "vs2022"
20+
21+
@property
22+
def _dte_version(self):
23+
return "VisualStudio.DTE.17.0"

cross-project-tests/debuginfo-tests/dexter/feature_tests/subtools/list-debuggers/list-debuggers.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ RUN: %dexter_base list-debuggers | FileCheck %s
55
CHECK: lldb
66
CHECK: vs2015
77
CHECK: vs2017
8+
CHECK: vs2019
9+
CHECK: vs2022

flang/include/flang/Optimizer/Builder/IntrinsicCall.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ struct IntrinsicLibrary {
208208
void genCFProcPointer(llvm::ArrayRef<fir::ExtendedValue>);
209209
fir::ExtendedValue genCFunLoc(mlir::Type, llvm::ArrayRef<fir::ExtendedValue>);
210210
fir::ExtendedValue genCLoc(mlir::Type, llvm::ArrayRef<fir::ExtendedValue>);
211+
template <mlir::arith::CmpIPredicate pred>
212+
fir::ExtendedValue genCPtrCompare(mlir::Type,
213+
llvm::ArrayRef<fir::ExtendedValue>);
211214
mlir::Value genCosd(mlir::Type, llvm::ArrayRef<mlir::Value>);
212215
void genDateAndTime(llvm::ArrayRef<fir::ExtendedValue>);
213216
mlir::Value genDim(mlir::Type, llvm::ArrayRef<mlir::Value>);

flang/include/flang/Optimizer/CodeGen/CodeGen.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ void populateFIRToLLVMConversionPatterns(fir::LLVMTypeConverter &converter,
8787
mlir::RewritePatternSet &patterns,
8888
fir::FIRToLLVMPassOptions &options);
8989

90+
/// Populate the pattern set with the PreCGRewrite patterns.
91+
void populatePreCGRewritePatterns(mlir::RewritePatternSet &patterns);
92+
9093
// declarative passes
9194
#define GEN_PASS_REGISTRATION
9295
#include "flang/Optimizer/CodeGen/CGPasses.h.inc"

flang/lib/Lower/OpenMP/Clauses.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ struct SymbolAndDesignatorExtractor {
101101
} else {
102102
// This could still be a Substring or ComplexPart, but at least Substring
103103
// is not allowed in OpenMP.
104+
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
104105
maybeDsg->dump();
106+
#endif
105107
llvm_unreachable("Expecting DataRef designator");
106108
}
107109
}

flang/lib/Optimizer/Builder/IntrinsicCall.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ static constexpr IntrinsicHandler handlers[]{
177177
/*isElemental=*/false},
178178
{"c_funloc", &I::genCFunLoc, {{{"x", asBox}}}, /*isElemental=*/false},
179179
{"c_loc", &I::genCLoc, {{{"x", asBox}}}, /*isElemental=*/false},
180+
{"c_ptr_eq", &I::genCPtrCompare<mlir::arith::CmpIPredicate::eq>},
181+
{"c_ptr_ne", &I::genCPtrCompare<mlir::arith::CmpIPredicate::ne>},
180182
{"ceiling", &I::genCeiling},
181183
{"char", &I::genChar},
182184
{"cmplx",
@@ -2797,6 +2799,23 @@ IntrinsicLibrary::genCLoc(mlir::Type resultType,
27972799
return genCLocOrCFunLoc(builder, loc, resultType, args);
27982800
}
27992801

2802+
// C_PTR_EQ and C_PTR_NE
2803+
template <mlir::arith::CmpIPredicate pred>
2804+
fir::ExtendedValue
2805+
IntrinsicLibrary::genCPtrCompare(mlir::Type resultType,
2806+
llvm::ArrayRef<fir::ExtendedValue> args) {
2807+
assert(args.size() == 2);
2808+
mlir::Value cPtr1 = fir::getBase(args[0]);
2809+
mlir::Value cPtrVal1 =
2810+
fir::factory::genCPtrOrCFunptrValue(builder, loc, cPtr1);
2811+
mlir::Value cPtr2 = fir::getBase(args[1]);
2812+
mlir::Value cPtrVal2 =
2813+
fir::factory::genCPtrOrCFunptrValue(builder, loc, cPtr2);
2814+
mlir::Value cmp =
2815+
builder.create<mlir::arith::CmpIOp>(loc, pred, cPtrVal1, cPtrVal2);
2816+
return builder.createConvert(loc, resultType, cmp);
2817+
}
2818+
28002819
// CEILING
28012820
mlir::Value IntrinsicLibrary::genCeiling(mlir::Type resultType,
28022821
llvm::ArrayRef<mlir::Value> args) {

flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,7 @@ class CodeGenRewrite : public fir::impl::CodeGenRewriteBase<CodeGenRewrite> {
298298
.isa<fir::SequenceType>());
299299
});
300300
mlir::RewritePatternSet patterns(&context);
301-
patterns.insert<EmboxConversion, ArrayCoorConversion, ReboxConversion,
302-
DeclareOpConversion>(&context);
301+
fir::populatePreCGRewritePatterns(patterns);
303302
if (mlir::failed(
304303
mlir::applyPartialConversion(op, target, std::move(patterns)))) {
305304
mlir::emitError(mlir::UnknownLoc::get(&context),
@@ -327,3 +326,8 @@ class CodeGenRewrite : public fir::impl::CodeGenRewriteBase<CodeGenRewrite> {
327326
std::unique_ptr<mlir::Pass> fir::createFirCodeGenRewritePass() {
328327
return std::make_unique<CodeGenRewrite>();
329328
}
329+
330+
void fir::populatePreCGRewritePatterns(mlir::RewritePatternSet &patterns) {
331+
patterns.insert<EmboxConversion, ArrayCoorConversion, ReboxConversion,
332+
DeclareOpConversion>(patterns.getContext());
333+
}

flang/module/__fortran_builtins.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
public :: operator(==)
111111

112112
interface operator(/=)
113-
module procedure __builtin_c_ptr_eq
113+
module procedure __builtin_c_ptr_ne
114114
end interface
115115
public :: operator(/=)
116116

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
! Test C_PTR_EQ and C_PTR_NE lowering.
2+
! RUN: bbc -emit-hlfir -o - %s | FileCheck %s
3+
4+
function test_c_ptr_eq(ptr1, ptr2)
5+
use, intrinsic :: iso_c_binding
6+
type(c_ptr), intent(in) :: ptr1, ptr2
7+
logical :: test_c_ptr_eq
8+
test_c_ptr_eq = (ptr1 .eq. ptr2)
9+
end
10+
11+
! CHECK-LABEL: func.func @_QPtest_c_ptr_eq(
12+
! CHECK-SAME: %[[ARG0:.*]]: !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>> {fir.bindc_name = "ptr1"}, %[[ARG1:.*]]: !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>> {fir.bindc_name = "ptr2"}) -> !fir.logical<4> {
13+
! CHECK: %[[DECL_ARG0:.*]]:2 = hlfir.declare %[[ARG0]] {fortran_attrs = #fir.var_attrs<intent_in>, uniq_name = "_QFtest_c_ptr_eqEptr1"} : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) -> (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>)
14+
! CHECK: %[[DECL_ARG1:.*]]:2 = hlfir.declare %[[ARG1]] {fortran_attrs = #fir.var_attrs<intent_in>, uniq_name = "_QFtest_c_ptr_eqEptr2"} : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) -> (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>)
15+
! CHECK: %[[ALLOCA:.*]] = fir.alloca !fir.logical<4> {bindc_name = "test_c_ptr_eq", uniq_name = "_QFtest_c_ptr_eqEtest_c_ptr_eq"}
16+
! CHECK: %[[DECL_RET:.*]]:2 = hlfir.declare %[[ALLOCA]] {uniq_name = "_QFtest_c_ptr_eqEtest_c_ptr_eq"} : (!fir.ref<!fir.logical<4>>) -> (!fir.ref<!fir.logical<4>>, !fir.ref<!fir.logical<4>>)
17+
! CHECK: %[[FIELD_ADDRESS:.*]] = fir.field_index __address, !fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>
18+
! CHECK: %[[COORD_ADDRESS0:.*]] = fir.coordinate_of %[[DECL_ARG0]]#1, %[[FIELD_ADDRESS]] : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, !fir.field) -> !fir.ref<i64>
19+
! CHECK: %[[ADDRESS0:.*]] = fir.load %[[COORD_ADDRESS0]] : !fir.ref<i64>
20+
! CHECK: %[[FIELD_ADDRESS:.*]] = fir.field_index __address, !fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>
21+
! CHECK: %[[COORD_ADDRESS1:.*]] = fir.coordinate_of %[[DECL_ARG1]]#1, %[[FIELD_ADDRESS]] : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, !fir.field) -> !fir.ref<i64>
22+
! CHECK: %[[ADDRESS1:.*]] = fir.load %[[COORD_ADDRESS1]] : !fir.ref<i64>
23+
! CHECK: %[[CMP:.*]] = arith.cmpi eq, %[[ADDRESS0]], %[[ADDRESS1]] : i64
24+
! CHECK: %[[RES:.*]] = fir.convert %[[CMP]] : (i1) -> !fir.logical<4>
25+
! CHECK: %[[NO_REASSOC_RES:.*]] = hlfir.no_reassoc %[[RES]] : !fir.logical<4>
26+
! CHECK: hlfir.assign %[[NO_REASSOC_RES]] to %[[DECL_RET]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
27+
! CHECK: %[[LOAD_RET:.*]] = fir.load %[[DECL_RET]]#1 : !fir.ref<!fir.logical<4>>
28+
! CHECK: return %[[LOAD_RET]] : !fir.logical<4>
29+
! CHECK: }
30+
31+
function test_c_ptr_ne(ptr1, ptr2)
32+
use, intrinsic :: iso_c_binding
33+
type(c_ptr), intent(in) :: ptr1, ptr2
34+
logical :: test_c_ptr_ne
35+
test_c_ptr_ne = (ptr1 .ne. ptr2)
36+
end
37+
38+
! CHECK-LABEL: func.func @_QPtest_c_ptr_ne(
39+
! CHECK-SAME: %[[ARG0:.*]]: !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>> {fir.bindc_name = "ptr1"}, %[[ARG1:.*]]: !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>> {fir.bindc_name = "ptr2"}) -> !fir.logical<4> {
40+
! CHECK: %[[DECL_ARG0:.*]]:2 = hlfir.declare %[[ARG0]] {fortran_attrs = #fir.var_attrs<intent_in>, uniq_name = "_QFtest_c_ptr_neEptr1"} : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) -> (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>)
41+
! CHECK: %[[DECL_ARG1:.*]]:2 = hlfir.declare %[[ARG1]] {fortran_attrs = #fir.var_attrs<intent_in>, uniq_name = "_QFtest_c_ptr_neEptr2"} : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) -> (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>)
42+
! CHECK: %[[ALLOCA:.*]] = fir.alloca !fir.logical<4> {bindc_name = "test_c_ptr_ne", uniq_name = "_QFtest_c_ptr_neEtest_c_ptr_ne"}
43+
! CHECK: %[[DECL_RET:.*]]:2 = hlfir.declare %[[ALLOCA]] {uniq_name = "_QFtest_c_ptr_neEtest_c_ptr_ne"} : (!fir.ref<!fir.logical<4>>) -> (!fir.ref<!fir.logical<4>>, !fir.ref<!fir.logical<4>>)
44+
! CHECK: %[[FIELD_ADDRESS:.*]] = fir.field_index __address, !fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>
45+
! CHECK: %[[COORD_ADDRESS0:.*]] = fir.coordinate_of %[[DECL_ARG0]]#1, %[[FIELD_ADDRESS]] : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, !fir.field) -> !fir.ref<i64>
46+
! CHECK: %[[ADDRESS0:.*]] = fir.load %[[COORD_ADDRESS0]] : !fir.ref<i64>
47+
! CHECK: %[[FIELD_ADDRESS:.*]] = fir.field_index __address, !fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>
48+
! CHECK: %[[COORD_ADDRESS1:.*]] = fir.coordinate_of %[[DECL_ARG1]]#1, %[[FIELD_ADDRESS]] : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, !fir.field) -> !fir.ref<i64>
49+
! CHECK: %[[ADDRESS1:.*]] = fir.load %[[COORD_ADDRESS1]] : !fir.ref<i64>
50+
! CHECK: %[[CMP:.*]] = arith.cmpi ne, %[[ADDRESS0]], %[[ADDRESS1]] : i64
51+
! CHECK: %[[RES:.*]] = fir.convert %[[CMP]] : (i1) -> !fir.logical<4>
52+
! CHECK: %[[NO_REASSOC_RES:.*]] = hlfir.no_reassoc %[[RES]] : !fir.logical<4>
53+
! CHECK: hlfir.assign %[[NO_REASSOC_RES]] to %[[DECL_RET]]#0 : !fir.logical<4>, !fir.ref<!fir.logical<4>>
54+
! CHECK: %[[LOAD_RET:.*]] = fir.load %[[DECL_RET]]#1 : !fir.ref<!fir.logical<4>>
55+
! CHECK: return %[[LOAD_RET]] : !fir.logical<4>
56+
! CHECK: }

0 commit comments

Comments
 (0)