[PATCH] D102822: [Clang][CodeGen] Set the size of llvm.lifetime to unknown for scalable types.

Sander de Smalen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 4 01:27:47 PDT 2021


sdesmalen added inline comments.


================
Comment at: clang/test/CodeGen/RISCV/riscv-v-lifetime.cpp:17
+// CHECK-NEXT:    [[TMP1:%.*]] = bitcast <vscale x 2 x i32>* [[REF_TMP]] to i8*
+// CHECK-NEXT:    call void @llvm.lifetime.start.p0i8(i64 -1, i8* [[TMP1]]) #[[ATTR3]]
+// CHECK-NEXT:    [[CALL:%.*]] = call <vscale x 2 x i32> @_Z3Bazv()
----------------
nit: I'm not sure if there is any policy on this, but for this test you can just as well have 6 CHECK lines, instead of auto-generating all of them, which makes the test a bit easier to read.

  // CHECK-LABEL: @_Z4Testv
  // CHECK-NEXT:    [[ALLOCA:%.*]] = alloca <vscale x 2 x i32>, align 4
  // CHECK-NEXT:    [[BC1:%.*]] = bitcast <vscale x 2 x i32>* [[ALLOCA]] to i8*
  // CHECK-NEXT:    call void @llvm.lifetime.start.p0i8(i64 -1, i8* [[BC1]])
  // CHECK-NEXT:    [[BC2:%.*]] = bitcast <vscale x 2 x i32>* [[ALLOCA]] to i8*
  // CHECK-NEXT:    call void @llvm.lifetime.end.p0i8(i64 -1, i8* [[BC2]])


================
Comment at: clang/test/CodeGen/RISCV/riscv-v-lifetime.cpp:3
+// REQUIRES: riscv-registered-target
+// RUN: %clang_cc1 -std=c++11 -triple riscv64 -target-feature +experimental-v \
+// RUN:   -emit-llvm -O1 -o - %s | FileCheck %s
----------------
craig.topper wrote:
> Probably best to add -disable-llvm-passes so we don't run the optimizer.
nit: Does `-O1` still have any effect if `-disable-llvm-passes` is also set?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102822/new/

https://reviews.llvm.org/D102822



More information about the cfe-commits mailing list