[PATCH] D29011: [IR] Add Freeze instruction
Dan Liew via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 10 00:19:35 PDT 2017
delcypher added inline comments.
================
Comment at: lib/AsmParser/LLParser.cpp:5953
+ if (!Op->getType()->isIntegerTy())
+ return Error(Loc,"cannot freeze non-integer type");
+
----------------
@aqjune What's the motivation to restricting the `freeze` instruction to scalar integers?
For vector SSA registers that contain integers that we want to "freeze" this would force doing constructing a new vector by use of `extractelement`, `freeze` on the each scalar element and then `insertelement` to construct the new register. This seems a bit cumbersome.
I presume the reason for not allowing floating point operands is that none of the floating point instructions are supposed to produce poison? However consider the `load` instruction. That could load poisoned memory and the type could be a floating point type. There's an example of a poisoned load in the IR language reference ( https://llvm.org/docs/LangRef.html#poison-values ).
https://reviews.llvm.org/D29011
More information about the llvm-commits
mailing list