Matt Arsenault via llvm-dev
2018-Dec-14 03:40 UTC
[llvm-dev] The bit pattern after stripPointerCasts()
> On Dec 14, 2018, at 2:21 PM, Finkel, Hal J. via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > > On 12/11/18 6:51 PM, Doerfert, Johannes Rudolf via llvm-dev wrote: >> Hi, >> >> in a recent review [0], Florian Hahn helped me to realize something that >> was rather surprising to me: >> >> The widely popular and very useful function >> llvm::Value::stripPointerCasts() can return a value with a different >> bit pattern than the input. >> >> Now, I think this should not be the case but I want the hear other >> opinions. Before I go on, please not that there is at least one location >> in the code base [1] that makes a wrong assumption about the bit pattern >> preservation. > If there's really only one place that gets this wrong (or only a few), I'm inclined to suggest option (1) below and fix this one place. > > Matt, any thoughts on this? > > -Hal > >Yes, I’ve wanted a version which strips addrspacecast and which doesn’t before, so +1 -Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181214/1676f428/attachment.html>
Finkel, Hal J. via llvm-dev
2018-Dec-14 03:44 UTC
[llvm-dev] The bit pattern after stripPointerCasts()
On 12/13/18 9:40 PM, Matt Arsenault wrote: On Dec 14, 2018, at 2:21 PM, Finkel, Hal J. via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote: On 12/11/18 6:51 PM, Doerfert, Johannes Rudolf via llvm-dev wrote: Hi, in a recent review [0], Florian Hahn helped me to realize something that was rather surprising to me: The widely popular and very useful function llvm::Value::stripPointerCasts() can return a value with a different bit pattern than the input. Now, I think this should not be the case but I want the hear other opinions. Before I go on, please not that there is at least one location in the code base [1] that makes a wrong assumption about the bit pattern preservation. If there's really only one place that gets this wrong (or only a few), I'm inclined to suggest option (1) below and fix this one place. Matt, any thoughts on this? -Hal Yes, I’ve wanted a version which strips addrspacecast and which doesn’t before, so +1 Do you have an opinion on which should be the default? -Hal -Matt -- Hal Finkel Lead, Compiler Technology and Programming Languages Leadership Computing Facility Argonne National Laboratory -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181214/5df8aba9/attachment-0001.html>
Matt Arsenault via llvm-dev
2018-Dec-14 06:11 UTC
[llvm-dev] The bit pattern after stripPointerCasts()
> On Dec 14, 2018, at 2:44 PM, Finkel, Hal J. <hfinkel at anl.gov> wrote: > > Do you have an opinion on which should be the default? > > -Hal > >Not particularly. The current name sounds to me like it would strip any casts it possibly can. Maybe most uses should now be converted to a newly named stripTrivialPointerCasts? -Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181214/1699d4fb/attachment.html>
Possibly Parallel Threads
- The bit pattern after stripPointerCasts()
- The bit pattern after stripPointerCasts()
- [LLVMdev] dyn_cast<Instruction *> returns NULL where it should return a valid instruction
- [LLVMdev] dyn_cast<Instruction *> returns NULL where it should return a valid instruction
- [LLVMdev] [PATCH] PR2218