[PATCH] D101696: [Matrix] Implement C-style explicit type conversions in CXX for matrix types

Saurabh Jha via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 2 06:09:58 PDT 2021


SaurabhJha added inline comments.


================
Comment at: clang/test/CodeGenCXX/matrix-casts.cpp:26
+  // CHECK:       [[C:%.*]] = load <25 x i8>, <25 x i8>* {{.*}}, align 1
+  // CHECK-NEXT:  [[CONV:%.*]] = sext <25 x i8> [[C]] to <25 x i32>
+  // CHECK-NEXT:  [[CONV1:%.*]] = bitcast [25 x i32]* {{.*}} to <25 x i32>*
----------------
fhahn wrote:
> Shouldn't this use `zext` for the conversion? Possibly that's an issue with the existing conversion code for matrixes?
Would definitely debug it but would like to quickly clarify this.

[[ https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CGExprScalar.cpp#L1225-L1236 | This ]] is the code that's being executed. For int->int conversion, we are just checking the whether input is signed and regardless of whether output type is signed, we do `CreateIntCast`. We probably need to check `OutputSigned` too, right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101696



More information about the cfe-commits mailing list