[PATCH] D60224: [TargetLowering] Extend bool args to inline-asm according to getBooleanType

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 6 10:19:58 PDT 2019


nickdesaulniers added a subscriber: eli.friedman.
nickdesaulniers added a comment.

In D60224#1454229 <https://reviews.llvm.org/D60224#1454229>, @kees wrote:

> Should I respin to make booleans always zero extended? I can adjust the X86 code at the same time...


Just to see what would happen:

  diff --git a/llvm/include/llvm/IR/Constants.h b/llvm/include/llvm/IR/Constants.h
  index ca56e8b9328c..ebb4f500e4fa 100644
  --- a/llvm/include/llvm/IR/Constants.h
  +++ b/llvm/include/llvm/IR/Constants.h
  @@ -146,7 +146,7 @@ public:
     /// that this method can assert if the value does not fit in 64 bits.
     /// Return the zero extended value.
     inline uint64_t getZExtValue() const {
  -    return Val.getZExtValue();
  +    return (getBitWidth() == 1) ? Val.getSExtValue() : Val.getZExtValue();
     }
   
     /// Return the constant as a 64-bit integer value after it has been sign

produces 34 test failures.  They seem related:

  LLVM :: CodeGen/X86/inline-asm-i-constraint-i1.ll
  LLVM :: CodeGen/X86/pr32241.ll
  LLVM :: CodeGen/X86/xaluo.ll
  LLVM :: CodeGen/X86/xmulo.ll
  LLVM :: ThinLTO/X86/cache-typeid-resolutions.ll
  LLVM :: Transforms/LoopVectorize/AArch64/outer_loop_test1_no_explicit_vect_width.ll
  LLVM :: Transforms/LoopVectorize/X86/metadata-enable.ll
  LLVM :: Transforms/LoopVectorize/X86/no_fpmath.ll
  LLVM :: Transforms/LoopVectorize/X86/no_fpmath_with_hotness.ll
  LLVM :: Transforms/LoopVectorize/X86/outer_loop_test1_no_explicit_vect_width.ll
  LLVM :: Transforms/LoopVectorize/X86/vect.omp.force.small-tc.ll
  LLVM :: Transforms/LoopVectorize/X86/vectorization-remarks-missed.ll
  LLVM :: Transforms/LoopVectorize/no_switch.ll
  LLVM :: Transforms/LoopVectorize/outer_loop_test1.ll
  LLVM :: Transforms/LoopVectorize/outer_loop_test2.ll
  LLVM :: Transforms/WholeProgramDevirt/constant-arg.ll
  LLVM :: Transforms/WholeProgramDevirt/export-unique-ret-val.ll
  LLVM :: Transforms/WholeProgramDevirt/export-vcp.ll
  LLVM :: Transforms/WholeProgramDevirt/unique-retval.ll
  LLVM :: Transforms/WholeProgramDevirt/virtual-const-prop-begin.ll
  LLVM :: Transforms/WholeProgramDevirt/virtual-const-prop-check.ll
  LLVM :: Transforms/WholeProgramDevirt/virtual-const-prop-end.ll

@jyknight @kparzysz @eli.friedman thoughts? (is this a terrible idea?)


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60224/new/

https://reviews.llvm.org/D60224





More information about the llvm-commits mailing list