[llvm-bugs] [Bug 42491] New: Usage of isKnownWindowsMSVCEnvironment in LLVM CodeGen causes issues for IR without an environment

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 2 15:09:12 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42491

            Bug ID: 42491
           Summary: Usage of isKnownWindowsMSVCEnvironment in LLVM CodeGen
                    causes issues for IR without an environment
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: rnk at google.com
                CC: llvm-bugs at lists.llvm.org

Most tools (clang, llc, etc) normalize triples passed to them on the command
line. This mainly has the effect of defaulting in the "msvc" environment when a
triple like "x86_64-pc-win32" is passed, to produce "x86_64-pc-windows-msvc".
However, llc doesn't normalize triples from IR files, so the behavior between
an input with a triple and using the same input on the command line differs. We
use this triple predicate in a few places:

$ git grep isKnownWindowsMSVCEnvironment ../llvm
../llvm/include/llvm/ADT/Triple.h:  bool isKnownWindowsMSVCEnvironment() const
{
../llvm/include/llvm/ADT/Triple.h:    return isKnownWindowsMSVCEnvironment() ||
../llvm/lib/Analysis/TargetLibraryInfo.cpp:    if
(T.isKnownWindowsMSVCEnvironment()) {
../llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:  if
(getSubtargetInfo().getTargetTriple().isKnownWindowsMSVCEnvironment()) {
../llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:  if
(!TT.isKnownWindowsMSVCEnvironment())
../llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:  if
(T.isKnownWindowsMSVCEnvironment() || T.isWindowsItaniumEnvironment()) {
../llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:  if
(T.isKnownWindowsMSVCEnvironment() || T.isWindowsItaniumEnvironment()) {
../llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:  if
(!T.isKnownWindowsMSVCEnvironment() &&
../llvm/lib/IR/Mangler.cpp:  if (TT.isKnownWindowsMSVCEnvironment())
../llvm/lib/IR/Mangler.cpp:    if (TT.isKnownWindowsMSVCEnvironment())
../llvm/lib/IR/Mangler.cpp:  if (!T.isKnownWindowsMSVCEnvironment())
../llvm/lib/MC/MCWinCOFFStreamer.cpp:  if (T.isKnownWindowsMSVCEnvironment()) {
../llvm/lib/MC/MCWinCOFFStreamer.cpp:  if (!T.isKnownWindowsMSVCEnvironment()
&& ByteAlignment > 1) {
../llvm/lib/Target/X86/X86Subtarget.h:    return
TargetTriple.isKnownWindowsMSVCEnvironment();

Mainly, a user reported that the storage class of __real at XXX constant pool
entries was incorrect when they used llc, but not clang, which overrides the
module triple.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190702/e283f304/attachment.html>


More information about the llvm-bugs mailing list