[PATCH] D108771: [GlobalOpt] don't hoist constant expressions that can trap

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 26 10:06:20 PDT 2021


spatel created this revision.
spatel added reviewers: efriedma, jdoerfert, lebedev.ri, afd.
Herald added subscribers: ormris, jfb, hiraditya, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.

We try to forward a stored-once-constant-value from one global access to another, but that's not safe if the constant value is an expression that can trap.
The tests are reduced from the miscompile examples in:
https://llvm.org/PR47578


https://reviews.llvm.org/D108771

Files:
  llvm/lib/Transforms/IPO/GlobalOpt.cpp
  llvm/test/Transforms/GlobalOpt/constant-can-trap.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108771.368919.patch
Type: text/x-patch
Size: 5595 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210826/94e87baf/attachment.bin>


More information about the llvm-commits mailing list