diff options
Diffstat (limited to 'llvm/lib/CodeGen/ImplicitNullChecks.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ImplicitNullChecks.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/ImplicitNullChecks.cpp b/llvm/lib/CodeGen/ImplicitNullChecks.cpp index 68110314151..75f4eef5dc1 100644 --- a/llvm/lib/CodeGen/ImplicitNullChecks.cpp +++ b/llvm/lib/CodeGen/ImplicitNullChecks.cpp @@ -235,8 +235,11 @@ bool ImplicitNullChecks::canHandle(const MachineInstr *MI) { assert(!llvm::any_of(MI->operands(), IsRegMask) && "Calls were filtered out above!"); - auto IsUnordered = [](MachineMemOperand *MMO) { return MMO->isUnordered(); }; - return llvm::all_of(MI->memoperands(), IsUnordered); + // TODO: This should be isUnordered (see D57601) once test cases are written + // demonstrating that. + auto IsSimple = [](MachineMemOperand *MMO) { + return !MMO->isVolatile() && !MMO->isAtomic(); }; + return llvm::all_of(MI->memoperands(), IsSimple); } ImplicitNullChecks::DependenceResult |