aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-09-29 11:21:13 +0200
committerNikita Popov <npopov@redhat.com>2023-09-29 11:21:13 +0200
commit739c86df807748182e576e11697db6002738aafd (patch)
treedd83620b6c6c0b3caf5e954748281a5ef50f98be /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent86dea5aab835f37b6e7c3b5a477c8a00881be62f (diff)
downloadllvm-739c86df807748182e576e11697db6002738aafd.zip
llvm-739c86df807748182e576e11697db6002738aafd.tar.gz
llvm-739c86df807748182e576e11697db6002738aafd.tar.bz2
[llvm] Use more explicit cast methods (NFC)
Instead of ConstantExpr::getCast() with a fixed opcode, use the corresponding getXYZ methods instead. For the one place creating a pointer bitcast drop it entirely, as this is redundant with opaque pointers.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index faee623..e31b08d 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -6305,7 +6305,7 @@ bool CodeGenPrepare::optimizePhiType(
// correct type.
ValueToValueMap ValMap;
for (ConstantData *C : Constants)
- ValMap[C] = ConstantExpr::getCast(Instruction::BitCast, C, ConvertTy);
+ ValMap[C] = ConstantExpr::getBitCast(C, ConvertTy);
for (Instruction *D : Defs) {
if (isa<BitCastInst>(D)) {
ValMap[D] = D->getOperand(0);