[PATCH] D29011: [IR] Add Freeze instruction

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 13 01:24:50 PDT 2019


aqjune marked 2 inline comments as done.
aqjune added inline comments.


================
Comment at: include/llvm/IR/Operator.h:594
+{};
+
 } // end namespace llvm
----------------
I added FreezeOperator here, as other operators including OverflowingBinaryOperator were in this file.


================
Comment at: test/Bindings/llvm-c/freeze.ll:12
+  %6 = freeze <2 x float> %arg4
+  %7 = freeze i8* %arg5
+  ret i32 %1
----------------
jdoerfert wrote:
> Missing types, here and elsewhere I think:
> - array
> - struct w/ definition
> - struct w/o definition (opaque)
> - non-standard integer size (i666)
> 
> Missing inputs:
> - undef
> - null
> 
I found that `freeze i8* null` raised an error due to a bug in `tools/llvm-c-test/echo.cpp`:

```
  // Try null
  if (LLVMIsNull(Cst)) {
    check_value_kind(Cst, LLVMConstantTokenNoneValueKind);
    LLVMTypeRef Ty = TypeCloner(M).Clone(Cst);
    return LLVMConstNull(Ty);
  }
```
Here, Cst can not only be `LLVMConstantTokenNoneValueKind` but also `LLVMConstantPointerNullValueKind`.
I'll make a separate patch that resolves this error, then I'll be able to add `freeze i8* null` test.


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

https://reviews.llvm.org/D29011





More information about the llvm-commits mailing list