Skip to content

Commit 85d4175

Browse files
authored
Revert "[flang][hlfir] get rid of box when translating scalars to extented value" (#125222)
Reverts #125059 Broke OPTIONAL lowering for some intrinsics. I have a proper fix for review #125215, but I would like to better test it, so I am reverting in the meantime.
1 parent 46befd7 commit 85d4175

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

flang/include/flang/Optimizer/Builder/HLFIRTools.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class Entity : public mlir::Value {
125125
bool isSimplyContiguous() const {
126126
// If this can be described without a fir.box in FIR, this must
127127
// be contiguous.
128-
if (!hlfir::isBoxAddressOrValueType(getFirBase().getType()) || isScalar())
128+
if (!hlfir::isBoxAddressOrValueType(getFirBase().getType()))
129129
return true;
130130
// Otherwise, if this entity has a visible declaration in FIR,
131131
// or is the dereference of an allocatable or contiguous pointer

flang/test/HLFIR/assign-codegen.fir

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -427,13 +427,3 @@ func.func @test_upoly_expr_assignment(%arg0: !fir.class<!fir.array<?xnone>> {fir
427427
// CHECK: }
428428
// CHECK: return
429429
// CHECK: }
430-
431-
func.func @test_scalar_box(%arg0: f32, %arg1: !fir.box<!fir.ptr<f32>>) {
432-
hlfir.assign %arg0 to %arg1 : f32, !fir.box<!fir.ptr<f32>>
433-
return
434-
}
435-
// CHECK-LABEL: func.func @test_scalar_box(
436-
// CHECK-SAME: %[[VAL_0:.*]]: f32,
437-
// CHECK-SAME: %[[VAL_1:.*]]: !fir.box<!fir.ptr<f32>>) {
438-
// CHECK: %[[VAL_2:.*]] = fir.box_addr %[[VAL_1]] : (!fir.box<!fir.ptr<f32>>) -> !fir.ptr<f32>
439-
// CHECK: fir.store %[[VAL_0]] to %[[VAL_2]] : !fir.ptr<f32>

0 commit comments

Comments
 (0)