[PATCH] D98757: [AMX] Not fold constant bitcast into amx intrisic
Xiang Zhang via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 16 22:22:25 PDT 2021
xiangzhangllvm added a comment.
In D98757#2630844 <https://reviews.llvm.org/D98757#2630844>, @LuoYuanke wrote:
> Probably we need a .ll test case to for constant folding.
Fold constant is done in CSE and SCCP which are both passes run in Clang (O2 <https://reviews.llvm.org/owners/package/2/>)
================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:101
/// Constant fold bitcast, symbolically evaluating it with DataLayout.
/// This always returns a non-null constant, but it may be a
/// ConstantExpr if unfoldable.
----------------
clin1 wrote:
> API for this function always returns non-null: can we return ConstantExpr::getBitCast(C,DestTy) instead? Then the change in SCCP is not needed either.
I tried, the SCCP will also fold the bitcast into the following instruction.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98757/new/
https://reviews.llvm.org/D98757
More information about the cfe-commits
mailing list