[PATCH] D123272: [coroutines] Get an IntegerType from the value instead of defaulting to 64 bit
Nathan Lanza via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 7 10:35:31 PDT 2022
lanza updated this revision to Diff 421278.
lanza added a comment.
update from repo
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123272/new/
https://reviews.llvm.org/D123272
Files:
llvm/lib/Transforms/Coroutines/CoroFrame.cpp
Index: llvm/lib/Transforms/Coroutines/CoroFrame.cpp
===================================================================
--- llvm/lib/Transforms/Coroutines/CoroFrame.cpp
+++ llvm/lib/Transforms/Coroutines/CoroFrame.cpp
@@ -1754,9 +1754,10 @@
auto *FramePtr = GetFramePointer(Alloca);
auto *FramePtrRaw =
Builder.CreateBitCast(FramePtr, Type::getInt8PtrTy(C));
- auto *AliasPtr = Builder.CreateGEP(
- Type::getInt8Ty(C), FramePtrRaw,
- ConstantInt::get(Type::getInt64Ty(C), Alias.second.getValue()));
+ auto &Value = Alias.second.getValue();
+ auto ITy = IntegerType::get(C, Value.getBitWidth());
+ auto *AliasPtr = Builder.CreateGEP(Type::getInt8Ty(C), FramePtrRaw,
+ ConstantInt::get(ITy, Value));
auto *AliasPtrTyped =
Builder.CreateBitCast(AliasPtr, Alias.first->getType());
Alias.first->replaceUsesWithIf(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123272.421278.patch
Type: text/x-patch
Size: 937 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220407/9e64b120/attachment.bin>
More information about the llvm-commits
mailing list