diff options
| author | aqjune <aqjune@gmail.com> | 2019-11-07 01:17:49 +0900 |
|---|---|---|
| committer | aqjune <aqjune@gmail.com> | 2019-11-12 10:49:00 +0900 |
| commit | e87d71668e10f51abe4b2f1f3c44591aca783750 (patch) | |
| tree | c33db0298cc2ef75a9c7fd30bf082f6e150c527a /llvm/lib/CodeGen | |
| parent | c46b3a2abd38d6fecd389c97dfa7df54af77fdb9 (diff) | |
| download | bcm5719-llvm-e87d71668e10f51abe4b2f1f3c44591aca783750.tar.gz bcm5719-llvm-e87d71668e10f51abe4b2f1f3c44591aca783750.zip | |
[IR] Redefine Freeze instruction
Summary:
This patch redefines freeze instruction from being UnaryOperator to a subclass of UnaryInstruction.
ConstantExpr freeze is removed, as discussed in the previous review.
FreezeOperator is not added because there's no ConstantExpr freeze.
`freeze i8* null` test is added to `test/Bindings/llvm-c/freeze.ll` as well, because the null pointer-related bug in `tools/llvm-c/echo.cpp` is now fixed.
InstVisitor has visitFreeze now because freeze is not unaryop anymore.
Reviewers: whitequark, deadalnix, craig.topper, jdoerfert, lebedev.ri
Reviewed By: craig.topper, lebedev.ri
Subscribers: regehr, nlopes, mehdi_amini, hiraditya, steven_wu, dexonsmith, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69932
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 914edad0b8b..18fef7db9c7 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -10593,7 +10593,7 @@ void SelectionDAGBuilder::visitSwitch(const SwitchInst &SI) { } } -void SelectionDAGBuilder::visitFreeze(const User &I) { +void SelectionDAGBuilder::visitFreeze(const FreezeInst &I) { SDValue N = getValue(I.getOperand(0)); setValue(&I, N); } diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h index c288a4f6908..1579ef3ad75 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h @@ -668,7 +668,6 @@ private: void visitUnary(const User &I, unsigned Opcode); void visitFNeg(const User &I) { visitUnary(I, ISD::FNEG); } - void visitFreeze(const User &I); void visitBinary(const User &I, unsigned Opcode); void visitShift(const User &I, unsigned Opcode); @@ -743,6 +742,7 @@ private: void visitAtomicStore(const StoreInst &I); void visitLoadFromSwiftError(const LoadInst &I); void visitStoreToSwiftError(const StoreInst &I); + void visitFreeze(const FreezeInst &I); void visitInlineAsm(ImmutableCallSite CS); void visitIntrinsicCall(const CallInst &I, unsigned Intrinsic); |

