mayuyu.io via llvm-dev
2018-May-31 02:21 UTC
[llvm-dev] Proper way to lower all ConstantExprs?
Hi: For my own Transform passes I need to lower all ConstantExpressions into Instructions in order to conveniently analyze the use-def def-use chains and operand comparisons. Could anyone possibly kindly share some insights on if there is any standard way to do this without crafting my own implementation and if not, should we add this feature into LLVM upstream? Zhang
Friedman, Eli via llvm-dev
2018-May-31 17:59 UTC
[llvm-dev] Proper way to lower all ConstantExprs?
On 5/30/2018 7:21 PM, mayuyu.io via llvm-dev wrote:> Hi: > For my own Transform passes I need to lower all ConstantExpressions into Instructions in order to conveniently analyze the use-def def-use chains and operand comparisons. Could anyone possibly kindly share some insights on if there is any standard way to do this without crafting my own implementation and if not, should we add this feature into LLVM upstream?There's a helper ConstantExpr::getAsInstruction to create an Instruction for a given ConstantExpr. I don't think there's any code to do this for *all* ConstantExprs/ConstantAggregates used by a given function; if you think you need this, you might want to reconsider your approach. (Recursively visiting constant expressions isn't very hard, if you need it.) -Eli -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Reasonably Related Threads
- [LLVMdev] Transforming ConstantExprs to Instructions
- [LLVMdev] Transforming ConstantExprs to Instructions
- [LLVMdev] question about enabling cfl-aa and collecting a57 numbers
- [LLVMdev] Getelementptr woes
- [LLVMdev] question about enabling cfl-aa and collecting a57 numbers