[clang] [llvm] [IR] Memory effects for floating-point operations (PR #221754)
Krzysztof Drewniak via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 17 10:56:51 PDT 2026
================
@@ -119,24 +135,41 @@ template <typename LocationEnum> class MemoryEffectsBase {
setModRef(Loc, MR);
}
+ /// Create MemoryEffectsBase that can access any location with the given
+ /// ModRefInfo, excluding floating-point locations.
+ /// The boolean argument value is not used, it only allows to distinguish
+ /// between constructors.
+ MemoryEffectsBase(ModRefInfo MR, bool) {
+ for (Location Loc : mem_locations())
+ setModRef(Loc, MR);
+ }
+
/// Create MemoryEffectsBase that can read and write any memory.
static MemoryEffectsBase unknown() {
return MemoryEffectsBase(ModRefInfo::ModRef);
}
+ /// Create MemoryEffectsBase that can read and write any memory except
+ /// floating-point registers.
+ static MemoryEffectsBase unknown_mem() {
+ return MemoryEffectsBase(ModRefInfo::ModRef, false);
----------------
krzysz00 wrote:
```suggestion
return MemoryEffectsBase(ModRefInfo::ModRef, /*AccessesFpInfo=*/false);
```
https://github.com/llvm/llvm-project/pull/221754
More information about the cfe-commits
mailing list