[PATCH] D77093: [SelectionDAGBuilder] Fix ISD::FREEZE creation for structs with fields of different types.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 23:58:05 PDT 2020


craig.topper marked an inline comment as done.
craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:10556
+  ComputeValueVTs(DAG.getTargetLoweringInfo(), DAG.getDataLayout(), I.getType(),
+                  ValueVTs);
+  unsigned NumValues = ValueVTs.size();
----------------
aqjune wrote:
> aqjune wrote:
> > Realized that the original code had a problem with a nested struct type.
> > It would be great if there is a test for freeze with nested struct type.
> Sorry, the original code seems to successfully deal with a nested struct type too.
I think it still has a bug if the types of the other fields in the struct don't match the first type. For example this triggers an assert. (and not the one i just added..

define i64 @freeze_anonstruct() {
  %y1 = freeze {i32, {i64}} undef
  %v1 = extractvalue {i32, {i64}} %y1, 0
  %v2 = extractvalue {i32, {i64}} %y1, 1, 0
  %v3 = zext i32 %v1 to i64
  %t1 = add i64 %v3, %v2
  ret i64 %t1
}


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77093





More information about the llvm-commits mailing list