[all-commits] [llvm/llvm-project] 4d7f9b: X86: Don't fold TEST into ADD ... at GOTTPOFF/GOTNTPO...

James Y Knight via All-commits all-commits at lists.llvm.org
Fri Aug 12 14:01:56 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4d7f9b7489cdd13aac2f3337e3d46fecbb3aaf9f
      https://github.com/llvm/llvm-project/commit/4d7f9b7489cdd13aac2f3337e3d46fecbb3aaf9f
  Author: James Y Knight <jyknight at google.com>
  Date:   2022-08-12 (Fri, 12 Aug 2022)

  Changed paths:
    M llvm/lib/Target/X86/X86InstrInfo.cpp
    A llvm/test/CodeGen/X86/peephole-nofold-tpoff-x86.mir
    A llvm/test/CodeGen/X86/peephole-nofold-tpoff-x86_64.mir

  Log Message:
  -----------
  X86: Don't fold TEST into ADD ... at GOTTPOFF/GOTNTPOFF/INDNTPOFF

The linker may convert such an ADD into a LEA, so we must not
use the EFLAGS output.

This causes miscompiles with -fsanitize=null after
bacdf80f42b46044262e97e98398d1bd0b75900d added
llvm.threadlocal.address -- previously, global variables were known to
be non-null, but the intrinsic is not currently known to return
nonnull. (That should be corrected, but it shouldn't've caused
miscompiles!)

Differential Revision: https://reviews.llvm.org/D131716




More information about the All-commits mailing list